A full-stack web application for managing campuses, students, and user associations. Built with React, Node.js, Express, and PostgreSQL, featuring role-based access control and multi-tenant architecture.
- Campus Management: Create, view, edit, and delete campuses with images and descriptions
- Student Management: Manage student records with GPA tracking and campus enrollment
- User Authentication: Secure JWT-based authentication system
- Role-Based Access Control:
- Association Administrators (full system access)
- Group Administrators (manage specific user groups)
- Regular Users (access based on assigned groups)
- Multi-Tenant Architecture: Support for multiple associations with isolated data
- User Groups: Organize users and control campus access by groups
- Responsive UI: Modern Material-UI interface with intuitive navigation
- Docker Support: Easy deployment with Docker Compose
- React 18.2 - UI library
- Redux - State management
- Material-UI (MUI) - Component library
- React Router - Navigation
- Axios - HTTP client
- Node.js - Runtime environment
- Express.js - Web framework
- PostgreSQL - Database
- Sequelize - ORM
- JWT - Authentication
- bcryptjs - Password hashing
- Docker - Containerization
- Nginx - Web server (production frontend)
- PostgreSQL - Database server
- Docker Desktop (Windows/Mac) or Docker Engine + Docker Compose (Linux)
- Docker Compose v2.0+ (included with Docker Desktop)
- Node.js 14.x - 20.x (recommended: 18.x)
- PostgreSQL 12+
- npm or yarn
-
Clone the repository
git clone <repository-url> cd Campus-Management-System
-
Start Docker Desktop (if on Windows/Mac)
-
Run the startup script
Windows:
start-windows.bat
Linux/Mac:
./start.sh
Or manually:
docker-compose up --build
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5001/api
-
Install PostgreSQL
- Create a database user (default:
postgreswith passwordpostgres) - Or update
backend/database/utils/configDB.jswith your credentials
- Create a database user (default:
-
Install Backend Dependencies
cd backend npm install -
Install Frontend Dependencies
cd ../frontend npm install -
Start Backend Server
cd backend npm startServer runs on http://localhost:5001
-
Start Frontend Server (in a new terminal)
cd frontend npm startApplication opens at http://localhost:3000
The application comes pre-seeded with the following data for testing:
- CUNY System
- Description: "City University of New York system"
-
Hunter College
- Address: 695 Park Ave, New York, NY 10065
- Description: "This is a school in New York, New York."
-
Queens College
- Address: 65-30 Kissena Blvd, Queens, NY 11367
- Description: "This is a school in Queens, New York."
-
Brooklyn College
- Address: 2900 Bedford Ave, Brooklyn, NY 11210
- Description: "This is a school in Brooklyn, New York."
-
Administrators
- Description: "Full system access"
- Access: All campuses (Hunter, Queens, Brooklyn)
-
NYC Campuses
- Description: "Access to NYC area campuses"
- Access: Hunter College, Queens College, Brooklyn College
-
Queens Campus
- Description: "Access to Queens College only"
- Access: Queens College only
-
Admin User
- Username:
admin - Email:
admin@campus.edu - Password:
admin123 - Role: Association Administrator
- Group: Administrators
- Access: Full system access
- Username:
-
Regular User
- Username:
user1 - Email:
user1@campus.edu - Password:
user123 - Role: Regular User
- Group: NYC Campuses
- Access: Hunter, Queens, and Brooklyn Colleges
- Username:
-
Queens User
- Username:
queens_user - Email:
queens@campus.edu - Password:
queens123 - Role: Group Administrator
- Group: Queens Campus
- Access: Queens College only
- Username:
-
Joe Smith
- Email:
joe.smith@myhunter.cuny.edu - GPA: 3.5
- Campus: Hunter College
- Email:
-
Mary Johnson
- Email:
mary.johnson@Qmail.cuny.edu - GPA: 3.8
- Campus: Queens College
- Email:
Campus-Management-System/
├── backend/
│ ├── database/
│ │ ├── models/ # Sequelize models (Campus, Student, User, etc.)
│ │ ├── utils/ # Database utilities (createDB, seedDB, configDB)
│ │ └── db.js # Database connection
│ ├── middleware/
│ │ └── auth.js # JWT authentication middleware
│ ├── routes/ # API routes
│ │ ├── auth.js # Authentication routes
│ │ ├── campuses.js # Campus CRUD operations
│ │ ├── students.js # Student CRUD operations
│ │ ├── admin.js # Admin management routes
│ │ └── associations.js # Association routes
│ ├── utils/
│ │ └── email.js # Email utilities
│ ├── app.js # Express app setup
│ ├── Dockerfile # Backend Docker configuration
│ └── package.json
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── containers/ # Container components (logic)
│ │ │ └── views/ # View components (presentation)
│ │ ├── store/ # Redux store
│ │ │ ├── actions/ # Action creators and types
│ │ │ ├── reducers/ # Redux reducers
│ │ │ └── thunks.js # Async action creators
│ │ ├── App.js # Main app component
│ │ └── index.js # Entry point
│ ├── public/ # Static files
│ ├── Dockerfile # Frontend Docker configuration
│ ├── nginx.conf # Nginx configuration
│ └── package.json
├── docker-compose.yml # Docker Compose configuration
├── start.sh # Linux/Mac startup script
├── start-windows.bat # Windows startup script
└── README.md # This file
POST /api/auth/login- User loginPOST /api/auth/register- User registrationPOST /api/auth/register-association- Register new associationGET /api/auth/me- Get current user infoPOST /api/auth/assign-user-to-group- Assign user to group (admin)POST /api/auth/assign-association- Assign user to association (admin)
GET /api/campuses- Get all campuses (filtered by user's group)GET /api/campuses/:id- Get campus by IDPOST /api/campuses- Create new campus (admin)PUT /api/campuses/:id- Update campus (admin)DELETE /api/campuses/:id- Delete campus (admin)
GET /api/students- Get all studentsGET /api/students/:id- Get student by IDPOST /api/students- Create new studentPUT /api/students/:id- Update studentDELETE /api/students/:id- Delete student
GET /api/admin/users- Get all users (admin only)GET /api/admin/user-groups- Get all user groups (admin only)POST /api/admin/user-groups- Create user group (admin only)
GET /api/associations- Get all associationsGET /api/associations/:id- Get association by ID
Note: Most endpoints require JWT authentication. Include the token in the Authorization header:
Authorization: Bearer <your-token>
The application uses JWT (JSON Web Tokens) for authentication. After logging in, the token is stored in localStorage and automatically included in API requests.
Use any of the default seeded users:
- Admin:
admin/admin123 - Regular User:
user1/user123 - Queens User:
queens_user/queens123
docker-compose up --builddocker-compose up -d# All services
docker-compose logs -f
# Specific service
docker-compose logs -f backend
docker-compose logs -f frontend
docker-compose logs -f dbdocker-compose downdocker-compose down -vdocker-compose exec db psql -U postgres -d starter-serverCreate a .env file in the root directory (optional):
# Database Configuration
DB_NAME=starter-server
DB_USER=postgres
DB_PASSWORD=postgres
DB_HOST=localhost
DB_PORT=5432
# Backend Configuration
BACKEND_PORT=5001
NODE_ENV=production
# Frontend Configuration
FRONTEND_PORT=3000For Docker: Set DB_HOST=db (the service name) instead of localhost.
Update backend/database/utils/configDB.js for manual installation:
const dbName = process.env.DB_NAME || 'starter-server';
const dbUser = process.env.DB_USER || 'postgres';
const dbPwd = process.env.DB_PASSWORD || 'postgres';
const dbHost = process.env.DB_HOST || 'localhost';
const dbPort = process.env.DB_PORT || 5432;- Login with one of the default users
- View Campuses - Navigate to "All Campuses" to see available campuses
- View Students - Navigate to "All Students" to see enrolled students
- Create Campus - As admin, create a new campus
- Create Student - Add a new student and assign to a campus
- Edit/Delete - Modify or remove campuses and students
Docker Desktop not running:
- Start Docker Desktop and wait for it to fully initialize
- The startup script will detect if Docker is not running
Port already in use:
- Change ports in
.envordocker-compose.yml - Or stop the service using the port
Database connection errors:
- Ensure PostgreSQL is running (for manual installation)
- Check database credentials in
configDB.js - For Docker, ensure the
dbservice is healthy:docker-compose ps
Backend won't start:
- Ensure PostgreSQL is installed and running
- Check database credentials in
backend/database/utils/configDB.js - Verify port 5001 is not in use
Frontend won't start:
- Ensure backend is running on port 5001
- Check that port 3000 is available
- Verify
frontend/package.jsonproxy setting points to correct backend URL
Database sync errors:
- Ensure PostgreSQL user has permission to create databases
- Check database connection settings
Backend:
cd backend
npm run dev # Uses nodemon for hot-reloadFrontend:
cd frontend
npm start # React dev server with hot-reloadTo reset the database and re-seed:
# Docker
docker-compose down -v
docker-compose up --build
# Manual
# The database is automatically synced and seeded on backend startup
# Set `force: true` in backend/app.js (already set by default)MIT License
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- DOCKER.md - Detailed Docker setup and deployment guide
- TESTING_GUIDE.md - Comprehensive testing instructions
For issues and questions:
- Check the Troubleshooting section
- Review the logs:
docker-compose logsor checkbackend.log/frontend.log - Open an issue on GitHub