This is a FastAPI-based backend project with configuration endpoints to manage your database easily.
Before installing dependencies, make sure you are in a virtual environment:
Windows:
python -m venv .venv
venv\Scripts\activateLinux/MacOS:
python3 -m venv venv
source venv/bin/activateOnce your virtual environment is activated, install dependencies:
pip install -r requirements.txt
⚠️ Important: If the installation fails due to compilation errors (especially on Windows), make sure you have * Visual Studio C++ Build Tools* installed.
Download from:
👉 https://visualstudio.microsoft.com/visual-cpp-build-tools/
Create these environment variables to run the project:
DB_HOST: The URL for your database connection.DB_PORT: The port for your database connection.DB_NAME: The name of your database.DB_USER: The username for your database.DB_PASSWORD: The password for your database.SECRET_KEY: A secret key for your application (e.g., for JWT tokens).GEMINI_API_KEY: Your API key for the Gemini API.
Before making a Pull Request, update requirements.txt to make sure your changes are captured.
pip freeze > requirements.txtMake sure you're in the virtual environment and run:
uvicorn main:app --reloadThese endpoints are available under the /config prefix and should be used carefully, usually during development or
initial setup.
Creates necessary tables in the database.
Example Request:
POST /config/create-tablesResponse:
{
"message": "Tables created successfully."
}Drops all data and resets the database to its initial state.
Example Request:
POST /config/reset-databaseResponse:
{
"message": "Database reset successfully."
}
⚠️ Use with caution — this will erase all current data!
Currently when reset-database called there will be a dummy user created with the following credentials:
- Username:
johndoe - Password:
123
- Username:
johnsmith - Password:
admin@123
- Keep your virtual environment activated whenever you're working on the project.
- Use
pip freeze > requirements.txtregularly to avoid dependency mismatches. - Only use the config endpoints during development or initial deployment.