Frontend and Backend Setup
Prerequisites:
- Node.js installed on your machine.
- A code editor (e.g., VS Code).
Steps to Run Frontend:
-
Navigate to the Frontend Directory Open your terminal and run: cd path/to/frontend
-
Install Dependencies Run the following command to install the required packages: npm install
-
Start the Development Server Launch the frontend by running: npm start This will start the development server, and you can access the application in your browser at: http://localhost:3000
-
Build for Production (Optional) To create a production-ready build: npm run build
npm install: Install all dependencies.npm start: Run the application in development mode.npm run build: Build the app for production.
Prerequisites:
- Python installed on your machine.
- A virtual environment tool (e.g.,
venv). - SQLite (or any configured database).
Steps to Run Backend:
-
Navigate to the Backend Directory Open your terminal and run: cd path/to/backend
-
Create a Virtual Environment Set up a virtual environment to isolate the backend dependencies: python -m venv venv
-
Activate the Virtual Environment
- For Windows: venv\Scripts\activate
- For Mac/Linux: source venv/bin/activate
-
Install Dependencies Install all required Python packages: pip install -r requirements.txt
-
Set Up the Database Initialize the database by running: python -m backend.database
-
Start the Backend Server Use Uvicorn to start the FastAPI server: uvicorn backend.main:app --reload The backend server will be accessible at: http://127.0.0.1:8000
-
Testing API Endpoints (Optional) Open your browser or use tools like Postman to test API endpoints. For API documentation, visit: http://127.0.0.1:8000/docs
python -m venv venv: Create a virtual environment.venv\\Scripts\\activate: Activate virtual environment (Windows).source venv/bin/activate: Activate virtual environment (Mac/Linux).pip install -r requirements.txt: Install all backend dependencies.python -m backend.database: Set up and initialize the database.uvicorn backend.main:app --reload: Start the development server.
-
Frontend: cd path/to/frontend npm install npm start
-
Backend: cd path/to/backend python -m venv venv venv\Scripts\activate # For Windows
source venv/bin/activate # For Mac/Linux pip install -r requirements.txt python -m backend.database uvicorn backend.main:app --reload
- Frontend URL: http://localhost:3000
- Backend URL: http://127.0.0.1:8000
- Test API endpoints using
/docson the backend URL.