Camagru is a containerized full-stack web application inspired by the 42 school project. It allows users to capture or upload images, overlay stickers, and publish them to a public gallery. Authenticated users can like and comment on images. All backend logic is written in Ruby using Sinatra, and image processing is handled server-side.
Web
camagru2-ezgif.com-video-speed.mp4
API
camagru.mp4
- Backend: Ruby, Sinatra
- Database: PostgreSQL
- Frontend: HTML/CSS/JS (no frameworks)
- Email: MailHog (SMTP),
mailgem - Image Processing: Server-side overlay pipeline (TBD)
- Authentication: JWT-based session tokens
- Tests: RSpec
- Linting: RuboCop
- Containerization: Docker + Docker Compose
camagru/
├── backend/
│ ├── app/ # Main application code
│ │ ├── controllers/ # Sinatra route definitions
│ │ ├── models/ # Database interaction logic
│ │ ├── lib/ # Shared utilities (e.g., auth, API doc)
│ │ ├── helpers/ # Support modules (e.g., token, hashing)
│ │ └── views/ # (if needed for templating)
│ ├── db/ # Seeds and migrations
│ ├── docs/ # Exported API docs (Markdown + JSON)
│ ├── spec/ # RSpec tests
│ └── Dockerfile
├── docker-compose.yml
├── Makefile
└── frontend/ # Static frontend files
make test: Runs all RSpec tests- Isolated tests per model/controller
- Many routes include exhaustive specs and edge-case handling
- Secure user signup/login/logout with JWT
- Password reset flow via email
- Image upload (processing pipeline to come)
- Gallery of user-generated content
- Public and private image management
- Stickers system
- RESTful enriched image JSON including likes and comments
| Method | Route | Controller | Status |
|---|---|---|---|
| POST | /signup |
UsersController#create |
✅ |
| POST | /login |
SessionsController#create |
✅ |
| POST | /logout |
SessionsController#destroy |
✅ |
| GET | /confirm?token=... |
UsersController#confirm_email |
✅ |
| POST | /password/forgot |
PasswordResetsController#create |
✅ |
| POST | /password/reset |
PasswordResetsController#update |
✅ |
| Method | Route | Controller | Status |
|---|---|---|---|
| GET | /stickers |
StickersController#index |
✅ |
| Method | Route | Controller | Status |
|---|---|---|---|
| GET | /gallery |
GalleryController#index |
✅ (likes/comments sort supported) |
| Method | Route | Controller | Status |
|---|---|---|---|
| GET | /images/mine |
ImagesController#mine |
✅ |
| GET | /images/archived |
ImagesController#archived |
✅ |
| POST | /images/:id/archive |
ImagesController#archive |
✅ |
| DELETE | /images/:id |
ImagesController#destroy |
✅ |
| Method | Route | Controller | Status |
|---|---|---|---|
| POST | /images/:id/like |
LikesController#like |
✅ |
| DELETE | /images/:id/unlike |
LikesController#unlike |
✅ |
| Method | Route | Controller | Status |
|---|---|---|---|
| POST | /images/:id/comments |
CommentsController#create |
✅ |
❌
GET /images/:id/commentshas been intentionally removed. Instead, image responses now embed comments + likes (RESTful style).
make up # Start containers
make migrate # Run DB migrations
make seed # Seed DB with test data
make logs # Tail backend logsmake docs— export Markdown + JSON API documentationrake db:create|drop|migrate|seed— DB tasksrake doc:export— custom task forAPIDocgenerator
- All images returned from
/gallery,/images/mine, and/images/archivedinclude embeddedcommentsandlikes. - Pagination supports
page,per_page,sort_by(created_at,likes,comments), andorder(asc,desc). - Email delivery is mocked with MailHog by default.
- Implement server-side image processing pipeline (stickers overlay)
- Add frontend integration
- Rate limiting for likes/comments/images
- User profile editing
Camagru is proudly built with ❤️ and Sinatra by pulgamecanica