This repository contains an API for user management. It provides endpoints for user registration, login, user information retrieval, role management, and more.
- Python 3.9 or later
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/picassio/basic-auth-api.git
-
Navigate to the project directory:
cd basic-auth-api/auth
-
Create a .env file in the project directory and define the required environment variables. You can use the provided .env.example file as a template.
-
Build and run the API using Docker Compose:
docker-compose up --build
This will build the Docker image and start the containers for the API and the MySQL database. 5. To stop the containers, press Ctrl+C in the terminal or run:
docker-compose down
The API documentation is available in Swagger format. You can access it by visiting http://localhost:5000/api/docs in your web browser.
If you want to run the API without Docker for development purposes, follow these steps:
-
Install the Python dependencies:
pip install -r requirements.txt
-
Set the required environment variables in the .env file.
-
Run the Flask development server:
python auth.py
The API will be accessible at http://localhost:5000 for testing and development.