Implements a simple React interface for creating new products, displaying them in a table and deleting them. It uses SQLite for persistence.
Note: All of the commands assume root dir as the root of the repo. Adjust accordingly.
-
Open two terminals and change directory (
cd
) toclient
andserver
respectively. -
In
server
terminal:- Install required packages based on the
requirements.txt
file. (Note: You might want to use a virtual environment to isolate your main installation.)
pip install -r requirements.txt
- Start the
server
backend usinguvicorn
. You can optionally set it to reload automatically on code changes using--reload
).
uvicorn src.main:app --reload
- Install required packages based on the
-
In
client
terminal:- Install the necessary NPM packages using:
npm install
- Start up the React application in the
client
terminal using:
npm start
-
You can now access the React application at
http://localhost:3000
-
The backend API is accessible at
http://localhost:8000
. For direct interaction I recommend usinghttp://localhost:8000/docs
which enables you to run requests against the API easily.
Only the FastAPI component is covered with tests at this point. To run them, simply run pytest
from the server
directory and it will take care of the rest.