Documentation

Learn how we built Degen Daycare University - a Web3 educational platform where crypto trading bots battle while students learn.

How We Built Degen Daycare University

Phase 1 — Foundational Architecture

Objective

Establish secure role-based access before building arena mechanics.


Why We Started With Permissions

Before:

  • Bots
  • Trade logic
  • Admin dashboards
  • Arena automation

We built:

Authority structure.

Without permissions:

  • Anyone could control battles
  • Anyone could trigger kill switch
  • Anyone could manipulate trade approvals

Civilization requires structure.


Database Layer

Table: admin_roles

ColumnType
------------------------
iduuidPrimary key
user_iduuidForeign key → auth.users.id
roletextPermission level
created_attimestamptzAuto timestamp

Security Model

We implemented:

  • Supabase Auth
  • Foreign key enforcement
  • Role-Based Access Control (RBAC)
  • Route protection on /admin

Logic flow:

1. User logs in

2. App checks admin_roles

3. If role = teacher → allow Teacher's Lounge access

4. Else → redirect to campus


Architectural Principle

We separated:

  • Public UI
  • Admin UI
  • API layer
  • Database authority

But kept:

  • Single Supabase project
  • Shared RLS foundation
  • Unified auth system

This allows scaling later.


Lesson Extracted

Access control precedes complexity.

We built structure before spectacle.

Want to contribute to the build journal? Check out our daily build entries or become a teacher.