Skip to content

Commit 5bd4793

Browse files
committed
Version 2.4.0
## ⚠️ Breaking changes - S3 variables are now named: S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_REGION and S3_BUCKET - Users now have roles. Refer to the `roles` table and assign a role to a user with the `role_id` column in the `users` table. ## Features - Add Admin Panel to manage users and presentations - Add user roles: user, admin - Add `LANGUAGES` setting to configure available languages in the app - Add hideable presenter attendee count (#183 #155) - Add Hungarian translation (#161) - Add Latvian translation (#163) - Add custom S3 endpoint with `S3_SCHEME`, `S3_HOST`, `S3_PORT` and `S3_PUBLIC_URL` ## Fixes and improvements - Upgrade JS dependencies - Upgrade Elixir dependencies, including Phoenix Live View to 1.0.17 - Upgrade to Tailwind 4+ - Refactor view templates to use {} instead of <%= %> - Fix event name validation to be required - Docker image is now using Ubuntu instead of Alpine for better dependencies support - Fix scrollbar not showing in event manager when no presentation file (#164) (@aryel780) - Fix settings scroll for small screen (#168) - Fix duplicate key quiz when duplicate (#182) - Fix email change confirmation (#172) - Fix italian translation (#179) - Fix random poll choices (#184)
1 parent cf7eb77 commit 5bd4793

File tree

174 files changed

+23498
-4892
lines changed

Some content is hidden

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

174 files changed

+23498
-4892
lines changed

.env.sample

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ BASE_URL=http://localhost:4000
33
# SECURE_COOKIE=false
44

55
DATABASE_URL=postgres://claper:claper@db:5432/claper
6-
SECRET_KEY_BASE=0LZiQBLw4WvqPlz4cz8RsHJlxNiSqM9B48y4ChyJ5v1oA0L/TPIqRjQNdPZN3iEG # Generate with `mix phx.gen.secret`
6+
SECRET_KEY_BASE=0LZiQBLw4WvqPlz4cz8RsHJlxNiSqM9B48y4ChyJ5v1oA0L/TPIqRjQNdPZN3iEG # Generate with `mix phx.gen.secret`
77
# ⚠️ Don't use this exact value for SECRET_KEY_BASE or someone would be able to sign a cookie with user_id=1 and log in as the admin!
88

99
# Storage configuration
@@ -12,10 +12,19 @@ PRESENTATION_STORAGE=local
1212
PRESENTATION_STORAGE_DIR=/app/uploads
1313
#MAX_FILE_SIZE_MB=15
1414

15-
#AWS_ACCESS_KEY_ID=xxx
16-
#AWS_SECRET_ACCESS_KEY=xxx
17-
#AWS_REGION=eu-west-3
18-
#AWS_PRES_BUCKET=xxx
15+
# The standard AWS environment variables
16+
#S3_ACCESS_KEY_ID=xxx
17+
#S3_SECRET_ACCESS_KEY=xxx
18+
#S3_REGION=eu-west-3
19+
#S3_BUCKET=xxx
20+
21+
# If you're using an alternative S3-compatible service, port optional
22+
#S3_SCHEME=https://
23+
#S3_HOST=www.example.com
24+
#S3_PORT=443
25+
26+
# If the public S3-compatible URL is different from the one used to write data
27+
#S3_PUBLIC_URL=https://www.example.com
1928

2029
# Mail configuration
2130

@@ -39,6 +48,7 @@ MAIL_FROM_NAME=Claper
3948
#ALLOW_UNLINK_EXTERNAL_PROVIDER=false
4049
#LOGOUT_REDIRECT_URL=https://google.com
4150
#GS_JPG_RESOLUTION=300x300
51+
#LANGUAGES=en,fr,es,it,nl,de
4252

4353
# OIDC configuration
4454

@@ -49,4 +59,4 @@ MAIL_FROM_NAME=Claper
4959
# OIDC_SCOPES="openid email profile"
5060
# OIDC_LOGO_URL=""
5161
# OIDC_PROPERTY_MAPPINGS="roles:custom_attributes.roles,organization:custom_attributes.organization"
52-
# OIDC_AUTO_REDIRECT_LOGIN=true
62+
# OIDC_AUTO_REDIRECT_LOGIN=true

.github/workflows/elixir.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242
- name: Set up Elixir
4343
uses: erlef/setup-beam@v1
4444
with:
45-
elixir-version: '1.16.2'
46-
otp-version: '26'
45+
elixir-version: '1.18.4'
46+
otp-version: '28'
4747
- name: Restore dependencies cache
4848
uses: actions/cache@v3
4949
with:

.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: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
### v.2.4.0
2+
3+
### ⚠️ Breaking changes
4+
5+
- S3 variables are now named: S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_REGION and S3_BUCKET
6+
- Users now have roles. Refer to the `roles` table and assign a role to a user with the `role_id` column in the `users` table.
7+
8+
### Features
9+
10+
- Add Admin Panel to manage users and presentations
11+
- Add user roles: user, admin
12+
- Add `LANGUAGES` setting to configure available languages in the app
13+
- Add hideable presenter attendee count (#183 #155)
14+
- Add Hungarian translation (#161)
15+
- Add Latvian translation (#163)
16+
- Add custom S3 endpoint with `S3_SCHEME`, `S3_HOST`, `S3_PORT` and `S3_PUBLIC_URL`
17+
18+
### Fixes and improvements
19+
20+
- Upgrade JS dependencies
21+
- Upgrade Elixir dependencies, including Phoenix Live View to 1.0.17
22+
- Upgrade to Tailwind 4+
23+
- Refactor view templates to use {} instead of <%= %>
24+
- Fix event name validation to be required
25+
- Docker image is now using Ubuntu instead of Alpine for better dependencies support
26+
- Fix scrollbar not showing in event manager when no presentation file (#164) (@aryel780)
27+
- Fix settings scroll for small screen (#168)
28+
- Fix duplicate key quiz when duplicate (#182)
29+
- Fix email change confirmation (#172)
30+
- Fix italian translation (#179)
31+
- Fix random poll choices (#184)
32+
133
### v.2.3.2
234

335
### Fixes and improvements

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`

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

Dockerfile

Lines changed: 34 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,29 @@
1-
# Find eligible builder and runner images on Docker Hub. We use Ubuntu/Debian instead of
2-
# Alpine to avoid DNS resolution issues in production.
3-
#
4-
# https://hub.docker.com/r/hexpm/elixir/tags?page=1&name=ubuntu
5-
# https://hub.docker.com/_/ubuntu?tab=tags
6-
#
7-
#
8-
# This file is based on these images:
9-
#
10-
# - https://hub.docker.com/r/hexpm/elixir/tags - for the build image
11-
# - https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye-20210902-slim - for the release image
12-
# - https://pkgs.org/ - resource for finding needed packages
13-
# - Ex: hexpm/elixir:1.13.2-erlang-24.2.1-debian-bullseye-20210902-slim
14-
#
15-
ARG BUILDER_IMAGE="hexpm/elixir:1.16.0-erlang-26.2.1-alpine-3.18.4"
16-
ARG RUNNER_IMAGE="alpine:3.18.4"
1+
ARG BUILDER_IMAGE="hexpm/elixir:1.18.4-erlang-28.0.1-ubuntu-noble-20250619"
2+
ARG RUNNER_IMAGE="ubuntu:24.04"
173

184
FROM ${BUILDER_IMAGE} as builder
195

20-
# install build dependencies
21-
# RUN apt-get update -y && apt-get install -y curl build-essential git \
22-
# && apt-get clean && rm -f /var/lib/apt/lists/*_*
23-
RUN apk add --no-cache -U build-base git curl bash ca-certificates nodejs npm openssl ncurses
24-
25-
ENV NODE_VERSION 16.20.0
6+
RUN apt-get update && apt-get install -y \
7+
build-essential \
8+
git \
9+
curl \
10+
bash \
11+
ca-certificates \
12+
nodejs \
13+
npm \
14+
openssl \
15+
libncurses5-dev \
16+
&& apt-get clean \
17+
&& rm -rf /var/lib/apt/lists/*
18+
19+
ENV NODE_VERSION 22.17.0
2620
ENV PRESENTATION_STORAGE_DIR /app/uploads
2721

2822
# custom ERL_FLAGS are passed for (public) multi-platform builds
2923
# to fix qemu segfault, more info: https://github.com/erlang/otp/pull/6340
3024
ARG ERL_FLAGS
3125
ENV ERL_FLAGS=$ERL_FLAGS
3226

33-
# Install nvm with node and npm
34-
# RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
35-
# && . $HOME/.nvm/nvm.sh \
36-
# && nvm install $NODE_VERSION \
37-
# && nvm alias default $NODE_VERSION \
38-
# && nvm use default
39-
40-
# ENV NODE_PATH $HOME/.nvm/versions/node/v$NODE_VERSION/lib/node_modules
41-
# ENV PATH $HOME/.nvm/versions/node/v$NODE_VERSION/bin:$PATH
42-
43-
# RUN ln -sf $HOME/.nvm/versions/node/v$NODE_VERSION/bin/npm /usr/bin/npm
44-
# RUN ln -sf $HOME/.nvm/versions/node/v$NODE_VERSION/bin/node /usr/bin/node
45-
4627
# prepare build dir
4728
WORKDIR /app
4829

@@ -66,25 +47,14 @@ RUN mix deps.compile
6647

6748
COPY priv priv
6849

69-
# note: if your project uses a tool like https://purgecss.com/,
70-
# which customizes asset compilation based on what it finds in
71-
# your Elixir templates, you will need to move the asset compilation
72-
# step down so that `lib` is available.
7350
COPY assets assets
7451

75-
# Compile the release
7652
COPY lib lib
7753

7854
RUN mix compile
7955

80-
RUN npm install -g sass
81-
RUN cd assets && npm i && \
82-
sass --no-source-map --style=compressed css/custom.scss ../priv/static/assets/custom.css
83-
84-
# compile assets
85-
RUN mix assets.deploy.nosass
56+
RUN mix assets.deploy
8657

87-
# Changes to config/runtime.exs don't require recompiling the code
8858
COPY config/runtime.exs config/
8959

9060
COPY rel rel
@@ -94,20 +64,27 @@ RUN mix release
9464
# the compiled release and other runtime necessities
9565
FROM ${RUNNER_IMAGE}
9666

97-
# RUN apt-get update -y && apt-get install -y curl libstdc++6 openssl libncurses5 locales ghostscript default-jre libreoffice-java-common \
98-
# && apt-get install -y libreoffice --no-install-recommends && apt-get clean && rm -f /var/lib/apt/lists/*_*
99-
RUN apk add --no-cache curl libstdc++6 openssl ncurses ghostscript openjdk11-jre
67+
RUN apt-get update -y && apt-get install -y curl libstdc++6 openssl locales ghostscript default-jre libreoffice-java-common \
68+
&& apt-get install -y libreoffice --no-install-recommends && apt-get clean && rm -f /var/lib/apt/lists/*_*
69+
# RUN apk add --no-cache curl libstdc++ openssl ncurses ghostscript openjdk11-jre
10070

10171
# Install LibreOffice & Common Fonts
102-
RUN apk --no-cache add bash libreoffice util-linux libreoffice-common \
103-
font-droid-nonlatin font-droid ttf-dejavu ttf-freefont ttf-liberation && \
104-
rm -rf /var/cache/apk/*
72+
RUN apt-get update && apt-get install -y \
73+
libreoffice \
74+
fonts-dejavu \
75+
fonts-freefont-ttf \
76+
fonts-liberation \
77+
fonts-droid-fallback \
78+
&& apt-get clean \
79+
&& rm -rf /var/lib/apt/lists/*
10580

10681
# Install Microsoft Core Fonts
107-
RUN apk --no-cache add msttcorefonts-installer fontconfig && \
108-
update-ms-fonts && \
109-
fc-cache -f && \
110-
rm -rf /var/cache/apk/*
82+
RUN apt-get update && apt-get install -y \
83+
ttf-mscorefonts-installer \
84+
fontconfig \
85+
&& fc-cache -f \
86+
&& apt-get clean \
87+
&& rm -rf /var/lib/apt/lists/*
11188

11289
ENV LANG en_US.UTF-8
11390
ENV LANGUAGE en_US:en

Dockerfile.dev

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,18 @@ RUN ARCH=$(uname -m) && \
6161
&& rm asdf-v${ASDF_VERSION}-linux-${ASDF_ARCH}.tar.gz \
6262
&& mv asdf /usr/bin/
6363

64-
6564
# Install Erlang and Elixir using asdf
6665
RUN asdf plugin add erlang \
6766
&& asdf plugin add elixir \
68-
&& asdf install erlang 26.2.1 \
69-
&& asdf install elixir 1.16.0 \
70-
&& asdf set -u erlang 26.2.1 \
71-
&& asdf set -u elixir 1.16.0
67+
&& asdf install erlang 28.0.1 \
68+
&& asdf install elixir 1.18.4-otp-28 \
69+
&& asdf set -u erlang 28.0.1 \
70+
&& asdf set -u elixir 1.18.4-otp-28
7271

7372
# Install Node.js using asdf
7473
RUN asdf plugin add nodejs \
75-
&& asdf install nodejs 22.1.0 \
76-
&& asdf set -u nodejs 22.1.0
74+
&& asdf install nodejs 22.17.0 \
75+
&& asdf set -u nodejs 22.17.0
7776

7877
ENV PATH="/root/.asdf/shims:$PATH"
7978

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Claper has a two-sided mission:
3434
- The first one is to help these people presenting an idea or a message by giving them the opportunity to make their presentation unique and to have real-time feedback from their audience.
3535
- The second one is to help each participant to take their place, to be an actor in the presentation, in the meeting and to feel important and useful.
3636

37-
Supported languages: 🇬🇧 English, 🇫🇷 French, 🇩🇪 German, 🇪🇸 Spanish, 🇳🇱 Dutch, 🇮🇹 Italian
37+
Supported languages: 🇬🇧 English, 🇫🇷 French, 🇩🇪 German, 🇪🇸 Spanish, 🇳🇱 Dutch, 🇮🇹 Italian, 🇭🇺 Hungarian, 🇱🇻 Latvian
3838

3939
### Built With
4040

0 commit comments

Comments
 (0)