Skip to content

Ap13Crow/musicEducation

Repository files navigation

🎡 My Music Coach β€” Classical Music Education

A modern, fully open-source, AI-powered education platform for classical music built around three pillars:

Pillar Description
πŸŽ“ Theory Moodle-powered video courses with quizzes and progress tracking
🎸 Practice Online lessons (Zoom) + in-person bookings (LibreBooking) with Stripe/Yapeal payments
πŸŽͺ Performance Discover and publish concerts, masterclasses and workshops β€” ticketed via pretix

Architecture

My Music Coach is a hub-and-spoke platform with five core systems:

System Role Domain (local)
my-music-coach User profiles, orchestration, public event discovery app.mymusic-coach.test / api.mymusic-coach.test
Keycloak Central identity provider (OIDC + SAML) auth.mymusic-coach.test
Moodle Online learning core (courses, lessons, quizzes) learn.mymusic-coach.test
LibreBooking Physical lesson scheduling (rooms, resources) booking.mymusic-coach.test
pretix Event ticketing core (orders, check-in, refunds) tickets.mymusic-coach.test

Service Map

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Caddy Gateway (:80)                           β”‚
β”‚  app.  β”‚  api.  β”‚  auth.  β”‚  learn.  β”‚  booking.  β”‚  tickets.  β”‚
β””β”€β”€β”€β”¬β”€β”€β”€β”€β”΄β”€β”€β”€β”¬β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
    β”‚        β”‚         β”‚         β”‚            β”‚            β”‚
    β–Ό        β–Ό         β–Ό         β–Ό            β–Ό            β–Ό
  [web]    [api]   [keycloak]  [moodle]  [librebooking]  [pretix]
    β”‚        β”‚         β–²         β”‚            β”‚            β”‚
    β”‚        β”‚    OIDC/SAML      β”‚            β”‚            β”‚
    β”‚        β”‚    β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€            β”‚            β”‚
    β”‚        β”‚    β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€            β”‚
    β”‚        β”‚    β”‚    β”‚    β”Œβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
    β”‚        β”‚    β”‚    β”‚    β”‚    β”‚            β”‚            β”‚
    β”‚        β–Ό    β”‚    β–Ό    β”‚    β–Ό            β–Ό            β–Ό
    β”‚   [postgres] β”‚ [moodle-db] β”‚  [librebooking-db]  [pretix-db]
    β”‚   [redis]    β”‚             β”‚                     [pretix-redis]
    β”‚   [minio]    β”‚             β”‚
    β”‚   [mcp-svc]  β”‚             β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
                                 └──────── All DBs/Redis internal only

Startup Order

  1. Databases β€” postgres-main, moodle-db, librebooking-db, pretix-db
  2. Caches β€” redis-main, pretix-redis
  3. Identity β€” keycloak
  4. External services β€” moodle, librebooking, pretix
  5. Platform β€” api β†’ web
  6. AI / Storage β€” mcp-server, minio
  7. Gateway β€” gateway (last β€” waits for all upstreams)

Quick Start

1. Prerequisites

  • Docker & Docker Compose v2
  • Node.js β‰₯ 20 + npm β‰₯ 10

2. Configure /etc/hosts

# Add to /etc/hosts (or run: make hosts)
127.0.0.1  app.mymusic-coach.test
127.0.0.1  api.mymusic-coach.test
127.0.0.1  auth.mymusic-coach.test
127.0.0.1  learn.mymusic-coach.test
127.0.0.1  booking.mymusic-coach.test
127.0.0.1  tickets.mymusic-coach.test

3. Start the full stack

cp .env.example .env
# Edit .env with your secrets/API keys

make up          # or: docker compose up -d --build
make migrate     # Run DB migrations

4. Access services

Service URL
🌐 Web App http://app.mymusic-coach.test
πŸ”Œ GraphQL API http://api.mymusic-coach.test/graphql
πŸ”‘ Keycloak Admin http://auth.mymusic-coach.test
πŸ“š Moodle LMS http://learn.mymusic-coach.test
πŸ“… LibreBooking http://booking.mymusic-coach.test
🎫 pretix Ticketing http://tickets.mymusic-coach.test

5. Development (hot-reload, no Docker)

npm install
npm run dev

Production on mymusic.coach (Cloudflare tunnel)

The live deployment runs on a Linux (Ubuntu) host. TLS terminates at Cloudflare, and a cloudflared tunnel connects outbound only to the internal Caddy gateway β€” nothing is exposed on the host's public IP. All services are reachable on the real domain:

Service URL
🌐 Web App https://app.mymusic.coach
πŸ”Œ GraphQL API https://api.mymusic.coach/graphql
πŸ”‘ Keycloak https://auth.mymusic.coach
πŸ“š Moodle LMS https://learn.mymusic.coach
πŸ“… LibreBooking https://booking.mymusic.coach
🎫 pretix Ticketing https://tickets.mymusic.coach
# 1. Generate a production .env with fresh, URL-safe secrets
bash scripts/gen-prod-env.sh
# then add CLOUDFLARE_TUNNEL_TOKEN=... (from the Cloudflare Zero Trust dashboard)

# 2. Bring up the stack with the production overrides + tunnel
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
make migrate

The override file (docker-compose.prod.yml) flips the services that bake a hostname into their own config (Keycloak, Moodle, LibreBooking, pretix) to the https://*.mymusic.coach hosts and adds the cloudflared tunnel. The base docker-compose.yml stays the dev source of truth (*.mymusic-coach.test).

Configure your Cloudflare tunnel ingress so every public hostname routes to the gateway service (http://gateway:80), and point each *.mymusic.coach hostname's DNS at the tunnel. See docs/production-runbook.md for the full deployment checklist and a diagnostic runbook for the external containers.


Tech Stack

  • Backend: Node.js Β· TypeScript Β· Apollo Server 4 (GraphQL) Β· Prisma Β· PostgreSQL 16 Β· Redis
  • Frontend: Next.js 14 Β· TypeScript Β· Tailwind CSS Β· Apollo Client
  • Auth: Keycloak 24 (OpenID Connect + SAML) β€” central SSO for all systems
  • Learning: Moodle 4.4 β€” online course delivery
  • Scheduling: LibreBooking 2.8 β€” physical room/resource booking
  • Ticketing: pretix 2024.7 β€” event ticketing and check-in
  • AI: MCP Server + DeepSeek V4
  • Payments: Stripe + Yapeal (Swiss)
  • Video: Zoom API
  • Storage: MinIO (S3-compatible)
  • Gateway: Caddy 2.8 (reverse proxy)
  • Infrastructure: Docker Compose + Kubernetes

Key Features

  • AI-powered onboarding assessment (15–20 min) β€” theory, performance recording, musical culture + preferences β†’ personalised skill level + learning path
  • Duolingo-style gamification β€” XP, levels, streaks, badges, achievements
  • Moodle-powered courses β€” sections, lessons (video/audio/text/quiz), enrollments, progress
  • Teacher marketplace β€” certifications, availability, ratings, Zoom/LibreBooking scheduling
  • pretix-powered event ticketing β€” geo-search for nearby concerts, full ticket lifecycle
  • Social feed β€” posts, likes, comments, follows
  • AI recommendations β€” courses, teachers and events matched to your profile
  • Central SSO β€” one Keycloak account logs into all systems

Project Structure

apps/api/                     GraphQL API (Apollo Server + Express)
  src/integrations/           Integration layer (adapters, webhooks, sync)
    adapters/                 LibreBooking, Moodle, pretix adapters
    webhooks/                 Webhook handlers
    provisioning/             User provisioning flows
    sync/                     Periodic sync jobs
apps/web/                     Next.js 14 frontend
packages/database/            Prisma schema (PostgreSQL)
packages/graphql-schema/      Shared GraphQL SDL
packages/mcp-server/          MCP server (AI tools via DeepSeek)
docker/
  gateway/                    Caddy reverse proxy config
  keycloak/                   Keycloak realm export
  moodle/                     Moodle Dockerfile
  librebooking/               LibreBooking Dockerfile + entrypoint
  pretix/                     pretix Dockerfile + entrypoint
k8s/                          Kubernetes manifests
docs/
  integration-architecture.md Full integration design
  local-domains.md            /etc/hosts setup guide
  pretix-integration.md       pretix integration details
  security-baseline.md        Security controls and checklist

Make Targets

make up             Start the full stack
make down           Stop all services
make logs           Tail all service logs
make migrate        Run Prisma migrations
make seed           Seed the database
make realm-import   Re-import Keycloak realm
make hosts          Print required /etc/hosts entries
make dev            Start local dev servers (no Docker)
make help           Show all available targets

Documentation


License

MIT

About

This new web platform allows a modern education system for music with online courses like Udemy, teacher-based learning and booking systems for in-person teaching and also additional classification and gamification aspects.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors