Skip to content

bloboss/class-forge

Repository files navigation

Class Forge

An educational assignment management system that integrates with self-hosted Git platforms (Forgejo and GitLab) to provide GitHub Classroom-like functionality.

Features

  • Classroom Management - Create and manage coding classrooms tied to platform organizations/groups
  • Assignment Distribution - Create assignments from template repositories with automatic repo provisioning
  • Student Management - Manage student rosters and link to platform accounts
  • Team Support - Individual and team-based assignments with size limits
  • Submission Tracking - Automatic tracking when students accept assignments
  • Deadline Enforcement - Configurable deadlines per assignment
  • Multi-Platform - Supports both Forgejo and GitLab backends through a unified platform abstraction
  • REST API - Complete REST API for all operations

Architecture

Class Forge follows a layered architecture with clear separation of concerns:

API Handlers  ->  Service Layer  ->  Repository Layer  ->  PostgreSQL
                       |
                  Platform Provider (Forgejo / GitLab)
  • API Server (cmd/fgc-server/) - REST API with Gin framework
  • CLI Tool (cmd/fgc/) - Command-line interface
  • Service Layer (internal/service/) - Business logic and validation
  • Repository Layer (internal/repository/) - Data access with raw SQL
  • Platform Abstraction (internal/platform/) - Provider interface for Git platforms
  • Models (internal/model/) - Domain objects

Requirements

  • Go 1.21+
  • PostgreSQL 14+
  • A Forgejo or GitLab instance with API access

Quick Start

1. Build

git clone https://code.forgejo.org/forgejo/classroom.git
cd classroom
make build

2. Configure

Create config.yaml:

server:
  port: 8080
  mode: release

platform:
  type: forgejo    # or "gitlab"

forgejo:
  base_url: https://your-forgejo.example.com
  token: your-api-token

database:
  host: localhost
  port: 5432
  user: classforge
  password: secret
  name: classforge
  ssl_mode: disable

Or use environment variables with the FGC_ prefix (e.g., FGC_PLATFORM_TYPE=forgejo).

3. Run

# Set up PostgreSQL database
createdb classforge

# Start the server (migrations run automatically)
./bin/fgc-server

4. Verify

curl http://localhost:8080/healthz
# {"status":"ok"}

See the Getting Started Guide for a complete walkthrough.

Documentation

Development

Project Structure

class-forge/
  cmd/
    fgc/               CLI application
    fgc-server/        API server
  internal/
    api/               HTTP handlers and routing
    config/            Configuration loading
    database/          Database connection and migrations
    model/             Domain models
    platform/          Git platform abstraction
      forgejo/         Forgejo provider
      gitlab/          GitLab provider
    repository/        Data access layer (SQL)
    service/           Business logic
    util/              Shared utilities
  migrations/          PostgreSQL migration files
  docs/                User documentation

Running Tests

# All unit tests
make test

# Specific package
go test ./internal/service/... -v

# With coverage
go test ./... -cover

Make Targets

  • make build - Build CLI and server binaries
  • make test - Run unit tests
  • make test-integration - Run integration tests (requires Docker)
  • make lint - Run linters
  • make clean - Remove build artifacts

License

[License TBD]

About

A forge-agnostic github classroom alternative

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors