A full-stack web application for managing employee work schedules, built with modern web technologies.
- React 18
- Vite
- TailwindCSS
- Axios for API communication
- Node.js
- Express
- MongoDB with Mongoose
- CORS enabled for frontend communication
- Create and manage weekly/monthly work schedules
- Randomize schedule generation
- Set employee preferences (e.g., preferred days off, specific working hours)
- Track working hours statistics
- View employee-specific statistics (e.g., number of specific weekdays worked)
- Automated schedule generation with fair weekend shift distribution
- Real-time updates through REST API
- Node.js (Latest LTS version recommended)
- MongoDB (Local installation or MongoDB Atlas account)
- Git
- Clone the repository:
git clone https://github.com/MorphZG/work_schedule_app.git
cd work_schedule_app
- Install backend dependencies:
cd backend
npm install
- Install frontend dependencies:
cd ../frontend/vite-project
npm install
- Set up environment variables:
In both backend and frontend directories create
.env
file with environment variables. There is.env.example
with example data.
- Backend variables
PORT=5000
MONGO_URI="mongodb+srv://<username>:<password>@<cluster_url>/db_name"
LOCALHOST="mongodb://127.0.0.1:<port_number>/<db_name>"
- Frontend variables
API_URL=<empty_string>
- Start the backend server:
cd backend
npm run dev
- Start the frontend development server:
cd frontend/vite-project
npm run dev
The application will be available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3000
GET /schedule/:period
- Get schedule for specific periodPOST /schedule
- Create new schedulePUT /schedule/:id
- Update existing schedule
PUT /preferences/:employeeId
- Update employee preferencesGET /preferences/:employeeId
- Get employee preferences
GET /statistics/:employeeId
- Get employee work statisticsGET /statistics/team
- Get team-wide statistics
The project uses:
- ESLint for code linting
- Prettier for code formatting
- Vitest for testing
Run quality checks:
npm run lint # Check code style
npm run format # Format code
npm run test # Run tests
For detailed information about the project structure, see dir_structure.md
- Controllers: controllers.md
- Models: models.md
- Routes: routes.md
See CONTRIBUTE.md for details on our code of conduct and the process for submitting pull requests.