A state-of-the-art, full-stack Human Resource Management System designed for modern, high-growth teams
Documentation β’ Report Bug β’ Request Feature
- Overview
- Tech Stack
- Core Features
- Prerequisites
- Quick Start
- Getting Started
- Production Deployment
- Limitations & Assumptions
- Contributing
- License
- Backend:
backend/README.md - Frontend:
frontend/README.md
Workforce Hub combines a premium React-based user interface with a FastAPI backend and intelligent data querying powered by OpenRouter AI. It's built for modern HR teams who need powerful insights without the complexity of traditional enterprise solutions.
- π€ AI-Powered Insights - Natural language queries for workforce analytics
- β‘ Lightning Fast - Built with modern tech stack for optimal performance
- π¨ Beautiful UI - Executive-grade design with smooth animations
- π Production Ready - Deployed on Railway (backend) and Vercel (frontend)
- π Data-Driven - Real-time analytics and actionable insights
Get up and running in 5 minutes:
# Clone the repository
git clone https://github.com/upstackpilot0710/workforce-hub.git
cd workforce-hub
# Backend setup
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\Activate.ps1
pip install -r requirements.txt
cp .env.example .env # Configure your environment variables
uvicorn app.main:app --reload
# Frontend setup (in a new terminal)
cd frontend
npm install
cp .env.example .env # Configure your environment variables
npm run devVisit http://localhost:5173 and you're ready to go! π
Frontend
- βοΈ React 18 + TypeScript - Modern UI framework with type safety
- β‘ Vite - Lightning-fast build tool and dev server
- π¨ Tailwind CSS - Utility-first styling with executive aesthetic
- π Framer Motion - Smooth animations and transitions
Backend
- π FastAPI (Python 3.12+) - High-performance async API framework
- π SQLAlchemy 2.0 - Powerful Python ORM
- π€ LangChain - AI orchestration framework
- π§ OpenRouter - Multi-model AI intelligence layer
Infrastructure
- ποΈ PostgreSQL (via Supabase) - Robust relational database
- π Railway - Backend deployment platform
- β² Vercel - Frontend hosting with edge network
Production-ready conversational UI powered by OpenRouter AI that understands natural language queries about your workforce.
- π¬ Chat-based interface with persistent history
- π Executive summaries and actionable insights
- π Natural language queries over employees, attendance, and metrics
- π Leave trends analysis and headcount signals
- π‘οΈ Network-hardened with timeout protection and error handling
Complete CRUD operations for your workforce with intuitive filtering and search.
- β Add, edit, and delete employee records
- π’ Department-based organization
- π Status management and filtering
- π€ Bulk operations support
- π Advanced search and filtering
Streamlined attendance management with historical data and analytics.
- β Quick daily attendance marking
- βοΈ Edit existing attendance entries
- πΎ Persistent database storage
- π₯ CSV export functionality
- π Analytics dashboard with insights
Beautiful, responsive interface built with modern design principles.
- πͺ Glassy navbar with smooth transitions
- π± Fully responsive layout (mobile, tablet, desktop)
- β¨ Framer Motion animations
- π Clean, executive aesthetic
- β‘ Fast and intuitive navigation
Before you begin, ensure you have the following installed:
- Python 3.12 or higher - Download
- Node.js 18 or higher - Download
- PostgreSQL - Local installation or Supabase account
- Git - Download
π‘ Quick Check: Run
python --version,node --version, andgit --versionto verify installations
git clone https://github.com/upstackpilot0710/workforce-hub.git
cd workforce-hubcd backendpython -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_FRONTEND
β οΈ Important: Never commit.envfiles to version control
uvicorn app.main:app --reloadβ Backend is now running at:
- API:
http://localhost:8000 - Swagger Docs:
http://localhost:8000/docs
cd ../frontendnpm installCreate a .env file in the frontend directory:
VITE_API_URL=http://localhost:8000/api/v1
VITE_API_KEY=CHANGE_ME_MATCHES_BACKENDπ Note: The
VITE_API_KEYmust match the backendAPI_KEY
npm run devβ
Frontend is now running at: http://localhost:5173
1. Push to GitHub
git push -u origin main2. Create Railway Project
- Go to Railway and create a new project
- Connect your GitHub repository
3. Configure Service
- Root Directory:
backend - Start Command:
uvicorn app.main:app --host 0.0.0.0 --port $PORT
4. Set Environment Variables
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>5. Deploy & Copy URL
1. Create Vercel Project
- Go to Vercel and import your repository
2. Configure Project
- Framework Preset: Vite
- Root Directory:
frontend
3. Set Environment Variables
VITE_API_URL=https://<your-railway-backend>/api/v1
VITE_API_KEY=<must-match-backend-key>π Important: The
VITE_API_KEYmust match your backendAPI_KEY
4. Deploy
| Variable | Description | Required | Example |
|---|---|---|---|
DATABASE_URL |
PostgreSQL connection string | β Yes | postgresql://user:pass@host:5432/db |
OPENROUTER_API_KEY |
OpenRouter API key for AI | β Yes | sk-or-v1-... |
SECRET_KEY |
Secret key for security | β Yes | your-secret-key-here |
API_KEY |
API key for frontend auth | β Yes | your-api-key |
OPENROUTER_MODEL |
AI model to use | β No | arcee-ai/trinity-large-preview:free |
DEBUG |
Enable debug mode | β No | true |
DEMO_ISOLATION_ENABLED |
Enable device isolation | β No | true |
DEMO_ISOLATION_MODE |
Isolation mode | β No | device or ip |
| Variable | Description | Required | Example |
|---|---|---|---|
VITE_API_URL |
Backend API base URL | β Yes | http://localhost:8000/api/v1 |
VITE_API_KEY |
API key (matches backend) | β Yes | your-api-key |
Issue: Backend won't start
# Solution: Check if port 8000 is already in use
lsof -ti:8000 | xargs kill -9 # macOS/Linux
netstat -ano | findstr :8000 # WindowsIssue: Frontend can't connect to backend
- Verify
VITE_API_URLin frontend.envmatches your backend URL - Check if backend is running:
curl http://localhost:8000/health - Ensure
VITE_API_KEYmatches backendAPI_KEY
Issue: Database connection error
- Verify
DATABASE_URLformat is correct - Check Supabase instance is running
- Ensure IP is whitelisted in Supabase dashboard
Issue: AI queries not working
- Verify
OPENROUTER_API_KEYis valid - Check you have credits in OpenRouter account
- Ensure
OPENROUTER_BASE_URLis set correctly
Issue: CORS errors
- Add your frontend URL to
ALLOWED_ORIGINSin backend.env - Clear browser cache and cookies
- Check browser console for specific CORS errors
Authentication & Access
- β No user authentication system - uses device isolation instead
- β Data scoped per device/browser session via
X-Device-Idheader - β Not suitable for production multi-user environments
Architecture
- β Single-tenant design - one organization only
- β No multi-company data separation
- β Basic role management - all users have full access
- β Limited audit trail and compliance logging
This project is built with the following assumptions:
- π― Demo environment with trusted users
- π₯ Small to medium team size (< 500 employees)
- π Single geographic region (no timezone complexity)
- π Basic HR workflows without complex compliance requirements
For production deployment, you'll need to implement:
- Authentication System - JWT/OAuth with secure session management
- Multi-tenancy - Company-based data isolation with RLS
- RBAC - Role-based permissions (Admin, Manager, Employee)
- Audit Logging - Comprehensive compliance and change tracking
- Advanced Features - Timezone support, complex workflows, reporting
Is this production-ready?
The application is production-ready in terms of architecture and code quality. However, it lacks authentication and is designed for demo/MVP use. For production, you'll need to implement proper authentication, RBAC, and multi-tenancy.
Can I use this for my company?
Yes! Workforce Hub is MIT licensed. You can use, modify, and deploy it for commercial purposes. Just remember to add authentication for production use.
How do I add new features?
The codebase is well-structured and easy to extend. Check out the Contributing section for guidelines. The backend uses FastAPI and the frontend uses React - both have extensive documentation.
What AI models are supported?
Workforce Hub uses OpenRouter, which supports multiple AI models. The default is
arcee-ai/trinity-large-preview:free, but you can configure any OpenRouter-supported model via the OPENROUTER_MODEL environment variable.
How much does it cost to run?
- Frontend (Vercel): Free tier available - Backend (Railway): ~$5-20/month depending on usage - Database (Supabase): Free tier available (500MB) - AI (OpenRouter): Pay-per-use, ~$0.10-0.50 per day for normal usage
Can I self-host everything?
Absolutely! You can host the backend on any VPS, use a self-hosted PostgreSQL instance, and deploy the frontend on any static hosting service. The only external dependency is OpenRouter for AI features.
Does it support multiple companies/tenants?
Not yet. The current version is single-tenant. Multi-tenancy is in progress.
cd frontend
npm run buildpython -m compileall backend/appWe love contributions! Whether it's bug fixes, feature additions, or documentation improvements - all PRs are welcome.
- Fork the repository
- Create your feature branch
git checkout -b feature/AmazingFeature
- Commit your changes
git commit -m 'Add some AmazingFeature' - Push to the branch
git push origin feature/AmazingFeature
- Open a Pull Request
- Follow existing code style and conventions
- Write clear commit messages
- Add tests for new features
- Update documentation as needed
This project is licensed under the MIT License. See the LICENSE file for details.
- FastAPI - Amazing Python web framework
- React - The library for web and native user interfaces
- OpenRouter - AI model routing and orchestration
- Supabase - Open source Firebase alternative
- Railway & Vercel - Deployment platforms
- Tailwind CSS - Utility-first CSS framework
Having trouble? We're here to help!
- π Bug Reports: Open an issue
- π‘ Feature Requests: Start a discussion
- π§ Email: akashkumar.cs27@gmail.com
- π¬ Discussions: GitHub Discussions
If you find this project useful, please consider:
Built with β€οΈ by Upstack Pilot
Making HR management intelligent and effortless for modern teams.
If you find Workforce Hub useful, please consider supporting it:
β Star this repo β’ π Fork and contribute β’ π’ Share with others
