This project is a backend service built with FastAPI, designed to generate worker schedules, storage log events in MongoDB, and be deployed thru Docker
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activateoptional but recommended (uv pip)
pip install uvand then just write uv before every pip
pip install -r requirements.txt
Make sure you have a .env file at the root:
MONGO_URI=mongodb://localhost:27017
DB_NAME=scheduler_db
LOG_COLLECTION=logsuvicorn app.main:app --reloadVisit http://localhost:8000/docs for the interactive doc that FastAPI offer for free
docker-compose up --buildThis will:
- Build the FastAPI app image
- Start MongoDB with authentication
- Connect them via an internal Docker network
Visit http://localhost:8000/docs
Use this connection string:
mongodb://rarr:25886688@localhost:27017/?authSource=admin
project-root/
├── app/
│ ├── main.py
│ ├── routes/
│ ├── services/
│ └── db/
├── .env
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── README.md
docker-compose downdocker-compose down -v- Make sure Docker Desktop is running.
.envfile must be in the root and readable.- MongoDB data is stored in a volume named
mongo_data.
Let me know if you need help customizing this for production or cloud deployment!