A multi-portal School Management System with Single Sign-On (SSO) capabilities.
This system consists of multiple Next.js applications that work together to provide a comprehensive school management solution:
- School Portal: The entry point and SSO gateway for the system
- Admin Portal: For school administrators
- Teacher Portal: For teachers and education staff
- Accounts Portal: For financial management
- Student Portal: For students to access their information
- File Server: For document management
- All portals use Next.js with App Router (v14)
- Authentication is centralized in the School Portal
- Each portal has role-based access controls
- All portals connect to a shared PostgreSQL database via Prisma
- The system is containerized with Docker
- Node.js (v18 or later)
- PostgreSQL
- Python 3.8+ (for File Server)
- Docker and Docker Compose (for production deployment)
-
Clone the repository:
git clone https://github.com/yourusername/school-management-system.git cd school-management-system
-
Run the development setup script:
chmod +x dev-setup.sh ./dev-setup.sh
This script will:
- Check if PostgreSQL is running
- Create the database if it doesn't exist
- Set up environment variables for all portals
- Install dependencies
- Start all services
-
Seed test users for development:
cd shared-db node ../seed-test-users.js cd ..
-
Access the portals:
- School Portal (SSO): http://localhost:3000
- Admin Portal: http://localhost:3001
- Teacher Portal: http://localhost:3002
- Accounts Portal: http://localhost:3003
- Student Portal: http://localhost:3004
- File Server: http://localhost:8001
-
Use the following test credentials:
- Admin: [email protected] / password
- Teacher: [email protected] / password
- Head Teacher: [email protected] / password
- Deputy Head: [email protected] / password
- Accounts: [email protected] / password
- Student: [email protected] / password
-
To test all components of the system:
chmod +x test-system.sh ./test-system.sh
-
Manual testing workflow:
- Open http://localhost:3000 (School Portal)
- Log in with one of the test credentials
- You should be redirected to the appropriate portal based on your role
- Test navigation and permissions in each portal
-
Build and start all containers:
docker-compose up -d
-
To stop the containers:
docker-compose down
The system supports two different app structures:
- Standard Next.js App Router:
/app
directory - Source directory structure:
/src/app
directory
Middleware files are placed accordingly:
- For standard structure:
/app/middleware.ts
- For source structure:
/src/app/middleware.ts
Edit the .env
file to map roles to subdomains:
ADMIN_PORTAL_URL=http://admin.yourschool.ac.zw
TEACHER_PORTAL_URL=http://teachers.yourschool.ac.zw
ACCOUNTS_PORTAL_URL=http://accounts.yourschool.ac.zw
STUDENT_PORTAL_URL=http://student.yourschool.ac.zw
Roles are configured in the database. The default roles are:
- admin
- teacher
- head_teacher
- deputy_head
- accounts
- student
For production deployment, additional steps are required:
- Set up SSL certificates for HTTPS
- Configure a proper domain and DNS settings
- Update environment variables with production values
- Set
NODE_ENV=production
[License information here]