Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧾 Invoice Dashboard

Welcome to the Invoice Dashboard! This project is built using Fastify for the backend, Prisma for database management, and PostgreSQL as the database. The backend is responsible for managing invoice data and serves API routes for handling invoices.

🚀 Getting Started

Prerequisites

Make sure you have the following tools installed on your machine:

📂 Project Setup

  1. Clone the repository:

    git clone <repository-url>
    cd invoice-dashboard
  2. Install dependencies:

    npm install
  3. Create the PostgreSQL database: Ensure you have PostgreSQL running locally or within your environment. Create a database named invoiceDB.

  4. Set up environment variables: Create a .env file in the root directory and add the following:

    DATABASE_URL="postgresql://<your_user>:<your_password>@localhost:5432/invoiceDB?schema=public" 

    Replace <your_user> and <your_password> with your PostgreSQL username and password.

  5. Run Prisma migrations: After setting up the environment variables, apply the database schema by running:

    npx prisma migrate dev --name init
  6. Generate Prisma Client: Ensure the Prisma Client is generated and synced with the schema:

    npx prisma generate

🏃 Running the Project

To run the Fastify server locally:

npx ts-node src/server.ts

Running the Frontend Navigate to the client folder:

cd client

Install client dependencies:

npm install

Start the React development server:

npm run dev

The frontend will be available at http://localhost:5173.

🛠️ API Endpoints Upload an Invoice File You can upload an invoice PDF file using Postman:

Open Postman and create a new POST request.

Set the request URL to:

http://localhost:3000/api/upload-invoice

In the Body tab, select form-data and add a key called file. Select the PDF file you want to upload as the value.

Send the request. If the upload is successful, you should receive a 201 Created status and the invoice data.

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages