Skip to content

Commit 5853bc3

Browse files
authored
Add admin panel and user roles (#189)
1 parent 16bcce1 commit 5853bc3

File tree

80 files changed

+13469
-599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+13469
-599
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,21 @@ claper-*.tar
3030
# Ignore digested assets cache.
3131
/priv/static/cache_manifest.json
3232

33+
# Env files except sample
34+
.env*
35+
!.env.sample
36+
3337
# In case you use Node.js/npm, you want to ignore these.
3438
npm-debug.log
3539
/assets/node_modules/
3640

3741
priv/static/images/.DS_Store
3842
priv/static/.DS_Store
39-
.env
4043
priv/static/fonts/.DS_Store
4144
test/e2e/node_modules
4245
.DS_Store
4346
priv/static/.well-known/apple-developer-merchantid-domain-association
4447
priv/static/loaderio-eb3b956a176cdd4f54eb8570ce8bbb06.txt
4548
.elixir_ls
49+
50+
tailwind.config.js

CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
### Features
44

5+
- Add Admin Panel to manage users and presentations
6+
- Add user roles: user, admin
57
- Add `LANGUAGES` setting to configure available languages in the app
6-
- Add Latvian language support (@possible-im)
7-
- Add Hungarian language support (@bpisch)
8+
- Add hideable presenter attendee count (#183 #155)
9+
- Add Hungarian translation (#161)
10+
- Add Latvian translation (#163)
811

912
### Fixes and improvements
1013

@@ -15,7 +18,10 @@
1518
- Fix event name validation to be required
1619
- Docker image is now using Ubuntu instead of Alpine for better dependencies support
1720
- Fix scrollbar not showing in event manager when no presentation file (#164) (@aryel780)
18-
- Fix settings scroll for small screen (#168) (@ChayanDass)
21+
- Fix settings scroll for small screen (#168)
22+
- Fix duplicate key quiz when duplicate (#182)
23+
- Fix email change confirmation (#172)
24+
- Fix italian translation (#179)
1925

2026
### v.2.3.2
2127

CLAUDE.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Common Development Commands
6+
7+
### Setup and Dependencies
8+
```bash
9+
# Install dependencies
10+
mix deps.get
11+
mix setup # Runs deps.get + ecto.setup
12+
13+
# Setup database
14+
mix ecto.setup # Creates DB, runs migrations, seeds
15+
mix ecto.reset # Drops DB and runs ecto.setup
16+
17+
# Install frontend dependencies
18+
cd assets && npm install && cd ..
19+
```
20+
21+
### Running the Application
22+
```bash
23+
# Start Phoenix server
24+
mix phx.server
25+
26+
# Or inside IEx
27+
iex -S mix phx.server
28+
```
29+
30+
### Testing
31+
```bash
32+
# Run tests
33+
mix test
34+
35+
# Run specific test file
36+
mix test test/path/to/test_file.exs
37+
38+
# Run test with specific line number
39+
mix test test/path/to/test_file.exs:42
40+
```
41+
42+
### Code Quality
43+
```bash
44+
# Format code
45+
mix format
46+
47+
# Run Credo for code analysis
48+
mix credo
49+
```
50+
51+
### Building Assets
52+
```bash
53+
# For production deployment
54+
mix assets.deploy
55+
```
56+
57+
## High-Level Architecture
58+
59+
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.
60+
61+
### Core Components
62+
63+
1. **Phoenix LiveView Architecture**
64+
- Real-time updates without JavaScript through WebSocket connections
65+
- LiveView modules in `lib/claper_web/live/` handle interactive UI
66+
- Presence tracking for real-time user counts
67+
68+
2. **Main Domain Contexts** (in `lib/claper/`)
69+
- `Accounts` - User management, authentication, OIDC integration
70+
- `Events` - Core presentation/event management
71+
- `Posts` - Audience messages and reactions
72+
- `Polls` - Interactive polls with real-time voting
73+
- `Forms` - Custom forms for audience feedback
74+
- `Quizzes` - Quiz functionality with LTI support
75+
- `Presentations` - Slide management and state tracking
76+
- `Embeds` - External content embedding
77+
78+
3. **Authentication & Authorization**
79+
- Multiple auth methods: email/password, OIDC
80+
- Role-based access control with admin panel
81+
- LTI 1.3 support for educational platforms
82+
83+
4. **Real-time Features**
84+
- Phoenix PubSub for broadcasting updates
85+
- Phoenix Presence for tracking online users
86+
- LiveView for reactive UI without custom JavaScript
87+
88+
5. **Background Jobs**
89+
- Oban for background job processing
90+
- Email sending
91+
92+
6. **Frontend Stack**
93+
- Tailwind CSS for styling (with DaisyUI components)
94+
- Alpine.js for minimal JavaScript interactions
95+
- esbuild for JavaScript bundling
96+
- Separate admin and user interfaces
97+
98+
7. **Key LiveView Modules**
99+
- `EventLive.Show` - Attendee view
100+
- `EventLive.Presenter` - Presenter control view
101+
- `EventLive.Manage` - Event management interface
102+
- `AdminLive.*` - Admin panel components
103+
104+
8. **Database Structure**
105+
- PostgreSQL with Ecto
106+
- Key models: User, Event, Post, Poll, Quiz, PresentationState
107+
- Soft deletes for users
108+
- UUID-based public identifiers
109+
110+
9. **LTI Integration**
111+
- LTI 1.3 support for quizzes, publish score to LMS
112+
- LTI launch handling in `LtiController`

assets/css/admin.css

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
@import "tailwindcss";
2+
@plugin "daisyui";
3+
4+
@utility btn {
5+
@apply rounded-full !font-display text-small-body;
6+
}
7+
8+
@utility input {
9+
@apply rounded-full focus:outline-none focus-within:outline-none focus:border-2 focus-within:border-2 !font-display text-small-body transition-all;
10+
}
11+
12+
@utility select {
13+
@apply rounded-full focus:outline-none focus-within:outline-none focus:border-2 focus-within:border-2 !font-display text-small-body transition-all;
14+
}
15+
16+
@utility label {
17+
@apply ml-2;
18+
}
19+
20+
@utility fieldset-legend {
21+
@apply ml-3;
22+
}
23+
24+
@plugin "daisyui/theme" {
25+
name: "claper";
26+
default: true; /* set as default */
27+
prefersdark: false; /* set as default dark mode (prefers-color-scheme:dark) */
28+
color-scheme: light; /* color of browser-provided UI */
29+
30+
--color-primary: #140753;
31+
--color-primary-content: #ffffff;
32+
--color-secondary: #f4f4f4;
33+
--color-secondary-content: #140553;
34+
--color-accent: #8611ed;
35+
--color-accent-content: #ffffff;
36+
--color-neutral: #000000;
37+
--color-neutral-content: #ffffff;
38+
--color-info: #79bfe2;
39+
--color-info-content: #0e3649;
40+
--color-success: #3cb957;
41+
--color-success-content: #143e1d;
42+
--color-warning: #ffb62e;
43+
--color-warning-content: #523500;
44+
--color-error: #e7000b;
45+
--color-error-content: #fff;
46+
/* border radius */
47+
--radius-selector: 1rem;
48+
--radius-field: 0.25rem;
49+
--radius-box: 0.5rem;
50+
51+
/* base sizes */
52+
--size-selector: 0.25rem;
53+
--size-field: 0.25rem;
54+
55+
/* border size */
56+
--border: 1px;
57+
58+
/* effects */
59+
--depth: 1;
60+
--noise: 0;
61+
}
62+
63+
@import "./modern.css" layer(theme);

assets/css/app.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@import 'animate.css/animate.min.css';
33

44
@import 'tailwindcss';
5-
@import './theme.css';
5+
@import './theme.css' layer(theme);
66

77
@layer base {
88
*,
@@ -302,6 +302,20 @@
302302
url('/fonts/Roboto/roboto-v29-latin-900italic.svg#Roboto') format('svg'); /* Legacy iOS */
303303
}
304304

305+
@font-face {
306+
font-family: 'Montserrat';
307+
font-style: normal;
308+
font-weight: 100 300 400 500 700 900;
309+
src: url('/fonts/Montserrat/Montserrat-VariableFont_wght.ttf');
310+
}
311+
312+
@font-face {
313+
font-family: 'Montserrat';
314+
font-style: italic;
315+
font-weight: 100 300 400 500 700 900;
316+
src: url('/fonts/Montserrat/Montserrat-Italic-VariableFont_wght.ttf');
317+
}
318+
305319
.bg-gradient-animate {
306320
background: linear-gradient(-45deg, var(--color-secondary-500), var(--color-secondary-600), var(--color-primary-400), var(--color-primary-400));
307321
background-size: 400% 400%;

0 commit comments

Comments
 (0)