Fast API

This is a Fast API codebase that provides user management functionality.

Installation

  1. Clone the repository:

    git clone https://github.com/Hemanth95/user-management.git
  2. Navigate to the project directory:

    cd user-management
  3. Create a virtual environment:

    python3 -m venv venv
  4. Activate the virtual environment:

    source venv/bin/activate
  5. Install the required dependencies:

    pip install -r requirements.txt
  6. Install Docker and Docker compose by following these instruction:

Usage

  1. Running docker compose file

    docker-compose up -d
  2. Access the API endpoints using the following base URL:

    http://localhost:8000/docs
    
  3. For Authorization while accessing endpoints, do pass the token in the header

    Authorization : Bearer <token>
    

API Endpoints

  • GET /users: Get a list of all users(only for admins).
  • GET /users/profile: Get details of a specific user.
  • POST /users/{user_id}/roles:Add roles to users.
  • POST /auth/register: Create a new user.
  • POST /auth/login: Login.
  • POST /roles: Create new Roles.
  • POST /roles/{role_id}/permissions: Create or Add permission to roles.