A full-stack Employee Management System built with React, Apollo Client, Express, Apollo Server, GraphQL, and MongoDB. The app supports employee records, employee community groups, recreation activities, activity registration, and a simple tic-tac-toe recreation page.
- View employee records
- Add new employees
- Manage employee community groups
- Register for recreation activities
- Browse recreation events and gallery
- Play a built-in tic-tac-toe game
- GraphQL API backed by MongoDB
Frontend:
- React 18
- Vite
- React Router
- Apollo Client
- Bootstrap / React Bootstrap
- React Hook Form
- React Calendar
Backend:
- Node.js
- Express
- Apollo Server 5
- GraphQL
- MongoDB
- Mongoose
Employee Management System/
+-- ems-back/ # Express, Apollo Server, GraphQL, MongoDB backend
+-- ems-front/ # React frontend
+-- README.md
+-- LICENSE
+-- .gitignore
- Node.js 20 or newer
- npm
- MongoDB Atlas or a local MongoDB connection string
Create a backend environment file from the example:
cd ems-back
Copy-Item .env.example .envUpdate ems-back/.env:
MONGO_URI=your_mongodb_connection_string
PORT=4000
ADMIN_USERNAME=admin
ADMIN_PASSWORD=change-this-bootstrap-password
AUTH_SECRET=change-this-to-a-long-random-secret-valueThe admin credentials create the first administrator only when the database has
no admin account. AUTH_SECRET must contain at least 32 characters. The real
.env file is ignored by Git and should not be committed.
Install backend dependencies:
cd ems-back
npm installInstall frontend dependencies:
cd ../ems-front
npm installStart the backend:
cd ems-back
npm startThe GraphQL API runs at:
http://localhost:4000/graphql
For databases created before employee references were introduced, preview and apply the one-time community/recreation migration:
cd ems-back
npm run migrate:references
npm run migrate:references -- --applyStart the frontend in a second terminal:
cd ems-front
npm startThe React app runs at:
http://localhost:3000
Create a production frontend build:
cd ems-front
npm run buildThis repository is configured to ignore local-only files and generated folders:
.envnode_modules/build/
This project is licensed under the MIT License.