A modular Python application framework for educational institution management, built with Flask and designed around clean architecture principles.
Campus is a comprehensive educational management platform that provides:
- User Management: Student, teacher, and administrator accounts with role-based permissions
- Circle Management: Groups, classes, and organizational units with hierarchical permissions
- Secure Authentication: OAuth integration (Google) and email-based verification
- Secrets Management: Secure credential storage with fine-grained access control
- Flexible Storage: Multi-backend data persistence (PostgreSQL, MongoDB)
- RESTful APIs: Clean HTTP interfaces for all services
- Modular Architecture: Independent services that can be deployed separately or together
- Python 3.11 or higher
- Poetry for dependency management
- PostgreSQL (for vault and storage services)
- MongoDB (optional, for alternative storage backend)
# Clone the repository
git clone https://github.com/nyjc-computing/campus.git
cd campus
# Install dependencies
poetry install
# Set up environment variables
cp .env.example .env
# Edit .env with your configuration
# Run the application
poetry run python main.py# Build and run with Docker Compose
docker-compose up -d
# The application will be available at http://localhost:5000campus/
βββ π README.md # This file - project overview
βββ π main.py # Application entry point
βββ π pyproject.toml # Root project configuration
βββ π poetry.lock # Dependency lock file
βββ π docker-compose.yml # Docker setup
βββ π .env.example # Environment template
βββ π campus/ # Main package namespace
β βββ π README.md # Architecture overview
β βββ π apps/ # Web applications and API services
β βββ π client/ # Client interfaces (HTTP-like APIs)
β βββ π οΈ common/ # Shared utilities and schemas
β βββ ποΈ models/ # Business logic and data models
β βββ π§ services/ # Supporting services (email, etc.)
β βββ πΎ storage/ # Data persistence layer
β βββ π vault/ # Secrets management service
β βββ π¦ workspace/ # Deployment meta-package
βββ π docs/ # Additional documentation
βββ π tests/ # Test suite
βββ π migrations/ # Database migrations
βββ π deploy/ # Deployment configurations
Campus follows a modular monolith architecture with clear service boundaries:
- π Separation of Concerns: Each service has a single, well-defined responsibility
- π Loose Coupling: Services communicate through clean interfaces
- π Security First: Authentication and authorization built into every layer
- π Scalable: Can be deployed as monolith or microservices
- π§ͺ Testable: Comprehensive test coverage with mocking support
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β π Apps β β π Client β β π οΈ Common β
β Web APIs β β Interfaces β β Utilities β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β ποΈ Models β β π Vault β β π§ Services β
β Business β β Secrets β β Email, etc. β
β Logic β β Management β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β
βββββββββββββββββββ
β πΎ Storage β
β Data Layer β
βββββββββββββββββββ
Campus uses environment variables for configuration:
# Environment Configuration
ENV="development" # or "staging", "production"
# Client Authentication (Required for campus.client)
CLIENT_ID="your-client-id"
CLIENT_SECRET="your-client-secret"
# Vault Database (Only required when using campus.vault service)
VAULTDB_URI="postgresql://user:pass@localhost/vault"
All other configuration (storage, OAuth, email, etc.) is managed through campus.vault
and should not be set as environment variables. Use the vault service to manage these
secrets securely.- π Campus Architecture - Detailed architecture overview and design principles
- π Vault Service - Secrets management and authentication
- π Client Interfaces - HTTP-like APIs and usage patterns
- π¦ Workspace Package - Deployment and platform compatibility
- ποΈ Models Documentation - Business logic and data models
- πΎ Storage Documentation - Data persistence and backends
See DEPLOY.md.
See docs/development-guidelines.md.
We welcome contributions! Please see our contributing guidelines.
- Architecture: Follow established patterns in campus/README.md
- Testing: Maintain high test coverage (>90%)
- Documentation: Update READMEs and docstrings
- Security: Never commit secrets or credentials
- Modularity: Keep services independent and loosely coupled
Campus is developed by the NYJC Computing Department as an open-source educational management platform. It's designed to be:
- Educational: Learn modern Python architecture patterns
- Practical: Solve real institutional management needs
- Flexible: Adapt to different educational contexts
- Scalable: Grow from small schools to large universities
- Documentation: Check service-specific READMEs in campus/
- Issues: Report bugs via GitHub Issues
- Discussions: Ask questions in GitHub Discussions
- Security: Report vulnerabilities to security@nyjc.edu.sg
Ready to get started? Check out the Campus Architecture Guide for detailed technical documentation.
The following subpackages can be installed independently. Each provides an install.sh script for reliable installation with all dependencies:
campus/clientβ The client library for interacting with Campus APIs.campus/vaultβ The Vault service and related tools.campus/appsβ The main application server and API endpoints.campus/workspaceβ The meta-package for a full Campus deployment (installs all components).
To install any subpackage:
cd campus/<subpackage>
bash install.shReplace <subpackage> with client, vault, apps, or workspace as needed.
Note: Do not use
pip installorpoetry installdirectly for these subpackages unless you are developing locally. The install scripts ensure all dependencies are present and installed in the correct order.
For more details, see the README in each subpackage directory.