mirror of
https://github.com/ClaperCo/Claper.git
synced 2025-12-14 19:07:52 +01:00
3.0 KiB
3.0 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Common Development Commands
Setup and Dependencies
# Install dependencies
mix deps.get
mix setup # Runs deps.get + ecto.setup
# Setup database
mix ecto.setup # Creates DB, runs migrations, seeds
mix ecto.reset # Drops DB and runs ecto.setup
# Install frontend dependencies
cd assets && npm install && cd ..
Running the Application
# Start Phoenix server
mix phx.server
# Or inside IEx
iex -S mix phx.server
Testing
# Run tests
mix test
# Run specific test file
mix test test/path/to/test_file.exs
# Run test with specific line number
mix test test/path/to/test_file.exs:42
Code Quality
# Format code
mix format
# Run Credo for code analysis
mix credo
Building Assets
# For production deployment
mix assets.deploy
High-Level Architecture
Claper is an interactive presentation platform built with Phoenix Framework and Elixir. It enables real-time audience interaction during presentations through polls, forms, messages, and quizzes.
Core Components
-
Phoenix LiveView Architecture
- Real-time updates without JavaScript through WebSocket connections
- LiveView modules in
lib/claper_web/live/handle interactive UI - Presence tracking for real-time user counts
-
Main Domain Contexts (in
lib/claper/)Accounts- User management, authentication, OIDC integrationEvents- Core presentation/event managementPosts- Audience messages and reactionsPolls- Interactive polls with real-time votingForms- Custom forms for audience feedbackQuizzes- Quiz functionality with LTI supportPresentations- Slide management and state trackingEmbeds- External content embedding
-
Authentication & Authorization
- Multiple auth methods: email/password, OIDC
- Role-based access control with admin panel
- LTI 1.3 support for educational platforms
-
Real-time Features
- Phoenix PubSub for broadcasting updates
- Phoenix Presence for tracking online users
- LiveView for reactive UI without custom JavaScript
-
Background Jobs
- Oban for background job processing
- Email sending
-
Frontend Stack
- Tailwind CSS for styling (with DaisyUI components)
- Alpine.js for minimal JavaScript interactions
- esbuild for JavaScript bundling
- Separate admin and user interfaces
-
Key LiveView Modules
EventLive.Show- Attendee viewEventLive.Presenter- Presenter control viewEventLive.Manage- Event management interfaceAdminLive.*- Admin panel components
-
Database Structure
- PostgreSQL with Ecto
- Key models: User, Event, Post, Poll, Quiz, PresentationState
- Soft deletes for users
- UUID-based public identifiers
-
LTI Integration
- LTI 1.3 support for quizzes, publish score to LMS
- LTI launch handling in
LtiController