This project consists of a React frontend with TypeScript (using Vite) and a FastAPI backend.
The frontend is built using Vite with React and TypeScript.
To run the frontend:
cd frontend
npm install
npm run dev
The backend is built using FastAPI.
To run the backend:
-
Install the required Python packages:
cd backend python -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Set up the PostgreSQL database:
- Install PostgreSQL if not already installed
- Create a new database for the project
- Update the
.env
file in thebackend
directory with your database credentials:
DATABASE_URL=postgresql://your_username:your_password@localhost:5432/your_database_name
-
Add your OpenAI API key:
- Update the
.env
file in thebackend
directory - Add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
- Update the
-
Run the database setup script after updating the database name in the setup.sql file:
psql -d your_database_name -f backend/setup.sql
-
Add a secret key to your .env file:
- Generate a secure random string to use as your secret key. You can use a tool like OpenSSL:
openssl rand -hex 32
- Add the generated secret key to your
.env
file:SECRET_KEY=your_generated_secret_key_here
Replace
your_generated_secret_key_here
with the actual key you generated. - Generate a secure random string to use as your secret key. You can use a tool like OpenSSL:
-
Start the backend server:
uvicorn app.main:app --reload
To run the application, start the backend and frontend servers:
cd backend
uvicorn main:app --reload
cd frontend
npm run dev
Open your browser and navigate to http://localhost:5173
to access the application.