This project includes both a React frontend and a Flask backend. Follow these steps to set up and run the application on macOS.
-
Homebrew: A package manager for macOS. Install it using:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Node.js and npm: Install using Homebrew:
brew install node
-
Python and pip: Install using Homebrew:
brew install python
-
Flask: Install Flask using pip:
pip install flask
-
Clone the Repository:
Open Terminal and clone the repository to your local machine:git clone <repository-url> cd <repository-directory>
-
Install Backend Dependencies:
Use pip to install the Python dependencies:pip install -r requirements.txt
-
Install Frontend Dependencies:
Use npm to install the Node.js dependencies:npm install
-
Set Up the Database:
Initialize and migrate the database using Flask-Migrate:flask db init flask db migrate flask db upgrade
-
Set Up Environment Variables:
Create a.env
file in the root of your project directory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key_here
-
Create the Database File:
Create thestorage.db
file in theinstance
directory:touch instance/storage.db
- Start the React App:
Run the following command to start the React development server:Open http://localhost:3000 to view it in your browser.npm start
- Start the Flask Server:
Run the following command to start the Flask backend server:python app.py
- React: React documentation
- Flask: Flask documentation
These instructions should help you set up and run the application on macOS, including setting up the necessary environment variables for the OpenAI API and creating the database file.