Welcome to the Full-Stack FastAPI and React template repository. This repository serves as a demo application for interns, showcasing how to set up and run a full-stack application with a FastAPI backend and a ReactJS frontend using ChakraUI.
The repository is organized into two main directories:
- frontend: Contains the ReactJS application.
- backend: Contains the FastAPI application and PostgreSQL database integration.
Each directory has its own README file with detailed instructions specific to that part of the application.
- Python 3.8 or higher
- Poetry (for dependency management)
- PostgreSQL (ensure the database server is running)
Node.js (version 14.x or higher) npm (version 6.x or higher)
-
Clone the repository to your local machine.
git clone <repository_url>
-
Navigate to the
backend
directory and install the Python dependenciescd backend poetry install
-
update the necessary configurations in the '.env' file, particularly the database configuration.
-
Set up the database with the necessary tables
poetry run bash ./prestart.sh
-
Run the backend server
poetry run uvicorn app.main:app --reload
-
Clone the repository to your local machine.
cd frontend
-
Navigate to the
frontend
directory and install the Frontend dependenciesnpm install
-
Update the configuration file in the
.env
with your own data -
Run the deployment server
npm run dev
- Install Docker Compose if you haven't already.
- Run
docker-compose up -d
to start both the backend and frontend services.