PhotoCamel is a modern web application built with OCaml that allows users to upload photos to S3, automatically compress them into multiple formats, and share them via generated links. The application features a responsive web interface built with HTMX for dynamic interactions.
- Photo upload with drag-and-drop support
- Automatic image compression in three formats
- S3 storage integration
- Responsive web interface using HTMX and TailwindCSS
- Share photos via generated links
- Real-time UI updates without page refreshes
- Backend: OCaml with Dream web framework
- Frontend: HTMX + TailwindCSS
- Storage: Amazon S3
- Image Processing: ImageMagick
- Database: PostgreSQL
- Template Engine: Tyxml
photocamel/
├── bin/ # Application entry point
│ ├── main.ml # Main application file
│ └── dune # Binary build configuration
├── lib/ # Core library code
│ ├── templates.ml # HTML templates
│ └── dune # Library build configuration
├── dune-project # Project configuration
└── README.md # This file
-
Install OCaml and opam:
# On Ubuntu/Debian sudo apt install opam opam init opam switch create 4.14.0 eval $(opam env)
-
Install project dependencies:
opam install . --deps-only -
Configure AWS credentials:
- Create a
.envfile with your AWS credentials:AWS_ACCESS_KEY_ID=your_access_key AWS_SECRET_ACCESS_KEY=your_secret_key AWS_REGION=your_region S3_BUCKET=your_bucket_name
- Create a
-
Build the project:
dune build
-
Run the application:
dune exec photocamel
The application uses:
- HTMX for dynamic frontend interactions
- TailwindCSS for styling
- Dream for handling HTTP requests
- ImageMagick for image processing
- AWS S3 for storage
To add new features or modify existing ones:
- Backend routes are defined in
bin/main.ml - HTML templates are in
lib/templates.ml - Build with
dune build - Test with
dune test
- User authentication
- Album organization
- Batch processing
- Image editing features
- Access control for shared links
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.