A comprehensive, AI-powered university management platform designed to streamline administrative operations and improve student outcomes.
- Overview
- Features
- Architecture
- Tech Stack
- Getting Started
- Configuration
- API Documentation
- Testing
- Deployment
- Contributing
- License
UniSense is a modern, microservices-based university management system that combines essential administrative functions with AI-powered analytics. Built with scalability and multi-tenancy in mind, it provides universities with the tools they need to manage students, courses, grades, fees, and moreβall while gaining actionable insights through machine learning.
- Multi-tenant Architecture - Complete data isolation for multiple universities
- AI-Powered Insights - Predictive analytics for student success and risk detection
- Progressive Web App - Works offline with automatic sync when online
- Role-Based Access Control - Granular permissions for Admin, Dean, Lecturer, Student, and Finance roles
- Real-time Notifications - WhatsApp, Email, and SMS integration
- RESTful APIs - Well-documented APIs with Swagger/OpenAPI
- Property-Based Testing - Rigorous testing for correctness guarantees
- Multi-role support (Admin, Dean, Lecturer, Student, Finance)
- JWT-based authentication
- University-scoped access control
- Profile management
- Student registration and enrollment
- Bulk CSV import/export
- Academic records management
- Student profile with photo support
- Course catalog and scheduling
- Course registration workflow
- Credit hour tracking
- Prerequisite management
- Flexible grading scales
- GPA and CGPA calculation
- Semester results tracking
- Grade distribution analytics
- Fee structure configuration
- Invoice generation
- Payment tracking
- Outstanding balance reports
- Export to Excel/PDF
- Role-targeted announcements
- Multi-channel delivery (WhatsApp, Email, SMS)
- Notification preferences
- Read/unread tracking
Identifies students at risk of academic failure based on:
- GPA trends and patterns
- Attendance records
- Fee payment status
- Historical performance data
Predicts end-of-semester GPA using:
- Current academic performance
- Course difficulty metrics
- Historical student data
- Workload analysis
Analyzes teaching loads to:
- Identify overloaded faculty
- Balance course assignments
- Optimize resource allocation
- Prevent burnout
Provides actionable insights on:
- Enrollment trends
- Course performance heatmaps
- Department analytics
- Resource utilization
UniSense follows a microservices architecture with four main services:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js) β
β Progressive Web App (PWA) β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
β HTTPS/REST
β
ββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββ
β Core Backend (NestJS) β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Auth β β Business β β Database β β
β β & RBAC β β Logic β β Layer β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
ββββββββββ¬βββββββββββββββββββββ¬βββββββββββββββββββββ¬ββββββββββ
β β β
β β β
ββββββ΄ββββββ ββββββββ΄βββββββ βββββββ΄βββββββ
β AI β β WhatsApp β β PostgreSQL β
β Service β β Service β β + Redis β
β (Python) β β (Python) β β β
ββββββββββββ βββββββββββββββ ββββββββββββββ
| Service | Technology | Purpose |
|---|---|---|
| Core Backend | NestJS + TypeORM | Authentication, business logic, data persistence |
| Frontend | Next.js + React | User interface, PWA capabilities, offline support |
| AI Service | Python + FastAPI | Machine learning models, predictive analytics |
| WhatsApp Service | Python + FastAPI | Asynchronous message delivery, notification queue |
- Framework: NestJS 10.x
- Language: TypeScript 5.x
- ORM: TypeORM
- Database: PostgreSQL 15+
- Cache: Redis 7+
- Authentication: JWT + Passport
- Validation: class-validator
- Testing: Jest + fast-check (property-based testing)
- Framework: Next.js 14.x
- Language: TypeScript 5.x
- UI Library: React 18.x
- Styling: Tailwind CSS
- PWA: next-pwa
- HTTP Client: Axios
- Charts: Recharts
- Testing: Jest + React Testing Library + fast-check
- Framework: FastAPI
- Language: Python 3.11+
- ML Libraries: scikit-learn, pandas, numpy
- Database: PostgreSQL (read-only)
- Testing: pytest + Hypothesis (property-based testing)
- Framework: FastAPI
- Language: Python 3.11+
- Queue: Redis
- API: WhatsApp Business API
- Testing: pytest + Hypothesis
- Containerization: Docker + Docker Compose
- Reverse Proxy: Nginx (production)
- CI/CD: GitHub Actions
- Monitoring: Prometheus + Grafana (optional)
- Docker 24.0+ and Docker Compose 2.20+
- Node.js 20+ (for local development)
- Python 3.11+ (for local development)
- PostgreSQL 15+ (if not using Docker)
- Redis 7+ (if not using Docker)
-
Clone the repository
git clone https://github.com/Emart29/unisense.git cd unisense -
Set up environment variables
cp .env.example .env cp backend/.env.example backend/.env cp frontend/.env.example frontend/.env cp ai-service/.env.example ai-service/.env cp whatsapp-service/.env.example whatsapp-service/.env
-
Configure your environment
Edit the
.envfiles with your configuration. At minimum, update:- Database credentials
- JWT secret
- Redis URL
- API keys (optional for MVP)
-
Start all services
docker-compose up -d
-
Run database migrations
docker-compose exec backend npm run migration:run -
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- API Documentation: http://localhost:3001/api
- AI Service: http://localhost:8001
- WhatsApp Service: http://localhost:8002
For Windows users without Docker/WSL2:
-
Install dependencies
-
Set up database
.\setup-database.ps1 -
Seed test data
.\seed-data.ps1 -
Start all services
.\start-services.ps1 -
Stop all services
.\stop-services.ps1
After seeding the database, you can login with:
| Password | Role | |
|---|---|---|
| admin@test.edu | password123 | Admin |
| dean@test.edu | password123 | Dean |
| lecturer@test.edu | password123 | Lecturer |
| student@test.edu | password123 | Student |
| finance@test.edu | password123 | Finance |
All test users belong to "Test University" (TEST_UNI).
# Database
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=your_password
DB_NAME=unisense
# JWT
JWT_SECRET=your-secret-key-min-32-chars
# Redis
REDIS_URL=redis://localhost:6379
# AI Service
AI_SERVICE_URL=http://localhost:8001
# Application
NODE_ENV=development
PORT=3001NEXT_PUBLIC_API_URL=http://localhost:3001DATABASE_URL=postgresql://postgres:password@localhost:5432/unisense
MODEL_PATH=./modelsDATABASE_URL=postgresql://postgres:password@localhost:5432/unisense
REDIS_URL=redis://localhost:6379
WHATSAPP_API_URL=https://graph.facebook.com/v18.0
WHATSAPP_API_TOKEN=your_token
WEBHOOK_SECRET=your_secretUniSense implements row-level multi-tenancy:
- All tables include a
university_idcolumn - Middleware automatically scopes queries to the authenticated user's university
- Complete data isolation between universities
Once the backend is running, access the interactive API documentation:
Swagger UI: http://localhost:3001/api
POST /auth/login- User loginGET /auth/profile- Get current user profile
GET /students- List all studentsPOST /students- Create new studentPOST /students/import- Bulk import from CSVGET /students/:id- Get student details
GET /courses- List all coursesPOST /courses- Create new coursePOST /course-registrations- Register student for course
POST /grades- Submit gradeGET /grades/student/:id- Get student gradesGET /semester-results/:id- Get semester results with GPA
GET /invoices- List invoicesPOST /invoices- Create invoiceGET /invoices/export- Export invoices to Excel
GET /ai/at-risk-students- Get at-risk studentsGET /ai/enrollment-trends- Get enrollment trendsGET /ai/department-performance- Get department analytics
cd backend
npm run test # Run all tests
npm run test:watch # Watch mode
npm run test:cov # With coverage
npm run test:e2e # Integration testscd frontend
npm run test # Run all tests
npm run test:watch # Watch modecd ai-service
pytest # Run all tests
pytest -v # Verbose output
pytest --cov # With coveragecd whatsapp-service
pytest # Run all tests
pytest -v # Verbose outputUniSense uses property-based testing to ensure correctness:
Backend (fast-check):
// Feature: unisense-mvp, Property 14: GPA calculation correctness
test('GPA equals weighted average of grade points', () => {
fc.assert(
fc.property(
fc.array(courseGradeGenerator(), { minLength: 1 }),
(grades) => {
const gpa = calculateGPA(grades);
const expected = weightedAverage(grades);
expect(gpa).toBeCloseTo(expected, 2);
}
),
{ numRuns: 100 }
);
});Python Services (Hypothesis):
@given(st.lists(student_generator(), min_size=1))
def test_risk_score_range(students):
"""Risk scores should always be between 0 and 1"""
for student in students:
score = calculate_risk_score(student)
assert 0 <= score <= 1-
Update environment variables for production
cp .env.example .env # Edit with production values -
Build and start services
docker-compose -f docker-compose.prod.yml up -d --build
-
Run migrations
docker-compose -f docker-compose.prod.yml exec backend npm run migration:run -
Set up SSL/TLS with Let's Encrypt or your certificate provider
-
Configure reverse proxy (Nginx recommended)
For detailed deployment instructions, see DEPLOYMENT.md.
UniSense is designed to scale horizontally:
- Backend: Multiple instances behind load balancer
- Database: Read replicas + connection pooling (PgBouncer)
- Redis: Redis Cluster for high availability
- AI Service: Multiple workers for parallel processing
- SETUP.md - Detailed setup instructions
- DEPLOYMENT.md - Production deployment guide
- CONTRIBUTING.md - Contribution guidelines
- API Documentation - Interactive API docs (when running)
We welcome contributions! Please see CONTRIBUTING.md for details on:
- Code of conduct
- Development workflow
- Coding standards
- Testing requirements
- Pull request process
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
npm run test) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with NestJS, Next.js, and FastAPI
- Property-based testing powered by fast-check and Hypothesis
- Icons and UI components from various open-source projects
- Documentation: docs.unisense.com (coming soon)
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- β Core modules (Users, Students, Courses, Grades, Fees)
- β AI-powered analytics
- β Multi-tenancy
- β PWA support
- β Property-based testing
- Online payment integration (Paystack/Flutterwave)
- Student self-service portal
- Timetable automation
- Enhanced AI models
- Mobile apps (iOS/Android)
- Hostel management
- Research & grants tracking
- Multi-campus support
- Ministry reporting APIs
- Advanced analytics dashboard
Emmanuel Nwanguma
- GitHub: @Emart29
- LinkedIn: Emmanuel Nwanguma
Made with β€οΈ for universities across Africa and beyond