ImageHub

所属分类:图形图象
开发工具:Python
文件大小:0KB
下载次数:0
上传日期:2024-02-27 22:06:46
上 传 者sh-1993
说明:  ImageHub(图像中心)
(ImageHub)

文件列表:
docs/
migrations/
src/
alembic.ini
main.py
poetry.lock
pyproject.toml

# ImageHub

ImageHub

--- ImageHub is a REST API application implemented using the FastAPI framework. It allows users to upload, manage, and share photos, and interact through comments. --- ## Table of Contents - [Technologies](https://github.com/Kostiantyn78/ImageHub/blob/master/#technologies) - [Basic functionality](https://github.com/Kostiantyn78/ImageHub/blob/master/#basic-functionality) - [Authentication](https://github.com/Kostiantyn78/ImageHub/blob/master/#authentication) - [Working with photos](https://github.com/Kostiantyn78/ImageHub/blob/master/#working-with-photos) - [Comments](https://github.com/Kostiantyn78/ImageHub/blob/master/#comments) - [Profile](https://github.com/Kostiantyn78/ImageHub/blob/master/#profile) - [Usage](https://github.com/Kostiantyn78/ImageHub/blob/master/#usage) - [Installation](https://github.com/Kostiantyn78/ImageHub/blob/master/#installation) - [Additional information](https://github.com/Kostiantyn78/ImageHub/blob/master/#additional-information) - [License](https://github.com/Kostiantyn78/ImageHub/blob/master/#license) - [Authors](https://github.com/Kostiantyn78/ImageHub/blob/master/#authors) ____ ## Technologies | **Module** | **Description** | |----------------------------------------------------------------|--------------------| | [FastAPI](https://github.com/Kostiantyn78/ImageHub/blob/master/https://fastapi.tiangolo.com/) | Framework | | [Pydantic](https://github.com/Kostiantyn78/ImageHub/blob/master/https://pydantic-docs.helpmanual.io/) | Validation library | | [SQLAlchemy](https://github.com/Kostiantyn78/ImageHub/blob/master/https://docs.sqlalchemy.org/) | ORM | | [Alembic](https://github.com/Kostiantyn78/ImageHub/blob/master/https://alembic.sqlalchemy.org/en/latest/) | Migration tool | | [PostgreSQL](https://github.com/Kostiantyn78/ImageHub/blob/master/https://www.postgresql.org/) | Database | | [Cloudinary](https://github.com/Kostiantyn78/ImageHub/blob/master/https://cloudinary.com/) | Image hosting | | [Passlib](https://github.com/Kostiantyn78/ImageHub/blob/master/https://passlib.readthedocs.io/en/stable/) | Password hashing | | [Qrcode](https://github.com/Kostiantyn78/ImageHub/blob/master/https://pypi.org/project/qrcode/) | QR code generator | | [Pillow](https://github.com/Kostiantyn78/ImageHub/blob/master/https://pypi.org/project/Pillow/) | Image processing | ____ ## Basic functionality ### Authentication **Endpoints:** ``` POST /api/auth/signup ``` ``` POST /api/auth/login ``` ``` GET /api/auth/refresh_token ``` ``` GET /api/auth/confirmed_email/{token} ``` ``` POST /api/auth/request_email ``` The application uses JWT tokens for authentication. Users have three roles: regular user, moderator, and administrator. To implement different access levels (regular user, moderator, and administrator), FastAPI decorators are used to check the token and user role. ### Working with photos **Users can perform various operations related to photos:** - Upload photos with descriptions. ``` POST /api/images/upload_image ``` - Delete photos. ``` DELETE /api/images/{picture_id} ``` - Edit photo descriptions. ``` PATCH /api/images/{picture_id} ``` - Retrieve a photo by a unique link. ``` GET /api/images/{picture_id} ``` - Add up to 5 tags per photo. - Apply basic photo transformations using [Cloudinary services](https://github.com/Kostiantyn78/ImageHub/blob/master/https://cloudinary.com/documentation/image_transformations). ``` POST /api/transform/create_transform/{natural_photo_id} ``` - Generate links to transformed images for viewing as URL and QR-code. Links are stored on the server. With the help of [FastAPI decorators, described above](https://github.com/Kostiantyn78/ImageHub/blob/master/#authentication), administrators can perform all CRUD operations with user photos. ### Comments **Under each photo, there is a comment section. Users can:** - Add and read comments to each other's photos. ``` POST /api/comments/{image_id} ``` ``` GET /api/comments/all/{image_id} ``` - Edit comment. ``` PATCH /api/comments/{comment_id} ``` - Administrators and moderators [if you have the role](https://github.com/Kostiantyn78/ImageHub/blob/master/#authentication) can delete comments. ``` DELETE /api/comments/{comment_id} ``` ### Profile **Endpoints for user profile:** - See your profile. ``` GET /api/users/me ``` - Change your avatar. ``` PATCH /api/users/avatar ``` - See another user's profile. ``` GET /api/users/{username} ``` - Create a route for a user profile based on their unique username. It returns all user information, including name, registration date, and the number of uploaded photos. ____ ## Usage ### Installation - Clone the repository. ```Shell git clone https://github.com/Kostiantyn78/ImageHub.git ``` - Install dependencies. *using poetry* ```Shell poetry install ``` - Setup the ".env" file. ```Shell cp .env.example .env ``` *and fill in the information you need, run the docker container and create the database if use Postgres * - Run the application. ```Shell uvicorn main:app --reload ``` - Enjoy using application via link in the terminal. ____ ### Additional information - [Documentation](https://github.com/Kostiantyn78/ImageHub/blob/master/http://localhost:63342/ImageHub/docs/_build/html/index.html?_ijt=bievmo05hld2bt65j03j40vh49&_ij_reload=RELOAD_ON_SAVE) - [Swagger documentation - ](https://github.com/Kostiantyn78/ImageHub/blob/master/http://127.0.0.1:8000/docs#) - [GitHub](https://github.com/Kostiantyn78/ImageHub/blob/master/https://github.com/Kostiantyn78/ImageHub) ____ ## License This project is distributed under the **MIT** license. ____ ## Authors The **PyCrafters** Team: - [Yuliia Didenko](https://github.com/Kostiantyn78/ImageHub/blob/master/https://github.com/yulyan407) - [Maksim Nesterovskyi](https://github.com/Kostiantyn78/ImageHub/blob/master/https://github.com/legendarym4x) - [Kostiantyn Gorishnyi](https://github.com/Kostiantyn78/ImageHub/blob/master/https://github.com/Kostiantyn78) - [Taras Barskyi](https://github.com/Kostiantyn78/ImageHub/blob/master/https://github.com/Barskyi) ____

近期下载者

相关文件


收藏者