It's important that you review the following steps to run the front end.
In this step you need to open the terminal or consola on your computer. After, you must enter the path of the folder where the front end project is located. The following is an example image:
Once the previous step is completed, it's necessary to install the project dependencies. Therefore, run the following command:
npm install
This installs all dependencies that the project needs.
In this step you must execute some scripts depending on the case. But, first see this image:
The most important scripts are "dev", "build", "test:watch" and "test". Use each one according to the case.
With the following script you can run the project in developer mode:
npm run dev
With the following script you can run the project to obtain the production folder. This will create the folder on the server with node + express:
npm run build
With the following script you can run the project in test mode. However, in this case every time something is changed in the test, the changes applied automatically:
npm run test:watch
With the following script you can run the project in test normal mode:
npm run test
Running server to consume SPA of the project created in React.
In this step you need to open the terminal or consola on your computer. After, you must enter the path of the folder where the front end project is located. The following is an example image:
Once the previous step is completed, it's necessary to install the project dependencies. Therefore, run the following command:
npm install
This installs all dependencies that the project needs.
You need to copy the .env.template file and rename it to .env:
Then define a value for the port. For example, port 5173:
In this step you must execute some scripts depending on the case.
The most important scripts are "dev" and "start". Use each one according to the case.
With the following script you can run the project in developer mode:
npm run dev
With the following script you can build the production build and run the server:
npm run start
To run de backend part of the project, you can follow the next steps:
After running the frontend part, you can open a new terminal to run the backend. After, you must enter the path of the folder where the backend project is located.
cd back-end-app
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt
To run this project, you will need to add the following environment variables to your .env file in the back-end-app directory. Do not include sensitive information directly in your project files or documentation.
DB_NAME='your_postgres_db_name'
DB_USERNAME='your_postgres_user'
DB_PASSWORD='your_postgres_password'
DB_HOST='your_postgres_host'
DB_PORT='your_postgres_port'
OPENAI_API_KEY='your_openai_api_key'
MODEL_PATH='your_path_to_your_ml_model'
Start the server:
uvicorn app.main:app --reload
Access http://localhost:8000/docs# in your browser to interact with the backend endpoints.