https://github.com/mayankdiwate/fastapi-rbac-admin
A FastAPI application with user authentication, registration, and token-based authorization using PostgreSQL.
https://github.com/mayankdiwate/fastapi-rbac-admin
docker docker-compose fastapi jwt postgresql python3
Last synced: 3 months ago
JSON representation
A FastAPI application with user authentication, registration, and token-based authorization using PostgreSQL.
- Host: GitHub
- URL: https://github.com/mayankdiwate/fastapi-rbac-admin
- Owner: MayankDiwate
- Created: 2024-11-25T13:21:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-25T13:30:21.000Z (over 1 year ago)
- Last Synced: 2025-04-04T06:41:44.000Z (about 1 year ago)
- Topics: docker, docker-compose, fastapi, jwt, postgresql, python3
- Language: Python
- Homepage: https://fastapi-rbac-admin.onrender.com
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FastAPI RBAC
This is a FastAPI-based application that provides user authentication and management features. It includes endpoints for user registration, signing in, and signing out, utilizing secure token-based authentication.
## Features
- **User Registration**: Register new users with unique usernames.
- **User Login**: Authenticate users and issue JWT tokens.
- **User Logout**: Simulated sign-out for token-based systems.
## Requirements
- Python 3.10 or higher
- FastAPI
- SQLAlchemy
- Uvicorn
- Any additional dependencies (see `requirements.txt`)
## Installation
1. Clone the repository:
```bash
git clone git@github.com:MayankDiwate/FastAPI-RBAC-Admin.git
cd
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Run the application:
```bash
uvicorn main:app --host 0.0.0.0 --port 8000
```
4. Access the application at:
```
http://localhost:8000/docs
```
## Docker Support
To build and run the application in a Docker container:
1. Build the Docker image:
```bash
docker build -t fastapi-app .
```
2. Run the Docker container:
```bash
docker run -p 8000:8000 fastapi-app
```
3. Access the application at:
```
http://localhost:8000/docs
```
## Usage
- Use the `/register` endpoint to create a new user.
- Authenticate with the `/sign-in` endpoint to obtain a JWT token.
- Test APIs with the interactive Swagger UI at `/docs`.
## License
This project is licensed under the MIT License.