This is the high-performance FastAPI backend for the HRMS Lite system.
- FastAPI: Modern, fast web framework for building APIs.
- Alchemy/PostgreSQL: Robust data persistence layer.
- LangChain: Intelligence orchestration for the natural language assistant.
- OpenRouter: Access to state-of-the-art LLMs.
- Virtual Env:
python -m venv venv - Dependencies:
pip install -r requirements.txt - Environment: Create
.envbased on.env.example - Run:
uvicorn app.main:app --reload
This project includes optional demo seed data to help you explore the app quickly.
- The seeded employees/attendance/activities are fictional test data.
- You can safely edit/delete them.
- The app works normally with real data as well; seeding is only for convenience during testing.
To manually insert dummy employees:
python .\seed_dummy_data.py --count 10
Configured for Render via render.yaml.
- Python 3.12 or higher
- PostgreSQL (local or Supabase)
python -m venv venvWindows (PowerShell)
venv\Scripts\Activate.ps1macOS/Linux
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the backend directory:
DATABASE_URL=postgresql://USER:PASSWORD@HOST:PORT/DBNAME
OPENROUTER_API_KEY=YOUR_OPENROUTER_KEY
SECRET_KEY=CHANGE_ME_TO_A_LONG_RANDOM_STRING
OPENROUTER_MODEL=arcee-ai/trinity-large-preview:free
DEBUG=true
API_KEY=CHANGE_ME_MATCHES_FRONTENDuvicorn app.main:app --reload✅ Backend is now running at:
- API:
http://localhost:8000 - Swagger Docs:
http://localhost:8000/docs
- Root Directory:
backend - Start Command:
uvicorn app.main:app --host 0.0.0.0 --port $PORT
Environment variables example:
DATABASE_URL=<your-supabase-connection-string>
OPENROUTER_API_KEY=<your-openrouter-key>
OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
ALLOWED_ORIGINS=https://<your-vercel-app>.vercel.app
API_KEY=<must-match-frontend-key>