The purpose of this project is to implement an authentication service for an online cinema. For this purpose, authentication and role management APIs have been developed based on the Flask framework. A relational database PostgreSQL is used for storing user data and login history. User authentication is done using JWT tokens, and Redis is used to store invalid access tokens. The application also features social login (OAuth protocol), distributed tracing for monitoring (Jaeger program), and rate limiting to prevent excessive server load. The project is launched through a proxy server NGINX, which serves as the entry point for the web application. API endpoints are covered by tests using the pytest library.
Python
Flask
PostgreSQL
Redis
NGINX
Gunicorn
PyTest
Docker
Clone the repository and navigate to the infra
directory inside it:
git clone https://github.com/temirovazat/cinemax-auth.git
cd cinemax-auth/infra/
Create a .env
file and add project settings:
nano .env
# PostgreSQL
POSTGRES_DB=users_database
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
# Redis
REDIS_HOST=redis
REDIS_PORT=6379
Deploy and run the project in containers:
docker-compose up
The API documentation will be available at:
http://127.0.0.1/openapi