This document breaks down the development work required to build the education fork of Civic Engine. Tasks are organized by priority and dependency.
Existing codebase provides:
- Policy data and scoring models (v1, v2, v3)
- UI components for policy display
- Share card generation (Remotion)
- Basic Next.js app structure
New features required:
- User authentication (teacher/student roles)
- Cohort (class) management
- Discussion system
- Position capture with reasoning
- Analytics dashboard
- Cross-cohort patterns
These are blockers for everything else.
Goal: Teachers and students can create accounts and log in.
| Task | Description | Complexity |
|---|---|---|
| Set up auth provider | NextAuth.js or Clerk for authentication | Medium |
| Teacher registration | Email, school, state, subjects, grade levels | Medium |
| Email verification | Verify teacher emails (prefer .edu domains) | Low |
| Student join flow | Join via class code, create display name + password | Medium |
| Role-based access | Distinguish teacher vs student permissions | Medium |
| Session management | Persistent sessions, logout, password reset | Low |
Database schema:
users
- id
- email
- password_hash
- role (teacher | student)
- display_name
- created_at
teacher_profiles
- user_id (FK)
- school_name
- state
- subjects (array)
- grade_levels (array)
student_profiles
- user_id (FK)
- cohort_id (FK)
- joined_at
Goal: Teachers can create classes, students can join them.
| Task | Description | Complexity |
|---|---|---|
| Create cohort | Teacher creates class with name, grade level, size | Low |
| Generate join code | Unique, readable code (ABC-1234 format) | Low |
| Join cohort | Student enters code, joins class | Low |
| Cohort dashboard | Teacher sees list of their classes | Medium |
| Student list | Teacher sees who has joined (names only) | Low |
| Leave/remove | Student can leave, teacher can remove | Low |
Database schema:
cohorts
- id
- teacher_id (FK)
- name
- grade_level
- join_code (unique)
- created_at
- status (active | archived)
cohort_memberships
- cohort_id (FK)
- student_id (FK)
- joined_at
- status (active | removed)
Goal: Teachers can select which policies their class will discuss.
| Task | Description | Complexity |
|---|---|---|
| Policy set presets | Pre-built sets (Starter, Healthcare, Economic, etc.) | Medium |
| Browse policy library | View all available policies with filters | Medium |
| Custom policy selection | Teacher picks specific policies for their class | Medium |
| Save policy set to cohort | Associate selected policies with a class | Low |
| Custom policy creation | Teacher can add local/state-specific policies | High |
Database schema:
policy_sets
- id
- name
- description
- is_preset (boolean)
- created_by (teacher_id, null for presets)
policy_set_items
- policy_set_id (FK)
- policy_id
- order
cohort_policy_sets
- cohort_id (FK)
- policy_set_id (FK)
- activated_at
Goal: Policy pages support multiple reading levels and deeper exploration.
| Task | Description | Complexity |
|---|---|---|
| Reading level variants | Add simplified/advanced versions of policy summaries | High (content work) |
| Reading level selector | UI to switch between levels | Low |
| "Dig deeper" sections | Expandable sections with more detail | Medium |
| Source citations | Link to polling data, research sources | Medium |
| Discussion prompts | Add 2-3 prompts per policy | Medium (content work) |
Data structure update (per policy):
interface PolicyContent {
summary: {
simplified: string;
standard: string;
advanced: string;
};
supporters: string[];
opponents: string[];
tradeoffs: {
benefits: string[];
concerns: string[];
};
sources: { label: string; url: string }[];
discussionPrompts: string[];
digDeeper: { title: string; content: string }[];
}Goal: Track which policies students have explored.
| Task | Description | Complexity |
|---|---|---|
| Exploration progress | Track which policies student has viewed | Low |
| Mark as complete | Student marks policy as "read" | Low |
| Progress bar | Visual progress through policy set | Low |
| Unlock gating | Require X policies read before position submission | Low |
Database schema:
policy_explorations
- student_id (FK)
- cohort_id (FK)
- policy_id
- started_at
- completed_at
- reading_level_used
Goal: Students submit positions with reasoning.
| Task | Description | Complexity |
|---|---|---|
| Position form | Select stance + required reasoning text | Medium |
| Steelman requirement | Required field for opposing argument | Medium |
| Save position | Store position per student per policy per cohort | Low |
| Position validation | Enforce minimum reasoning length | Low |
| View own positions | Student can see their submitted positions | Low |
Database schema:
positions
- id
- student_id (FK)
- cohort_id (FK)
- policy_id
- stance (strongly_support | somewhat_support | neutral | somewhat_oppose | strongly_oppose)
- reasoning (text)
- steelman (text)
- created_at
- is_revision (boolean)
- original_position_id (FK, nullable)
Goal: Students can discuss policies in threaded conversations.
| Task | Description | Complexity |
|---|---|---|
| Discussion threads | Threaded comments per policy per cohort | High |
| Post comment | Student posts comment with optional reply-to | Medium |
| View thread | Display threaded discussion with nesting | Medium |
| Show positions with posts | Display student's stance alongside their posts | Low |
| Moderation flags | Allow flagging inappropriate content | Medium |
| Real-time updates | WebSocket or polling for new comments | High |
Database schema:
discussion_posts
- id
- cohort_id (FK)
- policy_id
- author_id (FK)
- parent_id (FK, nullable for replies)
- content (text)
- created_at
- edited_at
- is_flagged (boolean)
Goal: Students can revise positions after discussion.
| Task | Description | Complexity |
|---|---|---|
| Revision phase | Separate phase after discussion | Low |
| Show original position | Display what student originally said | Low |
| Revision form | Change stance + explain what changed | Medium |
| Track changes | Store revision linked to original | Low |
| Revision summary | "You revised 2 of 8 positions" | Low |
Goal: Students complete final reflection and see results.
| Task | Description | Complexity |
|---|---|---|
| Top 3 selection | Drag-and-rank top priorities | Medium |
| Reflection prompts | Text responses on what they learned | Low |
| Completion state | Mark student as "completed" for cohort | Low |
| View completion status | Teacher sees who has completed | Low |
Database schema:
reflections
- id
- student_id (FK)
- cohort_id (FK)
- top_priorities (array of policy_ids, ordered)
- priority_reasoning (text)
- learning_reflection (text)
- discussion_reflection (text)
- completed_at
Goal: Show aggregate class data without revealing individuals.
| Task | Description | Complexity |
|---|---|---|
| Class stance distribution | % support/neutral/oppose per policy | Medium |
| Class top priorities | Aggregate ranking from reflections | Medium |
| Position change stats | How many students revised positions | Low |
| Hide until threshold | Don't show aggregates until N students submit | Low |
Goal: Teachers see participation and discussion quality.
| Task | Description | Complexity |
|---|---|---|
| Participation overview | X of Y students active, completed | Low |
| Discussion metrics | Post count, avg length, reply depth | Medium |
| Position revision rate | % of students who changed positions | Low |
| Engagement timeline | Activity over time | Medium |
| Export report | Download analytics as PDF/CSV | Medium |
Goal: Compare class to similar classes (opt-in).
| Task | Description | Complexity |
|---|---|---|
| Cohort opt-in | Teacher chooses to share aggregate data | Low |
| Similarity matching | Match by state, grade level | Medium |
| Pattern display | "Your class vs similar classes" | Medium |
Goal: Generate shareable summary of student's positions.
| Task | Description | Complexity |
|---|---|---|
| Profile summary view | Top priorities, stats, quote | Medium |
| Share card generation | Use existing Remotion setup | Medium |
| Download image | Export as PNG | Low |
| Social share buttons | Share to Instagram, X, etc. | Low |
Goal: Generate shareable class summary.
| Task | Description | Complexity |
|---|---|---|
| Class results view | Aggregate priorities, discussion stats | Medium |
| Class share card | Remotion template for class results | Medium |
| Teacher share controls | Teacher approves before sharing | Low |
Goal: Provide teachers with discussion guides.
| Task | Description | Complexity |
|---|---|---|
| Guide content | Write facilitation guides per policy | High (content work) |
| Guide viewer | Display guides in teacher dashboard | Low |
| Discussion protocols | Generic protocols (Socratic seminar, etc.) | Medium (content work) |
| Standards alignment | Map to C3 Framework | Medium (content work) |
Goal: Teachers control deliberation phases.
| Task | Description | Complexity |
|---|---|---|
| Phase configuration | Set which phases to include | Medium |
| Phase scheduling | Start/end dates per phase | Medium |
| Manual phase advance | Teacher can advance phase early | Low |
| Phase notifications | Notify students of phase changes | Medium |
| Task | Description | Complexity |
|---|---|---|
| Email notifications | New discussion posts, phase changes | Medium |
| In-app notifications | Notification bell with unread count | Medium |
| Teacher reminders | "3 students haven't participated" | Medium |
| Task | Description | Complexity |
|---|---|---|
| Responsive layouts | All views work on mobile | Medium |
| Touch-friendly | Drag-and-drop alternatives for mobile | Medium |
| Task | Description | Complexity |
|---|---|---|
| Screen reader support | Proper ARIA labels | Medium |
| Keyboard navigation | Full keyboard accessibility | Medium |
| Color contrast | WCAG compliance | Low |
- Auth system (teacher + student)
- Cohort management (create, join)
- Policy selection (use existing policy data, simple selection)
- Position capture (stance + reasoning + steelman)
- Basic discussion (threaded comments)
- Class aggregate view (stance distribution)
- Student profile (basic version)
- Reading level variants
- Position revision flow
- Final reflection
- Teacher analytics
- Share card generation
- Facilitation guides
- Phase management
- Cross-cohort patterns
| Decision | Options | Recommendation |
|---|---|---|
| Auth provider | NextAuth.js, Clerk, Auth0 | Clerk (fastest to implement, good DX) |
| Database | Postgres, PlanetScale, Supabase | Supabase (auth + DB + realtime) |
| Real-time discussions | WebSocket, Supabase Realtime, polling | Supabase Realtime (if using Supabase) |
| State management | React Context, Zustand, Redux | Zustand (lightweight, sufficient) |
| Form handling | React Hook Form, Formik | React Hook Form (lighter) |
| Phase | Effort |
|---|---|
| Phase 1: Foundation | 2-3 weeks |
| Phase 2: Policy Configuration | 1-2 weeks |
| Phase 3: Student Flow | 3-4 weeks |
| Phase 4: Analytics | 1-2 weeks |
| Phase 5: Sharing | 1 week |
| Phase 6: Teacher Resources | 1-2 weeks (mostly content) |
| Phase 7: Polish | 1-2 weeks |
MVP estimate: 6-8 weeks of focused development
civic-engine-app/
├── app/
│ ├── (auth)/
│ │ ├── login/
│ │ ├── register/
│ │ └── join/[code]/
│ ├── (teacher)/
│ │ ├── dashboard/
│ │ ├── class/[id]/
│ │ │ ├── overview/
│ │ │ ├── policies/
│ │ │ ├── discussion/
│ │ │ ├── analytics/
│ │ │ └── settings/
│ │ └── resources/
│ ├── (student)/
│ │ ├── home/
│ │ ├── explore/[policyId]/
│ │ ├── positions/
│ │ ├── discussion/
│ │ ├── reflect/
│ │ └── profile/
│ └── api/
│ ├── auth/
│ ├── cohorts/
│ ├── positions/
│ ├── discussions/
│ └── analytics/
├── components/
│ ├── auth/
│ ├── cohort/
│ ├── policy/
│ ├── discussion/
│ ├── position/
│ └── analytics/
├── lib/
│ ├── auth.ts
│ ├── db.ts
│ └── supabase.ts
├── types/
│ ├── user.ts
│ ├── cohort.ts
│ ├── position.ts
│ └── discussion.ts
└── data/
├── policies/
├── methodologies/
└── facilitation-guides/
- Decide on tech stack (auth provider, database)
- Set up database schema (migrations)
- Build auth flow (teacher registration, student join)
- Build cohort management (create class, join code)
- Connect existing policy data to new structure
- Build position capture flow
- Build basic discussion
- Pilot with 1-2 teachers