Ссылка на проект: https://github.com/Yandex-34-mpython-12/Auth_sprint_1
This repository contains the microservices for our application, including authentication (auth_service
), film management (film_service
), and an ETL (Extract, Transform, Load) process (etl
). Each service requires specific environment configurations, which should be set up before running the services.
We use FastAPI Users to handle user management, including user creation and deletion. For authentication, we employ the Redis JWT strategy, which stores JWT tokens in a Redis cache to manage user sessions securely and efficiently.
Each microservice in this project requires a .env
file that contains necessary environment variables. These files should be created based on the .env.example
files provided in each service's directory.
.env
FilesNavigate to the Service Directory:
auth_service/
film_service/
etl/
Copy the .env.example
File:
In each service directory, copy the .env.example
file to create a new .env
file. You can use the following command in your terminal:
cp .env.example .env
Edit the .env
File:
Open the newly created .env
file in a text editor and customize the environment variables according to your local development setup or production environment. For example:
# Example of environment variables in .env file
APP_CONFIG__RUN__DEBUG=false
APP_CONFIG__RUN__HOST=localhost
APP_CONFIG__RUN__PORT=8000
Create the .es_state
File:
Navigate to the Directory:
etl/
and cp es_state.json.example es_state.json
The structure of the repository should look like this:
project_root/
├── auth_service/
│ ├── .env.example
│ ├── .env # <- Generated from .env.example
│ └── ...
├── film_service/
│ ├── .env.example
│ ├── .env # <- Generated from .env.example
│ └── ...
├── etl/
│ ├── .env.example
│ ├── .env # <- Generated from .env.example
│ └── ...
└── README.md
.env
files to avoid runtime errors..env
files secure and never commit them to version control. Instead, share them securely with your team members as needed.After setting up the .env
and .es_state
files, you can start each service using the appropriate command, typically via Docker, docker-compose up
.
After setting up and running the services, you can find the API documentation at:
http://localhost:8001/api/openapi#/ This link provides access to the OpenAPI documentation for the API, allowing you to explore the available endpoints, request parameters, and responses.