Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Employee Management System

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.

Features

  • 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

Tech Stack

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

Project Structure

Employee Management System/
+-- ems-back/        # Express, Apollo Server, GraphQL, MongoDB backend
+-- ems-front/       # React frontend
+-- README.md
+-- LICENSE
+-- .gitignore

Prerequisites

  • Node.js 20 or newer
  • npm
  • MongoDB Atlas or a local MongoDB connection string

Environment Variables

Create a backend environment file from the example:

cd ems-back
Copy-Item .env.example .env

Update 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-value

The 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.

Installation

Install backend dependencies:

cd ems-back
npm install

Install frontend dependencies:

cd ../ems-front
npm install

Run Locally

Start the backend:

cd ems-back
npm start

The 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 -- --apply

Start the frontend in a second terminal:

cd ems-front
npm start

The React app runs at:

http://localhost:3000

Build

Create a production frontend build:

cd ems-front
npm run build

Git Notes

This repository is configured to ignore local-only files and generated folders:

  • .env
  • node_modules/
  • build/

License

This project is licensed under the MIT License.

About

Full-stack Employee Management System built with React, GraphQL, Apollo Server, Express, MongoDB, and Mongoose.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages