Skip to content

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

NoQueue - Enterprise University Fee Payment System

NoQueue is an enterprise-ready, modular university fee payment system built with modern technologies. It provides a comprehensive solution for managing student fees, processing payments through multiple PSPs, blockchain logging, loan management, and maintaining financial records with real-time updates and robust security.

License: MIT Django React Docker

✨ Features

πŸŽ“ Core Features

  • Multi-University Support: Complete university and student lifecycle management
  • Flexible Fee Management: Academic year, semester, and program-based fee structures
  • Multi-PSP Payment Processing: ClickPesa integration with modular adapter pattern
  • Real-time Dashboard: WebSocket-powered live updates and notifications
  • Comprehensive Admin Interface: Analytics, reporting, and system management
  • Automated Receipt Generation: PDF receipts with QR codes and verification
  • Complete Audit Trail: System-wide activity logging and compliance
  • Loan Management: Student loan requests, approvals, and tracking
  • Blockchain Integration: Payment transparency and immutable logging

πŸ”§ Technical Features

  • Microservices Architecture: Modular, scalable, and maintainable design
  • Async Task Processing: Celery with Redis for background operations
  • Real-time Communication: WebSocket support for live dashboard updates
  • Enterprise Security: Token auth, CORS, rate limiting, input validation
  • Full Test Coverage: Unit, integration, and end-to-end testing
  • Container-Ready: Docker Compose for development and production
  • API-First Design: RESTful APIs with comprehensive documentation
  • Multi-tenant Ready: University-based data isolation

πŸ— Architecture

πŸ”§ Backend Stack

  • Django 4.2.7: Web framework with Django REST Framework 3.14.0
  • PostgreSQL 15: Primary database with UUID primary keys and advanced features
  • Redis 7: Caching, session storage, and message broker for Celery
  • Celery 5.3.4: Distributed task queue for async processing
  • Django Channels: WebSocket support for real-time features
  • Web3.py: Ethereum blockchain integration
  • Cryptography: Secure payment processing and data encryption

βš›οΈ Frontend Stack

  • React 18.2.0: Modern UI library with hooks and concurrent features
  • Redux Toolkit: State management with RTK Query for API calls
  • Tailwind CSS 3.3.6: Utility-first CSS framework with custom components
  • React Router 6.8.1: Client-side routing with nested routes
  • Axios 1.6.2: HTTP client with interceptors and request/response handling
  • Socket.IO Client: Real-time WebSocket communication
  • Heroicons: Beautiful SVG icons

πŸš€ Infrastructure & DevOps

  • Docker & Docker Compose: Full containerization for all services
  • Nginx: Reverse proxy, load balancing, and static file serving
  • PostgreSQL: Persistent data storage with automated backups
  • Redis: In-memory data structure store for caching and queuing

πŸ”Œ Integration Adapters

  • Payment Service Providers: ClickPesa (with extensible adapter pattern)
  • Student Information Systems: Mock SIS adapter (extensible)
  • Blockchain Networks: Ethereum integration for payment logging
  • Loan Providers: Mock loan adapter (extensible for real providers)

πŸ“‹ Prerequisites

  • Docker 20.10+
  • Docker Compose 2.0+
  • Git

πŸš€ Quick Start

1. Clone the Repository

git clone <repository-url>
cd NoQueue

2. Environment Setup

# Copy environment template
cp .env.example .env

# Edit environment variables (see Configuration section)
nano .env

3. Start the Application

# Build and start all services
sudo docker compose up -d

# Verify all services are running
sudo docker compose ps

4. Database is Auto-Initialized

The system automatically:

  • Runs all database migrations
  • Creates default admin user (admin / admin123)
  • Sets up required database tables and relationships
  • Configures proper CORS and security settings

5. Access the Application

6. Default Credentials

  • Admin: admin / admin123
  • Staff: staff1 / staff123
  • Student: student1 / student123

βš™οΈ Configuration

Required Environment Variables

Create a .env file based on .env.example:

# Django Settings
DEBUG=1
SECRET_KEY=your-secret-key-change-in-production
ALLOWED_HOSTS=localhost,127.0.0.1,backend,0.0.0.0,0.0.0.0:8001

# Database (PostgreSQL)
DATABASE_URL=postgresql://noqueue_user:noqueue_password@db:5432/noqueue

# Redis & Celery
REDIS_URL=redis://redis:6379/0
CELERY_BROKER_URL=redis://redis:6379/0
CELERY_RESULT_BACKEND=redis://redis:6379/0

# ClickPesa Integration
CLICKPESA_CLIENT_ID=${CLICKPESA_CLIENT_ID}
CLICKPESA_API_KEY=${CLICKPESA_API_KEY}
CLICKPESA_BASE_URL=https://api.clickpesa.com

# Frontend URLs
REACT_APP_API_URL=http://localhost:8001/api
REACT_APP_WS_URL=ws://localhost:8001/ws

ClickPesa Setup

  1. Register at ClickPesa
  2. Obtain your Client ID and API Key
  3. Configure webhook URL: http://your-domain/api/payments/webhook/clickpesa/
  4. Update environment variables

πŸƒβ€β™‚οΈ Development

Backend Development

# Enter backend container
sudo docker compose exec backend bash

# Run migrations
sudo docker compose exec backend python manage.py migrate

# Create migrations
sudo docker compose exec backend python manage.py makemigrations

# Run tests
sudo docker compose exec backend python manage.py test
# Or with pytest
sudo docker compose exec backend pytest

# Django shell
sudo docker compose exec backend python manage.py shell

# Collect static files
sudo docker compose exec backend python manage.py collectstatic

# View logs
sudo docker compose logs backend --tail=50
sudo docker compose logs celery_worker --tail=50

Frontend Development

# Enter frontend container
sudo docker compose exec frontend bash

# Install dependencies
npm install

# Run development server (inside container)
npm start

# Run tests
npm test

# Build for production
npm run build

# View frontend logs
sudo docker compose logs frontend --tail=50

Running Tests

# Backend tests
sudo docker compose exec backend pytest
sudo docker compose exec backend python manage.py test

# Frontend tests
sudo docker compose exec frontend npm test

# Coverage reports
sudo docker compose exec backend pytest --cov=. --cov-report=html

# Test specific modules
sudo docker compose exec backend python manage.py test core
sudo docker compose exec backend python manage.py test payments
sudo docker compose exec backend python manage.py test students

πŸ“š API Documentation

Authentication

All API endpoints require authentication using Token-based authentication:

# Login to get token
curl -X POST http://localhost:8000/api/auth/login/ \
  -H "Content-Type: application/json" \
  -d '{"username": "your_username", "password": "your_password"}'

# Use token in subsequent requests
curl -X GET http://localhost:8000/api/students/students/ \
  -H "Authorization: Token your_token_here"

Key Endpoints

Authentication

  • POST /api/auth/login/ - User login
  • POST /api/auth/logout/ - User logout
  • GET /api/auth/user/ - Get current user

Students

  • GET /api/students/students/ - List students
  • GET /api/students/students/{id}/ - Get student details
  • GET /api/students/students/{id}/fees/ - Get student fees
  • POST /api/students/students/ - Create student

Payments

  • GET /api/payments/payments/ - List payments
  • POST /api/payments/payments/initiate/ - Initiate payment
  • GET /api/payments/payments/{id}/status/ - Check payment status
  • POST /api/payments/payments/{id}/verify/ - Verify payment

Dashboards

  • GET /api/dashboards/student/overview/ - Student dashboard data
  • GET /api/dashboards/admin/overview/ - Admin dashboard data
  • GET /api/dashboards/admin/recent-payments/ - Recent payments

πŸ”§ Deployment

Production Deployment

  1. Prepare Environment
# Set production environment variables
export DEBUG=False
export ALLOWED_HOSTS=your-domain.com
export DATABASE_URL=postgresql://user:pass@prod-db:5432/noqueue
  1. Build Production Images
# Build optimized images
docker-compose -f docker-compose.prod.yml build

# Deploy
docker-compose -f docker-compose.prod.yml up -d
  1. Initialize Production Database
docker-compose -f docker-compose.prod.yml exec backend python manage.py migrate
docker-compose -f docker-compose.prod.yml exec backend python manage.py collectstatic --noinput

Kubernetes Deployment

# Apply Kubernetes manifests
kubectl apply -f k8s/

# Check deployment status
kubectl get pods -n noqueue

πŸ” Security

Security Features

  • Token-based authentication
  • CORS protection
  • SQL injection prevention
  • XSS protection
  • CSRF protection
  • Rate limiting
  • Input validation
  • Audit logging

Security Best Practices

  1. Use strong SECRET_KEY in production
  2. Enable HTTPS in production
  3. Regularly update dependencies
  4. Monitor audit logs
  5. Implement proper backup strategies
  6. Use environment variables for sensitive data

πŸ“Š Monitoring

Health Checks

  • GET /api/core/health/ - System health check
  • Monitor Celery workers: celery -A noqueue inspect active
  • Database connectivity check included

Logging

  • Application logs: /app/logs/
  • Celery logs: Monitor worker output
  • Nginx logs: /var/log/nginx/

Metrics

  • Payment success rates
  • Response times
  • Error rates
  • User activity

πŸ§ͺ Testing

Test Structure

backend/tests/
β”œβ”€β”€ test_models.py          # Model tests
β”œβ”€β”€ test_views.py           # API endpoint tests
β”œβ”€β”€ test_adapters.py        # Adapter integration tests
β”œβ”€β”€ test_tasks.py           # Celery task tests
└── test_integration.py     # End-to-end tests

frontend/src/tests/
β”œβ”€β”€ components/             # Component tests
β”œβ”€β”€ store/                  # Redux store tests
└── integration/            # Integration tests

Running Specific Tests

# Run specific test file
docker-compose exec backend pytest tests/test_models.py

# Run with coverage
docker-compose exec backend pytest --cov=payments tests/test_models.py

# Run frontend tests
docker-compose exec frontend npm test -- --coverage

πŸ”Œ Integrations

Payment Service Providers (PSP)

  • ClickPesa: Mobile money and card payments
  • Extensible: Add new PSPs via adapter pattern

Student Information Systems (SIS)

  • Mock SIS adapter included
  • Extensible for real SIS integration

Blockchain Integration

  • Mock blockchain adapter for transaction logging
  • Ready for real blockchain integration

Loan Providers

  • Mock loan adapter for student loans
  • Extensible for real loan provider integration

πŸ›  Troubleshooting

Common Issues

Database Connection Issues

# Check database container
docker-compose logs postgres

# Reset database
docker-compose down -v
docker-compose up --build

Celery Worker Issues

# Check worker status
docker-compose exec backend celery -A noqueue inspect active

# Restart workers
docker-compose restart celery-worker

Frontend Build Issues

# Clear node modules
docker-compose exec frontend rm -rf node_modules package-lock.json
docker-compose exec frontend npm install

Performance Optimization

  • Enable Redis caching
  • Optimize database queries
  • Use CDN for static files
  • Enable gzip compression
  • Monitor and optimize Celery tasks

πŸ“ Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass
  6. Submit a pull request

Code Style

  • Backend: Follow PEP 8 (enforced by flake8)
  • Frontend: Follow ESLint configuration
  • Use meaningful commit messages
  • Add docstrings to functions and classes

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

For support and questions:

  • Create an issue on GitHub
  • Check the troubleshooting section
  • Review the API documentation
  • Contact the development team

πŸ—Ί Roadmap

Phase 2 (Upcoming)

  • Multi-university support
  • Advanced reporting and analytics
  • Mobile application
  • Additional payment providers
  • Blockchain integration
  • AI-powered fraud detection

Phase 3 (Future)

  • Machine learning for payment optimization
  • Advanced loan management
  • Integration with external financial systems
  • Multi-language support
  • Advanced security features

πŸ™ Acknowledgments

  • Django and React communities
  • ClickPesa for payment processing
  • Contributors and testers
  • Open source libraries used in this project

Contact

Developed by Victor Gervas Mmanda
Email: victor@evethlabstech.com
Phone & Whatsapp: +255626802297 Portifolio: www.victor.evethlabstech.com Website: www.evethlabstech.com GitHub: https://github.com/vk-eveth/mtaaAddress

About

An enterprise university fee payment system with multi-PSP integration, real-time dashboards, and modern microservices architecture.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages