Skip to content

nyjc-computing/campus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Campus

Python 3.11+ Flask 3.0+ Poetry License

A modular Python application framework for educational institution management, built with Flask and designed around clean architecture principles.

πŸ›οΈ Overview

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

πŸš€ Quick Start

Prerequisites

  • Python 3.11 or higher
  • Poetry for dependency management
  • PostgreSQL (for vault and storage services)
  • MongoDB (optional, for alternative storage backend)

Installation

# 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

Docker Setup (Alternative)

# Build and run with Docker Compose
docker-compose up -d

# The application will be available at http://localhost:5000

πŸ“ Project Structure

campus/
β”œβ”€β”€ πŸ“„ 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

πŸ—οΈ Architecture

Campus follows a modular monolith architecture with clear service boundaries:

Core Principles

  • πŸ”„ 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

Service Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   🌐 Apps       β”‚    β”‚   πŸ”Œ Client     β”‚    β”‚   πŸ› οΈ Common     β”‚
β”‚   Web APIs      β”‚    β”‚   Interfaces    β”‚    β”‚   Utilities     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚                       β”‚                       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   πŸ›οΈ Models     β”‚    β”‚   πŸ” Vault      β”‚    β”‚   πŸ“§ Services   β”‚
β”‚   Business      β”‚    β”‚   Secrets       β”‚    β”‚   Email, etc.   β”‚
β”‚   Logic         β”‚    β”‚   Management    β”‚    β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   πŸ’Ύ Storage    β”‚
                    β”‚   Data Layer    β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ Configuration

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.

πŸ“š Documentation

πŸš€ Deployment

See DEPLOY.md.

πŸ”¬ Development

See docs/development-guidelines.md.

🀝 Contributing

We welcome contributions! Please see our contributing guidelines.

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

🏫 About

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

πŸ“ž Support


Ready to get started? Check out the Campus Architecture Guide for detailed technical documentation.

Installable Subpackages

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.sh

Replace <subpackage> with client, vault, apps, or workspace as needed.

Note: Do not use pip install or poetry install directly 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.

About

Services for the digital campus

Resources

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages