CSEMA Go Rewrite Plan

The plan rewrites the CSEMA cybersecurity learning platform from Django + Next.js as one small Go binary (Echo, GORM, MariaDB 11.8) with an embedded Nuxt UI, plus a small agent on each lab host. It starts from what people actually use, and it keeps only what that use needs. This is the last big refactor, so every choice favours less code.

Status: implementation in progress. See the progress table. The work branch is refactor/go-rewrite (local). Measured on 31 Oct 2026 against a local copy of the production database.

1. Summary

The platform grew one feature at a time. It now has 45 Django apps, 308 tables and 669 API routes. Most of them are hidden, empty or unused. One production container runs 7 processes. A small change often touches 3 or 4 parts.

The rewrite keeps the features people use and makes each one as simple as possible. "Simple" is the main rule. When two designs work, we choose the one with fewer parts.

TopicTodayNew
Programsnginx, uvicorn ×4, 2 Celery workers, beat, Redis, Next.js servercsema (one Go binary) + csema-lab-agent on each lab host
DatabasePostgres, 308 tables, 2,036 MBMariaDB 11.8 with GORM, 23 tables
API669 routesAbout 70 routes, one style
Backend code172k lines of PythonAs little as possible. Target under 20k lines of Go.
UINext.js, 117 pages, 74 dependenciesNuxt 4 + Nuxt UI 4, static, embedded in the binary
EventsA separate Next.js app (a fork of the main UI: 31 pages, 26k lines) with its own login hand-offPart of the one app and the one binary. 3 tables.
Lab machinesCloud VM pool, golden snapshots, orchestrator, Python agentHosts that you add by hand, a Go agent with a built-in SSH gateway
Size—Binary under 50 MB. Memory under 50 MB at idle.
Analytics and trackingTracking SDK, PostHog key, Sentry, email open and click trackingNone. Errors go to the server log.
NewsletterGrowth engine (10 apps)Built in: write, test, send, one-click unsubscribe
Strict rule: no automated tests. We write no unit, integration or end-to-end tests until you approve the whole system. Until then, we check each phase by hand with the checklists in section 18.
Conway's law. The structure follows the team. Today one engineer maintains 4 repositories and 7+ processes. The new system is one repository and one core binary. Its modules follow the roles that ask for changes (section 10).
Only what is needed. Every table, route and screen in this plan has a current use in the data. Nothing is kept "for later". No hard-coded values: infrastructure values come from one env config, business values (prices, lab hours, ranks, onboarding roles, limits) live in the database and are edited in admin, and the UI gets everything from the API.
Repository rules live in CLAUDE.md at the root: module shape, Go and GORM rules, API and UI conventions, no tests, no backward-compatibility code, no hard-coded values, max 500 lines per Go file, a README.md in every package (plus docs/ only when needed), and the handover checklist.
Logging everyone out at cutover is accepted. Users log in again once. Passwords keep working.

2. How we measured usage

Hidden pages and dead routes look the same as live ones in code, so we used 5 sources:

  1. Browser crawl. We signed in with 2 local test accounts (a learner on the highest plan and a staff user) and opened 61 pages with Claude in Chrome. A marker request before each page let us assign each backend call to its page.
  2. Static scan of the frontend. 388 API calls with their HTTP methods, including actions that a page load does not run.
  3. Route table. All Django URL patterns, matched against the frontend calls.
  4. Database. Row count and newest write time for each of the 265 models.
  5. Django admin log. Which models staff change by hand.
Production has no access logs (nginx and uvicorn logging are off). Row counts and last-write dates are the best usage signal we have.

3. The system today

45Django apps
172kPython lines. About 55k are course content in seed scripts.
265 / 308models / tables
669unique API routes. The frontend calls 306. The crawl hit 79.
2,036 MBdatabase. 1,943 MB is one marketing log table (7.2M rows).
117 / 95kNext.js pages / TypeScript lines
Figure 1. Today. Seven processes in two deployments, plus a separate events app and a lab orchestrator.

4. Features in use

The learner sidebar has 6 items: Home, Learn, Practice, Compete, Teams and Events (the events app). The account menu adds Profile, Achievements, Plans, Bills and Ambassador. Staff have an admin panel.

AreaWhat the user doesMain data today (rows, last write)
Sign inEmail + password, Google, GitHub, email verification, password reset, one session per user. 1,781 users (25%) have no password and use only Google or GitHub.users (6,996, today)
Onboarding4-step survey, then a recommended path.onboarding responses (994, today)
Learn27 paths in 5 tracks. Slide lessons, quizzes, code exercises, shell tasks, certificates.modules (752), quiz attempts (12,817), certificates (910), code submissions (today)
Practice207 CTF challenges with hints, files and writeups. 35 machines and 23 red-team labs on hosted VMs.solves (4,714), lab sessions (218, today)
CompeteGlobal leaderboard.users.points
TeamsTeam leaderboard, create, invite, join requests.teams (161), requests (211)
EventsCTF events with teams, waves, live scoreboard, certificates (in the events app). 6 events so far, all free, 5 created by staff. The largest had 830 registrations and 14,322 solves in 2 days.registrations (1,591), event solves (16,209). Last write Sep 2026.
BillingPlans, Razorpay checkout, coupons, bills, lab hour packs.plans (8), payments (today)
Small formsContact, ambassador application, CJWAPT waitlist.24 / 23 / 10 rows
AdminStaff edit challenges, challenge files, plans, events, learning paths and users (Django admin), plus an admin panel.admin log (1,871)

Hidden, broken or redirect-only pages still ship: Battleground, Exams, Interviews, Jobs, Series, study materials, a path "practical" page that calls a missing route (404) and a tampered-evidence page (404). About 10 frontend calls point at routes that do not exist.

5. Scope: keep, park, drop

Django appDecisionGo package / serviceRoutesUsed by UIModelsWith dataRowsLast write
admin_panelcore(feature admin.go)2315100—
allauthcoreauth191000—
rest_framework_simplejwtcoreauth11000—
userscoreauth7047231630,8992026-10-31
offerscorebilling742112026-01-07
paymentscorebilling1001182026-10-31
teamscorecompete3014554352026-09-08
eventscoreevents9953272145,9502026-09-25
redteam_labscorelabs351816148482026-10-31
codingcorelearn81558462026-10-31
learningcorelearn5219231670,2542026-10-28
shell_labscorelearn44553742026-10-31
challengescorepractice381720197,8142026-10-31
ambassadorcorecommunity852123—
exam_waitlistcorecommunity2211102026-10-31
onboardingcoreauth98645,2042026-10-31
ai_simulationparkai-sim605382026-10-30
battlegroundparkbattleground32311495,6772026-09-14
examparkexams259131029,0052026-09-01
forensics_labsparkforensics3065672026-09-16
tampered_evidenceparkforensics11400—
ai_engineparkgrowth00100—
automationparkgrowth9021112026-08-29
campaignsparkgrowth404432,6842026-10-30
conversionsparkgrowth10100—
decision_engineparkgrowth00117,206,9212026-10-31
experimentsparkgrowth3022152026-08-20
productsparkgrowth201122026-08-16
providersparkgrowth30000—
scoringparkgrowth00222,5252026-08-16
sending_limitsparkgrowth6022152026-08-29
ai_interactionsparkinterviews50112182026-09-02
interviewsparkinterviews1412751,2452026-05-07
network_labsparknetwork-labs40221182026-10-31
soc_arenaparksoc-arena40596662026-10-24
zero_hourparkzero-hour542295—
academicdrop-157600—
behavior_trackingdrop-31115,7242026-10-31
blogdrop-432262026-05-11
brandingdrop-22200—
bug_bountydrop-1815500—
corporatedrop-117300—
merchdrop-130600—
organizationsdrop-703222026-08-25

Features we drop inside core apps

6. Notes on parked modules

