Before you begin, ensure you have the following installed on your system:
- Python: Version 3.8 or higher.
- pip: Python package installer (usually comes with Python).
- Node.js: Version 18.x or higher.
- npm: Node package manager (usually comes with Node.js). You can also use
yarn,pnpm, orbun.
-
Navigate to the Backend Directory:
cd backend -
Create and Activate a Virtual Environment:
- Windows (Command Prompt):
python -m venv venv .\venv\Scripts\activate
- Windows (PowerShell):
(Note: You might need to adjust your execution policy:
python -m venv venv .\venv\Scripts\Activate.ps1Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process) - macOS / Linux (Bash):
python3 -m venv venv source venv/bin/activate
- Windows (Command Prompt):
-
Install Dependencies: (Assuming you have a
requirements.txtfile in thebackenddirectory)pip install -r requirements.txt
-
Configure Database:
- The application uses a PostgreSQL database. The connection URL is configured via the
DATABASE_URLenvironment variable. - The default development connection string points to a NeonDB instance (as seen in
backend/app/db/database.pyline 6 andbackend/app/database.pyline 8-9). - Set the Environment Variable:
- You can set this variable in your shell before running the application:
- Windows (Command Prompt):
set DATABASE_URL="postgresql://user:password@host:port/dbname"
- Windows (PowerShell):
$env:DATABASE_URL="postgresql://user:password@host:port/dbname"
- macOS / Linux (Bash):
export DATABASE_URL="postgresql://user:password@host:port/dbname"
- Windows (Command Prompt):
- Alternatively, create a
.envfile in thebackend/appdirectory with the following content:(Replace the example URL with your actual database connection string. Uvicorn should pick this up ifDATABASE_URL="postgresql://user:password@host:port/dbname"
python-dotenvis installed, based on the configuration check inbackend/venv/Lib/site-packages/uvicorn/config.pylines 323-327)
- You can set this variable in your shell before running the application:
- The application uses a PostgreSQL database. The connection URL is configured via the
-
Run Database Migrations:
- The project uses Alembic for database migrations (configured in
backend/app/alembic.iniandbackend/app/migrations/env.py). - Apply the latest migrations to set up your database schema:
alembic upgrade head
(Make sure you are in the
backenddirectory wherealembic.iniis located, or adjust the command/configuration if needed) - The project uses Alembic for database migrations (configured in
-
Run the Backend Server:
- Navigate to the directory containing
main.py:cd app - Start the Uvicorn server (as defined in
backend/app/main.pyline 36):uvicorn main:app --host 0.0.0.0 --port 8000 --reload
- The backend API should now be running at
http://localhost:8000. The--reloadflag enables auto-reloading on code changes, which is useful for development.
- Navigate to the directory containing
-
Navigate to the Frontend Directory:
cd frontend(If you were in
backend/app, you'll need to go up two levels first:cd ../../frontend) -
Install Dependencies:
npm install
(Or
yarn install,pnpm install,bun install) -
Configure Environment Variables (Optional):
- For development, the frontend automatically connects to the backend at
http://localhost:8000(as seen infrontend/src/services/auth.tslines 8-15). - For production builds, you might need to create a
.env.localfile in thefrontenddirectory and set the backend API URL:NEXT_PUBLIC_API_URL=https://your-production-api-url.com
- For development, the frontend automatically connects to the backend at
-
Run the Frontend Development Server:
npm run dev
(Or
yarn dev,pnpm dev,bun dev- based onfrontend/package.jsonline 6) -
Access the Frontend:
- Open your web browser and navigate to
http://localhost:3000(as mentioned infrontend/README.mdline 17).
- Open your web browser and navigate to
To run the complete application:
- Start the backend server (steps 1-6 in Backend Setup).
- Start the frontend development server (steps 1-4 in Frontend Setup).
- Access the application through your browser at
http://localhost:3000.
The frontend will make requests to the backend API running on http://localhost:8000.