This project is a full-stack application that leverages FastAPI for the backend and React with Vite for the frontend.
- Separate react components in a more intuitive way
- Don't directly use fetch. Instead abstract away all the external api calls using Axios
- In the backend, create a separate controller, instead of creating the endpoints in the main.py file
- The Chart is not that good looking, more improvements can definitely be done
- The UI in general is not the most UX friendly. Although is not that ugly, it could be much better.
- The table is not mobile responsive.
Before you begin, ensure you have met the following requirements:
- You have installed Python 3.7 or later.
- You have installed pip, the Python package installer.
- You have installed Node.js and npm (Node Package Manager).
First, clone the repository to your local machine:
Next, install the required Python packages using pip and venv:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Ensure you have PostgreSQL installed and running. The automatically creates the database and seeds it with the .CSV files data at boot time.
Update the DATABASE_URL
in your .env
file with your database credentials.
First you need to go to the server folder:
cd server
You can start the FastAPI server using Uvicorn:
bash uvicorn app.main:app --reload
The --reload
flag enables hot reloading, which means the server will automatically update whenever you make changes to your code.
Navigate to the frontend directory and install the necessary Node.js packages:
bash cd frontend npm install
You can start the Vite development server with:
npm run start
Tthis command starts the development server and opens your application in a web browser.
Once both the backend and frontend are running, you can access the application by opening a web browser and navigating to http://localhost:5173
(or the port specified by Vite).