Skip to content
This repository was archived by the owner on Dec 8, 2023. It is now read-only.

Maxhem2/foodie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foodie

Food managment App using FastAPI and MongoDB on the backend and ReactJS on the frontend.


How to run Locally?

Backend

Setting up .env file

To setup .env file on the backend, create a file named .env in /backend/app. Add the following in the .env file.

JWT_SECRET_KEY=<RAMDOM_STRING>
JWT_REFRESH_SECRET_KEY=<RANDOM_SECTURE_LONG_STRING>
MONGO_CONNECTION_STRING=<MONGO_DB_CONNECTION_STRING>
# mongodb://localhost:27017/ <-- for local running instances

Installing dependencies

Assuming you are in the projects base directory

cd backend
pip install -r requirements.txt

Running the backend

Assuming you are in the projects backend directory.

uvicorn app.app:app --reload

Frontend

Install dependecies

Assuming you are in the projects base directory.

cd frontend
npm install

Running frontend

npm start

How to run selfhosted?

(Publicly accessible)

Running the backend

Assuming you are in the projects backend directory.

uvicorn app.app:app --reload --host <YOUR_IP_ADDRESS>

In the projects backend directory under app/core/config.py make the following change:

class Settings(BaseSettings):
...
    BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = [
        "http://<YOUR_IP_ADDRESS>:3000"
    ]
...

Running frontend

set HOST=<YOUR_IP_ADDRESS>
npm start

In the projects frontend directory under scr/services/axios.js make the following change:

const baseURL = "http://<YOUR_IP_ADDRESS>:8000/api/v1/";

Credits

About

Unser Repo zum Lernfeld 10 / 11

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •