How whamtet/acastream works
Purpose and entry points
Acastream is a server-rendered Clojure application for creating and running classroom activities: games, printable PDFs, quizzes, vocabulary tools, scheduling, student records, and mixed video/slides. Runtime startup and system wiring are centered on src/clj/simpleui/flashcards3/core.clj, with environment-specific settings under env/dev/clj/simpleui/flashcards3/env.clj and env/prod/clj/simpleui/flashcards3/env.clj.
HTTP composition and request boundaries
The web handler assembles the HTTP application in src/clj/simpleui/flashcards3/web/handler.clj. Routes are separated by audience/type: authenticated UI routes, open routes, and API routes in src/clj/simpleui/flashcards3/web/routes/ui.clj, src/clj/simpleui/flashcards3/web/routes/open.clj, and src/clj/simpleui/flashcards3/web/routes/api.clj. Cross-cutting request behavior is isolated in authentication, format, exception, and sharing middleware under src/clj/simpleui/flashcards3/web/middleware/auth.clj, src/clj/simpleui/flashcards3/web/middleware/formats.clj, and src/clj/simpleui/flashcards3/web/middleware/share.clj.
Feature-controller layer
Controllers own activity-specific request handling and orchestration. Interactive/game flows are represented by src/clj/simpleui/flashcards3/web/controllers/battleships/place.clj, src/clj/simpleui/flashcards3/web/controllers/boggle.clj, and src/clj/simpleui/flashcards3/web/controllers/memory.clj. Content and classroom-management capabilities are separate controller domains, including reading, students, schedule, slideshow, and sharing in src/clj/simpleui/flashcards3/web/controllers/reading.clj, src/clj/simpleui/flashcards3/web/controllers/students.clj, and src/clj/simpleui/flashcards3/web/controllers/slideshow.clj.
Server-rendered UI and progressive interaction
Views are Clojure-rendered presentation modules consumed by controllers, with shared page/component composition in src/clj/simpleui/flashcards3/web/views/components.clj. Activity UIs are organized per feature, for example src/clj/simpleui/flashcards3/web/views/play.clj, src/clj/simpleui/flashcards3/web/views/battleships.clj, and src/clj/simpleui/flashcards3/web/views/readings.clj. HTMX integration is a dedicated boundary in src/clj/simpleui/flashcards3/web/htmx.clj, indicating partial-response interactions rather than a separate SPA frontend.
Persistence, migrations, and content imports
Database schema changes are versioned as SQL migrations in resources/migrations/20240417013522-slideshow.up.sql and resources/migrations/20240417013523-reading.up.sql, applied through src/clj/simpleui/flashcards3/migratus.clj. SQL query definitions reside in resources/sql/queries.sql. Student persistence is explicitly separated from request/UI handling in src/clj/simpleui/flashcards3/web/controllers/students_persist.clj; spreadsheet ingestion support lives in src/clj/simpleui/flashcards3/excel.clj.
Generated artifacts and static delivery
PDF-generation controllers form a major output pipeline for printable classroom materials, including src/clj/simpleui/flashcards3/web/controllers/pdf.clj, src/clj/simpleui/flashcards3/web/controllers/pdf_bingo.clj, and src/clj/simpleui/flashcards3/web/controllers/pdf_maze.clj. Public browser behavior and assets are served from resources/public, such as resources/public/blooket.js, resources/public/edit.js, and resources/public/fullScreen.js. Static learning data/import assets include resources/blooket.csv and resources/kahoot.xlsx.
Runtimes and deployment
The primary runtime is JVM Clojure, using dependency/build descriptors deps.edn and build.clj; production packaging is an uberjar. Node/npm is used to build/watch Tailwind CSS via package.json and tailwind.config.js. Container deployment is defined by Dockerfile; operational database backup scripts are backup.sh and backup-stg.sh. A Chrome extension is a separate browser runtime under chrome-extension/manifest.json, chrome-extension/background.js, and chrome-extension/content.js.
Main entry points: handler.clj HTTP handler · ui.clj UI, open & API routes · students.clj Classroom controllers · components.clj Server-rendered views
Components 19
Runtime & deployment
- System startup · Wires the application with environment settings.
src/clj/simpleui/flashcards3/core.clj - Environment settings
env/prod/clj/simpleui/flashcards3/env.clj - JVM build & uberjar
build.clj - Container deployment
Dockerfile
HTTP application
- HTTP handler · Composes routes and request middleware.
src/clj/simpleui/flashcards3/web/handler.clj - UI, open & API routes · Separates authenticated, public, and API endpoints.
src/clj/simpleui/flashcards3/web/routes/ui.clj - Request middleware · Authentication, formats, exceptions, and sharing behavior.
src/clj/simpleui/flashcards3/web/middleware/auth.clj
Activity features
- Game controllers · Runs interactive activity flows such as Battleships, Boggle, and Memory.
src/clj/simpleui/flashcards3/web/controllers/boggle.clj - Classroom controllers · Handles reading, students, scheduling, slideshows, and sharing.
src/clj/simpleui/flashcards3/web/controllers/students.clj - Printable PDF pipeline · Produces printable classroom materials including bingo and mazes.
src/clj/simpleui/flashcards3/web/controllers/pdf.clj - Server-rendered views · Shared components and activity-specific page rendering.
src/clj/simpleui/flashcards3/web/views/components.clj - HTMX responses · Supports progressive partial-page interactions.
src/clj/simpleui/flashcards3/web/htmx.clj
Data & imports
- Student persistence
src/clj/simpleui/flashcards3/web/controllers/students_persist.clj - SQL query definitions
resources/sql/queries.sql - Database migrations · Applies versioned slideshow and reading schema changes.
src/clj/simpleui/flashcards3/migratus.clj - Spreadsheet imports · Imports learning and student data from spreadsheet assets.
src/clj/simpleui/flashcards3/excel.clj
Browser & generated outputs
- Public browser assets · Serves browser scripts and other public files.
resources/public - Tailwind asset build
package.json - Chrome extension · Separate extension with background and content scripts.
chrome-extension/manifest.json
Connections 21
- Environment settings → System startup: configures
- JVM build & uberjar → System startup: packages
- Container deployment → JVM build & uberjar: deploys
- System startup → HTTP handler: starts
- HTTP handler → Request middleware: applies
- HTTP handler → UI, open & API routes: mounts
- UI, open & API routes → Game controllers: dispatches to
- UI, open & API routes → Classroom controllers: dispatches to
- UI, open & API routes → Printable PDF pipeline: dispatches to
- Game controllers → Server-rendered views: renders
- Classroom controllers → Server-rendered views: renders
- Printable PDF pipeline → Server-rendered views: uses content
- HTMX responses → Server-rendered views: returns partials from
- Classroom controllers → HTMX responses: supports
- Classroom controllers → Student persistence: persists students
- Student persistence → SQL query definitions: uses
- Database migrations → SQL query definitions: evolves schema for
- Spreadsheet imports → Student persistence: ingests into
- Tailwind asset build → Public browser assets: builds assets for
- HTTP handler → Public browser assets: serves
- Chrome extension → HTTP handler: interacts with