AtlanticPhoto is an app that allows you to share and see others activities without any cheat all over the world. It's so pure and transparent as if you were in an ocean, so enjoy it :)
| Module | Description |
|---|---|
| FastAPI | Framework |
| Pydantic | Validation library |
| SQLAlchemy | ORM |
| Alembic | Migration tool |
| PostgreSQL | Database |
| Cloudinary | Image hosting |
| FastAPI-limiter | Rate limiting |
| Passlib | Password hashing |
| Qrcode | QR code generator |
| Pillow | Image processing |
Endpoints:
POST /api/auth/signup
POST /api/auth/login
POST /api/auth/logout
POST /api/auth/refresh_token
The names speak for themselves
The application uses JWT tokens for authentication. Users have three roles: regular user, moderator, and administrator. The first user is an administrator.
To implement different access levels (regular user, moderator, and administrator), FastAPI decorators are used to check the token and user role.
Users can perform various operations related to photos:
-
Upload photos with descriptions.
POST /api/images/ -
Delete photos.
DELETE /api/images/{image_id} -
Edit photo descriptions.
PATCH /api/images/{image_id} -
Retrieve a photo by a unique id.
GET /api/images/{image_id} -
Add up to 5 tags per photo.
-
Retrieve all your photos.
GET /api/images/ -
Apply basic photo transformations using Cloudinary services.
POST /api/transform/create_transformed/{original_image_id} -
Generate links to transformed images for viewing as URL and QR-code. Links are stored on the server.
POST /api/transform/{transformed_pic_id}/qr -
Retrieve a transformed photo by a unique id.
GET /api/transform/{transformed_pic_id} -
Retrieve all your transformed photos.
GET /api/transform/{user_id}/transformed -
Update parameters of an existed transformed picture.
PATCH /api/transform/{transformed_pic_id}/ -
Delete an existed transformed picture.
DELETE /api/transform/{transformed_pic_id}/Administrators can perform all CRUD operations with user photos.
Under each photo, there is a comment section. Users can:
-
Add and read comments to each other's photos.
POST /api/comments/ -
Edit comment.
PATCH /api/comments/{comment_id} -
Administrators and moderators if you have the role can delete comments.
DELETE /api/comments/{comment_id}
Endpoints for user profile:
- See users profiles.
GET /api/users/{username}
- Clone the repository.
git clone https://github.com/Sikan777/AtlanticPhoto- Install dependencies.
pip install -r requirements.txtor with poetry
poetry install- Setup the ".env" file.
cp .env.example .envand fill in the information you need
- Run the application.
uvicorn main:app --reload- Enjoy!
This project is licensed under the MIT License.
Feel free to provide feedback, report issues, or contribute to the project!