These modules each have their own runtime, UI or data model. They leave the core now and come back later. By Conway's law, a module comes back as a new package in the same repository and binary, unless a separate team owns it or its runtime must be isolated. Only then is it a separate service. SOC and network labs, for example, need their own runtime images on the lab hosts, but their APIs and UI still fit in the core.

ModuleWhat exists todayData to keepNotes for the rebuild
Zero Hour (season)zero_hour app, zero_hour_pack (412 files), story UI, audiochallenge links (24), progress (71 users)A season links existing challenges into chapters. It needs only challenges and XP.
SOC Arenasoc_arena (40 routes), SOC runtime imagescenario (1), runs (6)Runs on lab sessions. Rebuild with its own scenario engine.
Network labs (GNS3)network_labs, services/netsim, Next.js GNS3 proxylabs (73), sessions (45)Lessons that link to these labs show "coming back soon" until the rebuild.
AI simulationai_simulation + its own Vite UIsessions (4)Nearly unused. Rebuild only if there is demand.
Forensics labsforensics_labs, tampered_evidence, own Vite UIsessions (4)One "forensics simulations" service.
Battleground1v1 live CTF, hidden by a flagsessions (134). Last activity May 2026.Archive. Rebuild only if wanted.
AI interviewsinterviews, ai_interactions, unlinkedattempts (15)Archive.
ExamsMCQ exams, practical exams through the orchestratorArchive (registrations, results, MCQs)Rebuild later on the shared lab hosts.
Growth engine (removed)10 apps (decisions, campaigns, experiments …), no learner UINot migrated. It is removed, not rebuilt.Transactional mail and a simple newsletter are in the core (section 11). Old tracking and unsubscribe links are not kept.

7. What we do not build

Each item below has a simpler choice that is good enough for today's load (21 lab users a month, a peak of 2 concurrent labs, about 7k accounts). We add the bigger version only when a real need shows up.

We do not buildWe do this instead
JWT access and refresh tokens, JWKSOne opaque session token in a cookie (same origin). The same token works as a Bearer header for other clients.
Redis, Celery, a job queueGoroutine tickers for periodic work. One mail_outbox table for mail.
A WebSocket hub, notificationsServer-sent events only for the live event scoreboard. WebSocket only for the lab terminal. No notifications.
A lab credit ledger and hour packsHours left = the monthly allowance for the user's tier (a setting) minus this month's lab_sessions.seconds_used.
Constants in codeA settings table, edited in admin. Infrastructure values in env config.
A WireGuard VPN gatewayAn SSH gateway in the agent (section 15). Players need only ssh.
sqlc, SQL files and generated codeGORM models. Raw SQL only for a few heavy reads (leaderboard, stats).
Analytics, tracking, SentryNothing. Server logs only.
A marketing engineA newsletter: subscribers, issues in Markdown, send through the outbox.
OpenAPI files and code generatorsGo response structs → TypeScript types with tygo. One small api.ts fetch wrapper.
S3 or object storageFiles on the local disk (/var/lib/csema/files), served with cache headers.
Separate tables for quizzes, questions, choices, tests, hints, filesJSON columns on the parent row (section 11 explains the rule).
A table for each kind of "done" (solves, completions, attempts, badges, certificates)One progress table.
Content-as-code (55k lines of seed scripts), content files in gitContent lives in the database. Content files (lesson presentations, challenge files, images) are imported into the files directory, never committed. Staff edit both in the admin area. S3 support comes later.
Automated tests (for now)Manual checklists until you approve the system (strict rule).
An admin audit log, analytics tablesStructured logs.
Cloud VM automation, autoscaling, HALab hosts that you add by hand.
Multiple instances of the coreOne instance with an in-place, zero-downtime upgrade.

8. Target architecture

Figure 2. One process, one database, one folder of files. Lab hosts are separate machines.

9. Repository layout

All current code from the 4 repositories moves into legacy/, unchanged. The new code is built next to it, in isolation. Nothing in the new code imports from legacy/. Docs and project files stay at the top level.

/                          branch refactor/go-rewrite
├── legacy/                today's code, read-only, deleted after cutover
│   ├── backend/           the Django project (all apps, services, lab packs, static)
│   ├── frontend/          the Next.js app (csem_front)
│   ├── events-frontend/   the separate events app
│   └── orchestrator/      the lab orchestrator and Python lab agent
├── cmd/
│   ├── csema/             main.go of the core
│   └── csema-lab-agent/   main.go of the agent
├── internal/
│   ├── auth/              users, sessions, tokens, onboarding
│   ├── learn/             paths, modules, activities
│   ├── practice/          challenges
│   ├── progress/          progress, XP, leaderboard, stats, home
│   ├── teams/             teams, team_members
│   ├── events/            events, event_challenges, event_entries
│   ├── labs/              lab_hosts, lab_sessions
│   ├── billing/           plans, payments, coupons
│   ├── community/         forms, subscribers, newsletters
│   ├── server/            Echo setup, config, settings, middleware, errors, UI embed, graceful restart
│   ├── db/                GORM setup, pool, transaction helper
│   ├── mail/              outbox and SMTP
│   └── agent/             agent code: reconcile, Docker, nftables, SSH gateway, HTTPS proxy, exec
├── web/                   Nuxt app
├── docs/
├── CLAUDE.md  go.mod  Makefile

Development uses the machine's own MariaDB 11.8 (database csema) and the existing Mailpit container. No extra database is started.

Lab sources and runtime images (machine-labs-pack, the code runner, the shell-lab image) stay in legacy/backend. They move out only when we need to change them.

10. Module design

The core has 9 feature packages and 3 platform packages. A new developer reads one package to understand one feature.

