Camagru is a 42 web project built as a small framework-free PHP application.
Users can register, confirm their email address, log in, capture or upload an image, compose it with transparent PNG stickers on the server side, publish the result in a public gallery, then like and comment on images.
The final image composition is done server-side with PHP GD.
- Docker
- Docker Compose plugin (
docker compose) - Run commands from the repository root
Create a local .env file from the example:
cp .env.example .envMain variables:
| Variable | Purpose |
|---|---|
APP_PORT |
Host port used by Docker, default 8080 |
APP_BASE_URL |
Base URL used for links and social sharing |
APP_MAIL_FROM |
Sender address for application emails |
APP_MAIL_REPLY_TO |
Optional reply-to address |
MAILPIT_HOST |
Optional Mailpit SMTP host when using the mail profile |
CAMAGRU_DEV_ENDPOINTS |
Development-only endpoints; keep unset for evaluation |
.env must not be committed.
docker compose up -d --buildOpen:
http://localhost:8080
Quick check:
curl -fsS -o /tmp/camagru_login.html -w "HTTP %{http_code}\n" http://localhost:8080/loginExpected result:
HTTP 200
Mailpit is useful to inspect local emails for:
- registration confirmation
- password reset
- comment notifications
Start with Mailpit:
export MAILPIT_HOST=mailpit
docker compose --profile mail up -d --buildOpen:
App: http://localhost:8080
Mailpit: http://localhost:8025
If MAILPIT_HOST was exported:
unset MAILPIT_HOST
docker compose down --remove-orphans
docker compose up -d --buildIf MAILPIT_HOST=mailpit was added to .env, remove or comment it before starting the app-only mode.
docker compose down --remove-orphansWarning: this deletes the local SQLite database and generated images.
docker compose down --remove-orphans
find database -maxdepth 1 -name 'camagru.db*' -delete
find public/uploads -mindepth 1 ! -name '.gitkeep' -delete
find public/tmp -mindepth 1 ! -name '.gitkeep' -delete
touch public/uploads/.gitkeep public/tmp/.gitkeepThe database is recreated automatically from database/schema.sql on the next container start.
Suggested manual checks:
- Register a user and confirm the account by email.
- Log in.
- Open
/editor. - Verify anonymous users are redirected from
/editorto/login. - Select a sticker before capture/upload.
- Capture or upload a base image.
- Compose and save the final image.
- Verify the image appears in the public gallery.
- Log in as another user.
- Like and comment on an image.
- Verify comment notification email behavior with Mailpit.
- Verify users can delete only their own images and comments.
- Verify
/testand/test-dbreturn 404 unlessCAMAGRU_DEV_ENDPOINTS=1.
- The project uses PHP 8.2, SQLite/PDO, PHP GD, HTML/CSS and vanilla JavaScript.
- Docker Compose is the intended local run method.
- Generated data is persisted in local mounted folders:
database/public/uploads/public/tmp/
- Social sharing links using
localhostwork only locally. External platforms cannot fetch localhost URLs. - Dev endpoints are disabled by default.
MIT. See LICENSE.