This project is a REST API application that allows users to share photos. It includes user authentication, photo uploading, photo changing, commenting, and role-based access control.
- User registration and authentication with JWT tokens
- User roles (admin, moderator, user) with different access levels
- Photo uploading and transformation
- Commenting on photos
- QR code generation for photo URLs
- Cloudinary integration for photo storage
- Redis for caching
- PostgreSQL database for data storage
- Email verification and password reset
A file is required for the project to work /.env with environment variables.
Create it with this content and substitute your values.
POSTGRES_DB=
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_PORT=
SQLALCHEMY_DATABASE_URL=postgresql+psycopg2://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:${POSTGRES_PORT}/${POSTGRES_DB}
SECRET_KEY=
ALGORITHM=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_FROM=
MAIL_PORT=
MAIL_SERVER=
redis_host=
redis_port=
redis_password=
CLOUDINARY_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=- Install Docker
- Clone project
git clone https://github.com/oleksandr-study/Project-Pythongram.git
cd Project-Pythongram- Install the dependencies:
pip install poetry
poetry shell
poetry update- Create .env and add info as at example
- Apply database migrations
alembic upgrade head- Start Docker images
docker-compose up- Run the application:
python main.py- GOTO 127.0.0.1:8000
- Enjoy