Boundaries follow the team (Conway's law)

A system copies the communication structure of the people who build it. In the last 6 months, one engineer made every commit in all 4 repositories. Today's split (separate backend, frontend, events app and orchestrator repositories, 7+ processes) makes that one person coordinate with themselves across 4 codebases for each feature. The new structure matches the real team:

AreaWho asks for changesGo packagesUI foldersAdmin section
AccountLearners (product)auth, progressaccount/, home/, profile/Users
Learning contentCourse and challenge authorslearn, practicelearn/, practice/Content, Challenges
Events and communityEvent and community staffevents, teams, communityevents/, teams/, community/Events, Newsletter, Forms
LabsLab operatorlabs, agentlabs/Labs
BillingBusinessbillingbilling/Billing

The rule for later: a new service only when a new team owns it or its runtime must be isolated. Otherwise it is a new package.

Figure 3. Packages and their dependencies. Arrows point to what a package uses. There are no cycles.

One package, one shape

internal/practice/
├── README.md      what it does, tables it owns, routes, main flows (short)
├── docs/          only when one README page is not enough
├── model.go       GORM structs for this package's tables (columns only)
├── practice.go    type Service struct{ db *gorm.DB } and the rules (plain methods)
├── http.go        Routes(g *echo.Group) and handlers: read input → call Service → write JSON
└── admin.go       admin handlers for this package's tables

Rules

  1. Each table has one owner package. Only the owner writes to it. Any package can read with SQL joins.
  2. XP has one write path: progress.Record(tx, …). It adds the progress row and updates users.xp in the same transaction. users.xp is the one column that a non-owner writes. Event solves never change it.
  3. Handlers are thin. No SQL and no rules in a handler.
  4. No interfaces unless there are 2 real implementations. No repository layer: the Service uses GORM directly.
  5. GORM, plainly. Models have columns only, with no relation fields, so GORM never saves related rows by surprise. Joins are written where they are needed. No hooks.
  6. Admin endpoints live in the owner package (admin.go), so the rules for a table stay in one place.
  7. One error type: server.Err(status, code, message). Clients get {"error":{"code","message","fields"}}.
  8. Max 500 lines per Go file. Split by meaning, not by size alone.
  9. No backward-compatibility code. The UI and API ship in one binary, and the agent ships with the core. A change updates every caller at once: no old routes, aliases, deprecated fields, fallbacks or API versions.
  10. No hard-coded values. Infrastructure (domains, keys, SMTP, paths) comes from one Config struct, loaded from env and checked at start. Business values (lab hours per tier, ranks, onboarding roles, rate limits, feature switches) come from the settings table through server.Setting(key), cached and edited in admin. Content (paths, challenges, plans, coupons) is data. The UI has no URLs, prices, lists or constants: it reads them from the API.

Database connection

11. Data model and ERD

The model has 23 tables. Four ideas make it small:

  1. One table for "done". progress stores every completion: a solved challenge, a machine flag, an unlocked hint, a finished activity, module or path, and an event solve. XP, leaderboards, streaks, the activity heatmap, badges and certificates all come from this one table.
  2. JSON for parts that belong to a parent. A quiz's questions, a code exercise's tests, a challenge's hints, files and lab spec are always read and saved together with their parent and are never queried on their own. The rule: if we never query it alone, it is a JSON column. The API never sends answers, flag hashes or tests to the browser.
  3. Status columns, not more tables. Team invites and join requests are rows in team_members with status = invited or requested. Event allow-lists are rows in event_entries with status = allowed. Contact, ambassador, waitlist, event-support and challenge-report forms are rows in form_entries. Newsletter opt-in is one row in subscribers for each email.
  4. Reuse. Event challenges are normal challenges linked to an event. They stay unpublished in Practice until staff publish them after the event. Event teams are normal teams with event_id set and a join code. Event solves and hints are progress rows with event_id set.
Figure 4. All 23 tables, coloured by owner package. Every user_id column points to users.id (lines to users are left out for clarity). Dashed lines are references by kind + ref_id.

Key tables in detail

progress                                  one row = one thing a user finished
  user_id     BIGINT      → users.id
  event_id    BIGINT      0 = not in an event, else → events.id
  kind        ENUM        challenge | flag | hint | activity | module | path
  ref_id      BIGINT      id of the challenge / activity / module / path
  part        VARCHAR(32) '' | 'user' | 'root' (machine flags) | hint number
  xp          INT         can be negative (a hint costs XP)
  score       SMALLINT    quiz score in %, else NULL
  data        JSON        e.g. {"certificate":"CSEMA-7F3K-…"} for a path
  created_at  DATETIME(6)
  PRIMARY KEY (user_id, event_id, kind, ref_id, part)
  INDEX (event_id, created_at), INDEX (kind, ref_id)

challenges
  id, slug UNIQUE, title, category, difficulty, kind ENUM(flag, machine), tier ENUM(free, prime, elite),
  xp, body JSON        {description, hints:[{text,xp}], files:[{name,path}], writeup, tags:[…]}
  flags JSON           [{part:"", hash}] or [{part:"user",hash,xp},{part:"root",hash,xp}]  (HMAC, never sent out)
  lab JSON             {image, port, memory_mb, services:[…]}  (machine only)
  published, created_at, updated_at

activities                                one interactive part of a module
  id, module_id → modules.id, position, kind ENUM(quiz, code, shell, challenge), title, xp
  challenge_id         → challenges.id, only when kind = challenge (a real foreign key)
  content JSON         quiz: {questions:[{text, choices:[…], answer}]}
                       code: {starter, tests:[…]}   shell: {setup, checks:[…]}

lab_sessions
  status ENUM(starting, running, ended, failed), error TEXT
  active_user_id       generated: user_id while starting or running, else NULL
  UNIQUE (active_user_id)                    one active lab per user, race-free

teams / team_members
  teams.owner_id       the one owner; a transfer is one update
  team_members         PRIMARY KEY (team_id, user_id), status ENUM(member, invited, requested)

event_entries
  UNIQUE (event_id, user_id)                 no double registration, one team per event
  UNIQUE (event_id, email)                   one allow-list row per email

payments
  amount_paise INT, UNIQUE (provider_order_id), UNIQUE (provider_payment_id)

XP rules

ColumnMeaning
challenges.xp, activities.xpDefault reward for a solve or a finished activity.
modules.xpOne-time bonus when the module is complete. Finishing a path gives a certificate, not XP.
event_challenges.xpThe reward inside that event. It replaces challenges.xp there.
progress.xpThe XP actually given. The primary key makes a second award impossible.
users.xpLifetime XP. A cache of progress.xp where event_id = 0, updated in the same transaction by progress.Record.

Event XP and lifetime XP are separate. An event solve (event_id ≠ 0) counts only on that event's scoreboard and never changes users.xp. A user can solve the same challenge once in Practice and once in each event.

Flags

Old tables to new tables

NewReplaces (today)
progressChallengeSolve, MachineFlagSolve, UnlockedHint, ModuleCompletion, ModuleProgress, PathProgress, QuizAttempt, CodingExerciseSolve, ShellTaskPass, EarnedBadge, Certificate, EventChallengeSolve, UnlockedEventChallengeHint, UserStreak, UserScoreHistory
activitiesQuiz, QuizQuestion, QuizChoice, CodingExercise, CodingTestCase, ShellPractical, ShellTask, ChallengePlacement
modules, pathsModule, Phase (→ section text), Objective, Resource, LearningPath, Topic
challengesChallenge, Category, Tag, Hint, ChallengeFile, OfficialWriteup, TutorialPoint, MachineFlag, RedTeamLabSpec, RedTeamLabContent, RedTeamFlagSecret
teams, team_membersTeam, TeamInvite, TeamRequest, TeamAnnouncement, TeamChat, EventTeam, EventTeamMember, EventTeamRequest
events, event_challenges, event_entriesEvent, EventWave (→ release_at), EventChallenge, EventChallengeHint, EventRegistration, EventAllowedEmail, CertificateTemplate, UserPrize, EventGallery, EventAnnouncement (→ settings JSON, shown on the event page), EventReport and TrivarnaWriteup (→ data), EventSupportMessage (→ form_entries)
lab_hosts, lab_sessionsRedTeamPoolVM, RedTeamTenantSlot, LabSession, RedTeamLabState
plans, payments, couponsSubscriptionPlan, RazorpaySubscription, UserSubscriptionVerification, RedTeamSubscription, Offer, CouponCode
users, sessions, tokensUser, UserProfile (core fields), EmailVerification, PasswordReset, OnboardingResponse (→ users.onboarding JSON)
form_entriesContact, Ambassador, ExamWaitlistEntry, EventSupportMessage, Feedback and ChallengeReport
settingsJobRole, ranks, tier lab hours and other values that are hard-coded today
Not kept (archived)QuizAnswer, CodeSubmission, ChallengeAttempt, ShellAttempt, Notification, UserNotification, LabAccount, LabCreditEntry, LabPlanPurchase, all exam tables
subscribers, newslettersMarketing consent, MailingGroup, campaigns (new, simple version)
mail_outboxCelery mail tasks, EmailLog

Schema rules: MariaDB 11.8 LTS, InnoDB, utf8mb4_uca1400_ai_ci, strict mode. DATETIME(6) in UTC. JSON columns with JSON_VALID checks. An index on every foreign key. Integer ids stay the same as today where a table maps one-to-one. Money is integer paise. Emails are stored lowercase. Every *_id column has an index. Foreign key constraints come with the migration tooling, because GORM creates them only from relation fields and our models have none.

12. API

Conventions

Endpoints

auth
POST   /api/auth/signup                 email, username, password
POST   /api/auth/login                  email or username + password → sets cookie
POST   /api/auth/logout
GET    /api/auth/google  /api/auth/github           redirect to the provider
GET    /api/auth/google/callback  /api/auth/github/callback
POST   /api/auth/verify-email           token
POST   /api/auth/forgot-password        email
POST   /api/auth/reset-password         token, password
GET    /api/me                          user, plan, banner, UI settings
PATCH  /api/me                          name, bio, country, avatar, newsletter on/off
PUT    /api/me/password
PUT    /api/me/onboarding               survey answers → recommended path

community
POST   /api/forms/{contact|ambassador|waitlist|event-support|challenge-report}
POST   /api/newsletter                  subscribe an email (double opt-in mail)
POST   /api/newsletter/unsubscribe      token from the mail link (one click, no login)

learn
GET    /api/paths                       all paths by track, with my progress
GET    /api/paths/{slug}                path, sections, modules, my progress
GET    /api/modules/{id}                lesson content + activities (no answers)
POST   /api/modules/{id}/complete
POST   /api/activities/{id}/submit      quiz answers | code | shell check → result, xp
GET    /api/certificates/{code}         public certificate check

practice
GET    /api/challenges                  ?category&difficulty&kind&q&solved&cursor
GET    /api/challenges/{slug}           details, hints (locked/unlocked), files, my flags
POST   /api/challenges/{slug}/flag      flag, part → correct?, xp
POST   /api/challenges/{slug}/hints/{n} unlock a hint (costs xp)

progress
GET    /api/home                        next lesson, today, weekly goal, streak, picks
GET    /api/leaderboard                 ?limit
GET    /api/users/{username}            public profile: xp, rank, badges, heatmap, radar

teams
GET    /api/teams                       leaderboard + search
POST   /api/teams                       create (I become owner)
GET    /api/teams/{slug}
PATCH  /api/teams/{slug}                name, open (owner)
POST   /api/teams/{slug}/join           request to join, accept my invite, or join with a code
POST   /api/teams/{slug}/members        invite a user (owner)
PATCH  /api/teams/{slug}/members/{uid}  accept a request (owner)
DELETE /api/teams/{slug}/members/{uid}  leave, kick, decline

labs
GET    /api/labs                        hours left this month, my running session, its SSH command and password
POST   /api/challenges/{slug}/lab       start a lab session
DELETE /api/labs/sessions/{id}          stop it
GET    /api/labs/sessions/{id}/terminal WebSocket: terminal in the attack box

events
GET    /api/events                      upcoming, live, past
GET    /api/events/{slug}               details, my entry, my team
POST   /api/events/{slug}/register      join (checks the allow-list)
DELETE /api/events/{slug}/register      leave before the start
GET    /api/events/{slug}/challenges    released challenges (waves by release_at)
POST   /api/events/{slug}/challenges/{cslug}/flag
POST   /api/events/{slug}/challenges/{cslug}/hints/{n}
GET    /api/events/{slug}/scoreboard    public when the event allows it (spectate)
GET    /api/events/{slug}/stream        server-sent events: scoreboard, releases, announcements
POST   /api/events/{slug}/writeup       upload a writeup file after the event
        (event teams use /api/teams with "event": slug, and join with the team's join code)

billing
GET    /api/plans                       active plans
GET    /api/coupons/{code}              check a coupon
POST   /api/checkout                    plan + coupon → Razorpay order
POST   /api/checkout/verify             Razorpay signature → payment done
POST   /api/webhooks/razorpay
GET    /api/payments                    my bills

Admin API

Every admin resource has the same 5 routes. Only staff can call them. Each resource lives in the package that owns its table (admin.go).

GET    /api/admin/{resource}            list   ?q= & filters & cursor
POST   /api/admin/{resource}            create
GET    /api/admin/{resource}/{id}       read
PATCH  /api/admin/{resource}/{id}       update (only the fields sent)
DELETE /api/admin/{resource}/{id}       delete
ResourcePackageFiltersExtra actions (only these)
usersauthq, role, tierNo create. PATCH sets role, tier, tier_until, disabled. DELETE anonymizes.
paths, modules, activitieslearnpath, module, published—
challengespracticeq, category, kind, publishedPOST /challenges/{id}/files upload a file
eventseventsstatus (upcoming, live, past)PUT /events/{id}/challenges the full list with xp and release_at
GET|PATCH /events/{id}/entries, POST /events/{id}/entries/import (CSV allow-list)
POST /events/{id}/announcements post on the event page (live through the stream)
teamsteamsevent, q—
plans, couponsbillingactive—
paymentsbillingfrom, to, status, kindRead only. The list also returns totals for the range. Manual upgrades are a PATCH on the user's tier.
lab-hostslabsstatusPOST /lab-hosts/{id}/setup install over SSH.
lab-sessionslabsstatus, host, userNo create. DELETE stops a session.
formscommunityform (contact, ambassador, waitlist, event-support, challenge-report), status (new, done)—
subscriberscommunitystatus, q—
newsletterscommunitystatusPOST /newsletters/{id}/test send to me
POST /newsletters/{id}/send send to all subscribers
settingsserver—List and PATCH /settings/{key}. No create or delete: keys are defined in code with defaults.
systemserver—Read only: GET /api/admin/system gives version, uptime, database, mail queue and lab hosts.

Today's admin routes, and where they go

TodayNew
/api/admin-panel/contact-messages//api/admin/forms?form=contact
/api/admin-panel/exam-waitlist//api/admin/forms?form=waitlist
/api/admin-panel/system-health//api/admin/system
/api/admin-panel/revenue-summary//api/admin/payments?from=&to= (totals in the response)
/api/admin-panel/live-events//api/admin/events?status=live
/api/admin-panel/integrity-flags/Dropped (0 rows)
/api/challenges-admin//api/admin/challenges
/api/redteam/admin/labs/, …/labs/meta/, …/labs/{id}/test-launch//api/admin/challenges (the lab spec is a field of the challenge). Test launch is a normal lab start by a staff user.
/api/redteam/admin/labs/snapshot/rebuild/Dropped (no snapshots)
/api/learning-admin/, /api/learning-paths/bulk-upload//api/admin/paths, /modules, /activities
/api/accounts/admin/lifecycle-emails/, /api/accounts/mailing/…/api/admin/newsletters
/api/bug-bounty/admin/…, /api/battleground/sessions/, /api/jobs/, /api/study-materials/Dropped or parked
Django admin (/admin/, 1,285 routes)The resources above

That is about 70 routes plus the admin resources, against 669 routes today. The appendix lists the 208 core routes that the current UI calls, grouped by new package. Every feature in them maps to a route above or is in the drop list.

13. Sessions and compatibility

14. UI plan

Problems in today's UI

New UI

// app.config.ts
export default defineAppConfig({ ui: { colors: { primary: 'blue', neutral: 'neutral' } } })

/* assets/css/main.css */
@import "tailwindcss";
@import "@nuxt/ui";
@theme { --font-sans: 'Inter', system-ui, sans-serif; }
:root { --ui-bg: #ffffff; --ui-bg-muted: #fbfcfd; --ui-primary: var(--color-blue-600); }
.dark { --ui-bg: #0f0f0f; --ui-bg-elevated: #161616; --ui-bg-muted: #0b0b0b;
        --ui-border: #262626; --ui-primary: var(--color-blue-500); }

15. Machine lab hosting

Machine labs, red-team labs, shell labs and (later) SOC and exam labs run as containers on shared lab hosts. A small Go agent, csema-lab-agent, runs on each host. The core's labs package places sessions and controls the agents.

Why we change it

Measured (Sep to Oct 2026)Value
Lab sessions218 sessions, 21 accounts
Peak concurrent sessions2
Real play timeabout 17 h
Cloud VMs created since 3 Aug61, about 2,263 VM-hours
Failed starts15% (32 of 218), all from network hops between services
Typical lab memory128–256 MB

The VM-hours are about 100 times the play time. The cost comes from warm and short-lived VMs, not from players.

Design

Figure 5. The control link is an SSH tunnel. Players use 3 paths.

Network

Each session gets its own Docker network, a /27 from 198.18.0.0/17, which is the pool that CLAUDE.md already pins. There is no VPN.

How a player reaches a lab

  1. SSH gateway (main path). The agent has a built-in SSH server on port 2222. The host's own SSH server is never changed. The UI shows one command and a password for each session:
    ssh -p 2222 s-1234@ssh.lab.csema.tanmoysrt.xyz                       shell in the attack box
    ssh -p 2222 -L 8080:198.18.3.5:80 s-1234@ssh.lab.csema.tanmoysrt.xyz   reach a target port from your laptop
    ssh -p 2222 -D 1080 s-1234@ssh.lab.csema.tanmoysrt.xyz                SOCKS proxy for a browser or proxychains
    ssh -p 2222 -R 4444:localhost:4444 s-1234@ssh.lab.csema.tanmoysrt.xyz catch a reverse shell on your laptop
    ssh -J s-1234@ssh.lab.csema.tanmoysrt.xyz:2222 root@198.18.3.5        jump to a target's own SSH
    The gateway allows forwards only into the user's own session network. A reverse forward (-R) listens on the session network's gateway address, so a target can connect back. Players need nothing but ssh, and it works where UDP is blocked. The limit: no raw UDP or ICMP from the player's own machine. Those tools run in the attack box.
  2. Web challenges: https://<token>.lab.csema.tanmoysrt.xyz. Wildcard DNS points at the host. The agent gets the wildcard certificate (ACME DNS-01) itself.
  3. Terminal in the UI: browser → core (checks the user) → SSH tunnel → agent → docker exec with a PTY in the attack box. No ttyd container.

Agent API (Unix socket)

GET  /health                  version, Docker status
PUT  /state                   desired sessions and images (full list, with SSH passwords)
GET  /state                   actual sessions, IPs, ports, errors, memory and network use
GET  /exec/{session}          WebSocket: interactive PTY

16. Deploy and size budget

Figure 6. In-place upgrade. Neither process closes the listening socket, so no connection is refused.
  1. Copy the new binary and run systemctl reload csema.
  2. The running process starts the new binary and passes it the listening socket (tableflip).
  3. The new process applies schema changes (expand only) and reports ready.
  4. The old process stops accepting, finishes requests (30-second limit), closes UI terminals with code 1012 and exits. Clients reconnect. Lab SSH sessions are not affected: they end at the agent, not the core.
  5. If the new process fails its health check, it exits and the old one keeps serving.
BudgetLimitHow
Binary< 50 MB (target 30)CGO_ENABLED=0 -trimpath -ldflags "-s -w". CI fails above the limit.
Memory at idle< 50 MB (target 30)GOMEMLIMIT=48MiB, 10 DB connections, no big caches.
Not in the binary—Lesson presentations, uploads and large images, in /var/lib/csema/files.

17. Phases and steps

Implementation progress

Updated: 01 Nov 2026, 12:59 IST. Status records implementation and manual checks. It does not mark a phase complete before its exit checks pass.

Current order: the backend is implemented. Next is the UI from section 14: minimal, with the legacy design as the visual baseline, Nuxt UI blocks as they are and the theme in one place.

PhaseStatusImplemented and checkedRemaining
P0 Set upImplementedGo layout, local MariaDB database, Nuxt scaffold, Makefile and CI checks. Local format, vet, build and size checks pass.Remote CI run when publication of the branch is authorized.
P1 Skeleton, auth, progressImplemented; checks openCore server, database, mail outbox, auth, onboarding, progress and all 23 models. Password and mail flows checked locally.Google and GitHub sign-in with configured credentials. Complete the remaining exit checks.
P2 Learner backendImplemented (Few checks pending)Learner routes, content import, staff CRUD and uploads are implemented. Shell state and editor checkpoints pass manual checks. Teams, plans, coupons, payment reports, forms, subscribers and newsletters pass API checks. Mailpit confirms preview, bulk send and one-click unsubscribe. Checkout uses Razorpay Orders and signed capture verification. Missing-key and unsigned-webhook checks pass. Added GET /api/home (next lesson, week goal, streak, rank step, picks), GET /api/admin/system and avatar upload; each checked through the API.Real Razorpay checkout, captured payment, signed webhook and repeat-delivery checks need staging keys.
P3 LabsImplemented (Few checks pending)Host setup, placement, full desired state, Docker networks, SSH gateway and browser terminal. Manual checks cover private image pulls, isolation, stop, deadline cleanup and container survival across an agent restart. The agent manages the code runner. A reverse forward works from its own lab and is blocked from a separate network. Active labs block runtime edits. A fresh agent deployment passes the SSH shell check. Wildcard HTTPS with Certbot DNS-01 returns a lab page with a trusted certificate; web access is explicit per service (131 of 133 machines). Idle stop, agent upgrade with 40 containers kept, 20 concurrent sessions on distinct /27 networks, and cached starts of 1.35 to 1.39 s are checked. Shutdown ends terminals with code 1012 and streams at once; normal requests still drain.Start every machine of the catalogue once. Finish the -J check. 28 compose labs and the ttyd shell labs are not imported. The owner deferred the 40-session, 24-hour soak until the end of the whole rewrite.
P4 UIIn progressThe learner and staff screens are implemented. Learning now uses a compact library, a curriculum without numbered rails and a focused HTML lesson reader. Shared presentation players and simulators are copied with the learning files. Mobile headers and cards are smaller. Eyebrow labels and nested card states are removed. Buttons and form controls use a central md size. Landing and pricing actions also use md. Shared actions are neutral, and a screen has at most one explicit primary action. Manual review covered 38 mobile and desktop screen states without duplicate primary buttons. Practice now shows separate Challenges and Machine labs tabs. Search, topic filters, catalogue tabs, pagination and presentation full screen passed manual browser checks at mobile and desktop widths in light and dark themes. The landing page is at / and the signed-in home is at /dashboard. Auth screens, Ctrl+K search, flag and lesson celebrations, admin lists and filters use soft neutral surfaces. The sidebar has its own surface and a raised active row, and its collapse button is at the bottom. All 765 challenge titles, stories and machine questions are rewritten, and categories drop from 38 to 15. Machine labs can use a per-player flag. Admin, auth and sidebar screens pass a browser check in light, dark, collapsed and narrow states.Finish the remaining form, certificate, editor and event browser checks. Check the initial JavaScript budget. A content inventory found 29 referenced video files missing locally; the lesson HTML and interactive content remain available. Soak checks remain deferred until the end.
P5 EventsImplemented; UI checks in progressThe event backend and manual solo/team flows are implemented. The UI now has event lists, registration, event teams, challenges, live scoreboard, writeup upload and certificates. Staff screens cover event editing, challenge waves, entries, allow-list import and announcements.Finish the browser dry run and the TRIVARNA-size load check. Soak checks remain deferred until the end.
P6 Verify and hardenPendingManual checks and build checks run during implementation. No automated tests were added.Complete section 18, load checks, upgrade checks and owner approval.
P7 Migration and cutoverPlan laterNo production cutover work.Write the migration plan after system verification, as specified below.
Figure 7. Build order. Labs and UI run in parallel after the skeleton.

P0. Set up

Exit: the new layout builds and CI is green

  1. Done: move all current code to legacy/ (gitignored): backend (csemv2), frontend (csem_front), events-frontend and orchestrator. The 4 repositories become 1.
  2. Write CLAUDE.md (done, on the branch). Create the Go module, the csema database on the local MariaDB 11.8, the Makefile and CI (vet, build, size check). No test jobs (strict rule).
  3. Create the Nuxt app in web/ with the theme override.

P1. Skeleton, auth, progress

Exit: sign up, log in (password, Google, GitHub), reset password and /api/me work end to end in the new UI

  1. server, db, mail: Echo, errors, cookie sessions, rate limits, the GORM setup, the outbox, the UI embed, graceful restart.
  2. GORM models for all 23 tables.
  3. auth and progress (Record, leaderboard, stats).

P2. Learner features

Exit: a learner can follow a path, solve challenges, join a team and pay (Razorpay test mode)

  1. A one-time content import from Postgres: paths, modules, activities, challenges, plans. The UI then works with real content.
  2. learn (with the code runner for code activities), practice, teams, billing, community (forms, newsletter), each with its admin.go.

P3. Labs (parallel from P1)

Exit: the current lab catalogue runs on one new host

  1. Agent: socket API, Docker, reconcile loop. Check: start and stop 20 sessions on a local VM.
  2. Hosts: Add host over SSH, restricted user, agent upload. Check: an empty Debian 12 VM becomes ready with one click.
  3. Network: /27 networks, multi-service labs, nftables. Check: user A cannot reach user B's lab, and labs cannot reach the internet.
  4. Access: the SSH gateway (shell, -L, -D, -R, -J), wildcard HTTPS and the UI terminal. Check: each command in section 15 works, and a reverse shell reaches a laptop.
  5. Credits, deadlines, idle stop. Soak run: 40 sessions for 24 hours, with a core deploy during the run.

P4. UI (parallel from P1)

Exit: every screen in section 14 works against the Go binary

  1. App shell, then Home, Learn, Practice (with the lab panel and terminal), Compete, Profile, Billing.
  2. Admin screens for each package.
  3. Pre-render public pages. Embed the build.

P5. Events (merged into the one app)

Exit: a staff dry-run event runs from registration to certificates, solo and team

  1. events package: events, waves by release_at, allow-list import, registration, event teams with join codes, flags and hints through progress, scoreboard, the server-sent event stream, writeups.
  2. Admin screens: create and edit, attach challenges and waves, entries, teams, announcements.
  3. Player screens and the public live scoreboard.
  4. Load: one live event of TRIVARNA size (830 players, about 14k solves) on one binary. Rate limits on flag submits. The scoreboard is cached for 2 seconds.

P6. Verify and harden

Exit: every check in section 18 passes, by hand · then you approve the system

  1. Walk through every flow by hand with the checklist.
  2. Run a load tool against the busiest routes, and deploy while it runs.
  3. After your approval, and only then, we decide which automated tests to add.

P7. Data migration and cutover (planned later)

We write this plan after testing

Outline: an import tool transforms the Postgres data into the 23 tables and checks the counts. We rehearse it, then switch traffic in a short read-only window. Django stays available for a rollback period, and then legacy/ is deleted.

18. How we check success

All checks are manual until you approve the system (strict rule: no automated tests).

CheckPass condition
User flowsA walkthrough of every flow works: sign up, onboard, lesson, quiz, code, flag, hint, start lab, SSH, terminal, team, checkout (Razorpay test mode), newsletter, admin edit.
Old passwords and flagsA sample of real password hashes and flag hashes verify in Go.
Lab startsTime to running is under 5 s with cached images. No failed starts in 50 tries.
Zero downtimeA deploy during a load-tool run gives 0 failed requests. Open lab SSH sessions stay up.
Speedp95 under 50 ms for the 20 busiest routes on the real data.
SizeBinary under 50 MB. Idle memory under 50 MB.
PrivacyThe browser makes no request to any third-party host.
Simplicity23 tables, about 70 routes, under 20k lines of Go.
No hard-coded valuesA search of the Go and Vue code finds no URLs, prices, limits, lists or copy text outside config, settings and UI labels.

19. Risks

RiskMitigation
A dropped feature is still used by someone.The drop list is checked with you before P2. Data is archived, not deleted.
The new data model loses detail (for example every quiz answer).Only the score and the last submission are kept. This is a choice. The archive keeps the old rows.
A large live event overloads the one binary.Cached scoreboard, flag rate limits, server-sent events from one in-process hub. A staff dry run before the first real event. No cutover during an event.
One lab host (no HA).Accepted for now. Sessions are short and restart cleanly.
One big release is late.Freeze new features in Django. Labs and UI run in parallel.

20. Decisions

QuestionDecision
Drop list (section 5)Accepted.
ExamsSet aside for now. Data is archived.
Growth engineRemoved.
HostingDevelopment: core, MariaDB and lab host on one machine. Production: we connect a lab host by IP, the same machine or another one.
Lab host SSHThe host's SSH server and port are never changed. The player gateway uses port 2222.
Base domaincsema.tanmoysrt.xyz. Labs at *.lab.csema.tanmoysrt.xyz.
Code runnerA container on the lab host, run by the agent.
Content filesOut of the repository. Imported into the files directory. S3 later.
Legacy codeAll 4 repositories moved to legacy/ (gitignored, read-only reference). Done.

21. Appendix: raw maps

Page to API (crawl, 61 pages)

The 7 shell calls on every page are /api/branding/, /api/accounts/notifications/, /api/accounts/api_profile/, /api/track/, /api/offers/current/, /api/events/my-collaborations/ and /api/ambassador/me/. Red codes are errors.

Show the page map
PageAPI calls on load (beyond the 7 shell calls)
/dashboard/challenges/1133GET /api/coding/exercises/
GET /api/challenges/{id}/
GET /api/redteam/session/
GET /api/redteam/credits/
GET /api/redteam/machines/{id}/
GET /api/redteam/machines/
/dashboard/learning/57GET /api/accounts/onboarding/status/
GET /api/learning-paths/{id}/
/dashboard/learning/57/practicalGET /learning/api/learning/paths/{id}/practical/ 404
/dashboard/study-materialsGET /api/learning-paths/
/dashboard/study-materials/2GET /api/learning-paths/
/dashboard/examsGET /api/exam/api/exams/
GET /api/exam/api/my-history/
/dashboard/exams/historyGET /api/exam/api/my-history/
/dashboard/exams/:idGET /api/exam/api/exams/{id}/
GET /api/exam/api/check-access/
/dashboard/interviewsGET /api/interview-credits/
GET /api/interviews/
/dashboard/interviews/historyGET /api/interview-attempts/
/dashboard/interviews/:idGET /api/interview-credits/
GET /api/interviews/{id}/
/dashboard/jobsGET /api/accounts/api_weekly_progress/
GET /api/accounts/onboarding/status/
GET /api/onboarding/survey/journey/
GET /api/zero-hour/progress/
GET /api/zero-hour/campaign/
GET /api/learning-paths/
GET /api/challenges/
GET /api/events/
/dashboard/leaderboardGET /api/accounts/api_leaderboard/
/dashboard/newsGET /api/blog-posts/
/dashboard/seriesGET /api/zero-hour/progress/
GET /api/redteam/credits/
GET /api/zero-hour/campaign/
GET /api/soc/
GET /api/redteam/machines/
GET /api/challenges/
/dashboard/teams/:idGET /api/teams/{id}/
GET /api/teams/
/dashboard/profileGET /api/accounts/api_skill_radar/
GET /api/accounts/api_daily_activity/
/dashboard/achievementsGET /api/accounts/available-challenge-badges/
/dashboard/pricingGET /api/accounts/api/pricing/
/dashboard/billsGET /api/payments/history/
/dashboard/ambassadornone
/dashboard/cjwaptGET /api/waitlist/CJWAPT/
/dashboard/bug-bountyGET /api/bug-bounty/programs/
GET /api/bug-bounty/my-stats/
/dashboard/bug-bounty/timelineGET /api/bug-bounty/timeline/
/dashboard/bug-bounty/submissionsGET /api/bug-bounty/submissions/
/dashboard/bug-bounty/leaderboardGET /api/bug-bounty/leaderboard/
/dashboard/bug-bounty/prizesGET /api/bug-bounty/vulnerability-badges/
GET /api/bug-bounty/vulnerability-badges/sqli/image/
GET /api/bug-bounty/vulnerability-badges/idor/image/
GET /api/bug-bounty/vulnerability-badges/rce/image/
GET /api/bug-bounty/vulnerability-badges/xss/image/
GET /api/bug-bounty/vulnerability-badges/auth_bypass/image/
GET /api/bug-bounty/vulnerability-badges/ssrf/image/
GET /api/bug-bounty/vulnerability-badges/info_disclosure/image/
GET /api/bug-bounty/vulnerability-badges/csrf/image/
/dashboard/battlegroundGET /api/accounts/api_leaderboard/
/dashboard/practice/newGET /api/challenges/
/dashboard/machines/plansGET /api/accounts/api/pricing/
/dashboard/learning/challenges/tampered-evidenceGET /api/tampered-evidence/DF101-CTF-TAMPERED-EVIDENCE/session/ 404
POST /api/tampered-evidence/DF101-CTF-TAMPERED-EVIDENCE/session/ 404
/dashboard/profile/achievementsGET /api/accounts/available-challenge-badges/
/dashboard/academicGET /api/academic/assignments/
/dashboard/corporatenone
/dashboard/challenges/createGET /api/categories/
GET /api/redteam/credits/
GET /api/challenges/
GET /api/redteam/machines/
/GET /api/stats/
GET /api/accounts/api_weekly_progress/
GET /api/accounts/onboarding/status/
GET /api/onboarding/survey/journey/
GET /api/learning-paths/
GET /api/zero-hour/progress/
GET /api/zero-hour/campaign/
GET /api/challenges/
GET /api/events/
/pricingGET /api/stats/
GET /api/accounts/api/pricing/
/leaderboardGET /api/accounts/api_leaderboard/
/learningGET /api/learning-paths/
/challengesGET /api/zero-hour/campaign/
GET /api/challenges/
/teamsGET /api/teams/
/newsGET /api/blog-posts/
/news/:slugGET /api/blog-posts/{slug}/
GET /api/blog-feedbacks/
/csema-labsnone
/contactnone
/seasonsGET /api/zero-hour/campaign/
/welcomeGET /api/events/live-online/
GET /api/events/my-live-registration/
GET /api/accounts/onboarding/status/
GET /api/accounts/api_weekly_progress/
GET /api/onboarding/survey/journey/
GET /api/zero-hour/campaign/
GET /api/zero-hour/progress/
GET /api/learning-paths/
GET /api/challenges/
GET /api/events/
/dashboard/admin-panel/system-healthGET /api/admin-panel/system-health/
/dashboard/admin-panel/moderationGET /api/admin-panel/integrity-flags/
/dashboard/admin-panel/contact-messagesGET /api/admin-panel/contact-messages/
/dashboard/admin-panel/waitlistGET /api/admin-panel/exam-waitlist/
/dashboard/admin-panel/live-opsGET /api/admin-panel/live-events/
/dashboard/admin-panel/revenueGET /api/admin-panel/revenue-summary/
/dashboard/admin-panel/challengesGET /api/categories/
GET /api/challenges-admin/
/dashboard/admin-panel/machine-labsGET /api/redteam/admin/labs/meta/
GET /api/redteam/admin/labs/
/dashboard/admin-panel/bug-bountyGET /api/bug-bounty/admin/submissions/
/dashboard/admin-panel/toolsGET /api/jobs/
GET /api/study-materials/
GET /api/blog-posts/
GET /api/interviews/
GET /api/battleground/sessions/
GET /api/challenges/
/dashboard/learning/createGET /api/onboarding/survey/job_roles/
GET /api/exam/api/exams/
GET /api/categories/
GET /api/challenges/
GET /api/learning-paths/

Current core routes in use (208), by new package

A ✓ means that a page load in the crawl called the route.

(feature admin.go) · 15 routes
MethodCurrent routeDjango appSeen
GET/api/admin-panel/contact-messages/admin_panel✓
DELETE/api/admin-panel/contact-messages/{contact_id}/admin_panel
GET/api/admin-panel/exam-waitlist/admin_panel✓
GET/api/admin-panel/integrity-flags/admin_panel✓
POST/api/admin-panel/integrity-flags/{flag_id}/resolve/admin_panel
GET/api/admin-panel/live-events/admin_panel✓
GET/api/admin-panel/redteam/subscriptions/admin_panel
POST/api/admin-panel/redteam/subscriptions/{subscription_id}/force-expire/admin_panel
POST/api/admin-panel/redteam/subscriptions/{subscription_id}/suspend/admin_panel
POST/api/admin-panel/redteam/subscriptions/{subscription_id}/unsuspend/admin_panel
GET/api/admin-panel/revenue-summary/admin_panel✓
GET/api/admin-panel/support-messages/admin_panel
GET/api/admin-panel/system-health/admin_panel✓
GET/api/admin-panel/users/admin_panel
GET POST/api/admin-panel/users/{user_id}/moderation/admin_panel
auth · 49 routes
MethodCurrent routeDjango appSeen
GET/accounts/login/allauth✓
POST/api/accounts/api/contact/users
GET/api/accounts/api/pricing/users✓
GET/api/accounts/api_category_progress/users
GET/api/accounts/api_daily_activity/users✓
POST/api/accounts/api_delete_account/users
POST/api/accounts/api_github_auth/users
POST/api/accounts/api_google_auth/users
GET/api/accounts/api_leaderboard/users✓
POST/api/accounts/api_logout/users
GET/api/accounts/api_partner_students/users
GET PUT/api/accounts/api_profile/users✓
GET/api/accounts/api_skill_radar/users✓
GET/api/accounts/api_solved_by_category/users
POST/api/accounts/api_sso_exchange/users
POST/api/accounts/api_sso_token/users
GET/api/accounts/api_weekly_progress/users✓
POST/api/accounts/auth/login/users✓
POST/api/accounts/auth/password-reset/confirm/users
POST/api/accounts/auth/password-reset/request/users
POST/api/accounts/auth/password/users
POST/api/accounts/auth/register/users
POST/api/accounts/auth/resend-verification/users
POST/api/accounts/auth/verify-email/users
GET/api/accounts/available-challenge-badges/users✓
GET/api/accounts/dream_job_pathway/users
POST/api/accounts/initiate_subscription_payment/users
GET/api/accounts/mailing/available_users/users
POST/api/accounts/mailing/groups/users
DELETE POST PUT/api/accounts/mailing/groups/{pk}/users
POST/api/accounts/mailing/groups/{pk}/add_users/users
POST/api/accounts/mailing/groups/{pk}/remove_users/users
POST/api/accounts/mailing/send_group/users
POST/api/accounts/mailing/send_manual/users
POST/api/accounts/mailing/templates/users
DELETE POST PUT/api/accounts/mailing/templates/{pk}/users
POST/api/accounts/notifications/users✓
DELETE/api/accounts/notifications/delete-all/users
DELETE/api/accounts/notifications/delete/{notification_id}/users
POST/api/accounts/notifications/mark-all-read/users
POST/api/accounts/notifications/mark-read/{notification_id}/users
POST/api/accounts/onboarding/complete/users
GET/api/accounts/onboarding/path/users✓
POST/api/accounts/onboarding/status/users✓
GET/api/accounts/player_detailed_stats/{user_id}/users
GET/api/accounts/public_profile/{user_id}/users
GET/api/accounts/session-info/users
POST/api/accounts/verify_subscription_payment/users
POST/api/token/refresh/rest_framework_simplejwt✓
billing · 3 routes
MethodCurrent routeDjango appSeen
GET/api/offers/current/offers✓
GET/api/offers/validate-coupon/offers
GET/api/offers/{pk}/offers✓
compete · 14 routes
MethodCurrent routeDjango appSeen
GET/api/team-invites/teams
POST/api/team-invites/{pk}/accept/teams
POST/api/team-invites/{pk}/reject/teams
POST/api/teams/teams✓
GET/api/teams/{pk}/teams✓
POST/api/teams/{pk}/announcement/create/teams
POST/api/teams/{pk}/invite/teams
POST/api/teams/{pk}/join/teams
POST/api/teams/{pk}/leave/teams
POST/api/teams/{pk}/manage/teams
GET/api/teams/{pk}/members/teams
POST/api/teams/{pk}/regenerate-invite-code/teams
POST/api/teams/{pk}/request/teams
GET/api/teams/{pk}/requests/teams
events · 53 routes
MethodCurrent routeDjango appSeen
GET POST/api/events/events✓
GET/api/events/capacity-options/events
GET/api/events/library-challenges/events
GET/api/events/live-online/events✓
GET/api/events/my-collaborations/events✓
GET/api/events/my-live-registration/events✓
POST/api/events/request-event-credit/events
GET POST/api/events/{pk}/events✓
POST/api/events/{pk}/admin/challenges/{challenge_id}/force-unlock/events
GET/api/events/{pk}/all-teams/events
DELETE/api/events/{pk}/all-teams/{team_id}/events
POST/api/events/{pk}/allowed-emails/events
GET POST/api/events/{pk}/announcements/events
DELETE PATCH/api/events/{pk}/announcements/{announcement_id}/events
GET POST/api/events/{pk}/certificate-template/events
GET/api/events/{pk}/challenge-analysis/events
GET/api/events/{pk}/challenges/events
GET/api/events/{pk}/challenges/{challenge_id}/events
POST/api/events/{pk}/challenges/{challenge_id}/hints/{hint_id}/unlock/events
POST/api/events/{pk}/challenges/{challenge_id}/submit_flag/events
POST/api/events/{pk}/create_category/events
GET POST/api/events/{pk}/event-teams/events
GET/api/events/{pk}/event-teams/{team_id}/events
POST/api/events/{pk}/event-teams/{team_id}/join/events
GET POST/api/events/{pk}/event-teams/{team_id}/requests/events
GET/api/events/{pk}/flag-submission-stats/events
GET/api/events/{pk}/gallery/events
POST/api/events/{pk}/hints/create/events
GET/api/events/{pk}/leaderboard/events
GET/api/events/{pk}/my-certificate/events
GET/api/events/{pk}/my-stats/events
GET/api/events/{pk}/my-team/events
GET POST/api/events/{pk}/my-team/chat/events
POST/api/events/{pk}/my-team/kick/events
POST/api/events/{pk}/my-team/leave/events
POST/api/events/{pk}/my-team/settings/events
POST/api/events/{pk}/my-team/transfer-captain/events
POST/api/events/{pk}/purchase-challenges/events
POST/api/events/{pk}/register/events
GET/api/events/{pk}/registrations/events
POST/api/events/{pk}/send_reminder_emails/events
GET/api/events/{pk}/solves/events
POST/api/events/{pk}/support_messages/events
POST/api/events/{pk}/support_messages/{message_id}/resolve/events
GET/api/events/{pk}/unlocked-hints/events
POST/api/events/{pk}/upload-certificate-image/events
POST/api/events/{pk}/verify-challenges-purchase/events
POST/api/events/{pk}/verify-payment/events
GET POST/api/events/{pk}/warnings/events
DELETE PATCH/api/events/{pk}/warnings/{warning_id}/events
GET POST/api/events/{pk}/waves/events
DELETE PATCH/api/events/{pk}/waves/{wave_id}/events
POST/events/{event_id}/unregister/events
labs · 18 routes
MethodCurrent routeDjango appSeen
GET/api/redteam/admin/labs/redteam_labs✓
GET/api/redteam/admin/labs/meta/redteam_labs✓
GET/api/redteam/admin/labs/preview/redteam_labs
GET/api/redteam/admin/labs/snapshot/rebuild/redteam_labs
GET/api/redteam/admin/labs/{challenge_id}/redteam_labs✓
GET/api/redteam/admin/labs/{challenge_id}/test-launch/redteam_labs
GET/api/redteam/certificate/redteam_labs
GET/api/redteam/credits/redteam_labs✓
GET/api/redteam/labs/redteam_labs
GET/api/redteam/labs/{challenge_id}/redteam_labs
GET/api/redteam/labs/{challenge_id}/certificate/redteam_labs
GET POST/api/redteam/labs/{challenge_id}/start/redteam_labs
GET POST/api/redteam/labs/{challenge_id}/stop/redteam_labs
GET/api/redteam/machines/redteam_labs✓
GET/api/redteam/machines/{challenge_id}/redteam_labs✓
GET/api/redteam/session/redteam_labs✓
GET/api/redteam/session/heartbeat/redteam_labs
GET/api/redteam/subscription/status/redteam_labs
learn · 24 routes
MethodCurrent routeDjango appSeen
GET/api/coding/exercises/coding✓
GET/api/jobs/learning✓
DELETE GET/api/jobs/{pk}/learning
GET/api/learning-paths/learning✓
GET/api/learning-paths/next_drop/learning
POST/api/learning-paths/scbtp-pathway/learning
GET POST/api/learning-paths/{pk}/learning✓
GET/api/quizzes/{pk}/learning
POST/api/quizzes/{pk}/check_mcq/learning
POST/api/quizzes/{pk}/check_saq/learning
POST/api/quizzes/{pk}/submit/learning
GET POST/api/shell-labs/modules/{module_id}/shell_labs
PUT/api/shell-labs/modules/{module_id}/file/shell_labs
POST/api/shell-labs/tasks/{task_id}/check/shell_labs
POST/api/shell-labs/tasks/{task_id}/solution/shell_labs
GET/api/study-materials/learning✓
DELETE GET/api/study-materials/{pk}/learning
POST/learning/api/learning/gns3/session/learning
POST/learning/api/learning/modules/{module_id}/complete_progress/learning
POST/learning/api/learning/modules/{module_id}/gns3-flag/learning
GET/learning/api/learning/paths/{path_id}/practical/learning✓
POST/learning/api/learning/paths/{path_id}/practical/{challenge_id}/learning
POST/learning/api/learning/paths/{path_id}/practical/{challenge_id}/submit/learning
POST/learning/modules/{module_id}/verify-lab-completion/learning
practice · 17 routes
MethodCurrent routeDjango appSeen
GET/api/categories/challenges✓
GET POST/api/challenges-admin/challenges✓
DELETE PATCH/api/challenges-admin/{pk}/challenges
GET/api/challenges/challenges✓
GET/api/challenges/next_drop/challenges
GET/api/challenges/trivarna/challenges
POST/api/challenges/trivarna/redeem/challenges
GET/api/challenges/trivarna/writeup/challenges
GET/api/challenges/{pk}/challenges✓
POST/api/challenges/{pk}/hints/{hint_id}/unlock/challenges
GET/api/challenges/{pk}/rewards/challenges
GET POST/api/challenges/{pk}/submit_flag/challenges
GET POST/api/challenges/{pk}/submit_machine_flag/challenges
GET/api/series/challenges
GET/api/series/{pk}/challenges
GET/api/stats/challenges✓
GET/api/tags/challenges
community + onboarding (auth) · 15 routes
MethodCurrent routeDjango appSeen
GET/api/ambassador/ambassador
POST/api/ambassador/claim_referral/ambassador
GET POST/api/ambassador/me/ambassador✓
GET/api/ambassador/referrals/ambassador
GET POST/api/ambassador/{id}/ambassador✓
GET/api/onboarding/survey/admin_skill_analytics/onboarding
GET/api/onboarding/survey/job_roles/onboarding✓
GET/api/onboarding/survey/journey/onboarding✓
GET/api/onboarding/survey/pathway/onboarding
GET/api/onboarding/survey/report/onboarding
POST/api/onboarding/survey/skip/onboarding
POST/api/onboarding/survey/submit/onboarding
GET POST/api/onboarding/survey/{pk}/onboarding✓
DELETE POST/api/waitlist/{code}/exam_waitlist✓
POST/api/waitlist/{code}/public/exam_waitlist