Giter Club home page Giter Club logo

mvandermeulen / user-management-api-fast-secure-redis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pgalandev/user-management-api-fast-secure-redis

0.0 0.0 0.0 113 KB

This is a secure and efficient REST API for user administration. From creating new users to managing subordinates of a manager, this API provides a comprehensive solution. It is designed to ensure the integrity and security of the data with an educational purpose in mind.

Shell 1.43% Python 96.61% Makefile 1.96%

user-management-api-fast-secure-redis's Introduction

User Management API with FastAPI, Redis and JWT

Table of Contents

Introduction

Swagger API

This is a secure and efficient REST API for user administration. From creating new users to managing subordinates of a manager, this API provides a comprehensive solution. It is designed to ensure the integrity and security of the data with an educational purpose in mind.

This API has JWT (Json Web Token) protection, so only a user registered in the application can perform operations on it.

As a database, a lightweight option such as Redis has been chosen, which is often used as a cache instead of a database. The reason for using it is that since it is a 'simple' and educational application a non-relational option was the best. Among the candidates Redis seemed to me the easiest option to implement.

On the other hand, the language used was Python and FastAPI was chosen as the development framework, due to the similarities it shares with other frameworks when developing APIs such as Springboot (for endpoint implementation).

To be able to use all the functions provided by this API you will have to authenticate yourself, for this a user with admin role has been added by default in the database.

Features

  • User registration and management.
  • Role-based access control.
  • JSON Web Token (JWT) protection for secure authentication.
  • Data storage using Redis, a fast and lightweight option suitable for caching.

Author

Prerequisites

Before you can run this project, make sure you have the following prerequisites installed on your system:

Docker Compose (Linux)

If you're using Linux, you can install Docker Compose using the following commands:

# Install Docker Compose
sudo apt update
sudo apt install docker-compose

Python 3.8

Make sure you have Python 3.8 installed on your system. You can download it from the official Python website

How to launch

To set up and run this project, follow these steps:

  • Clone the repository
git clone link_to_github_repository
cd user-management-api-fast-secure-redis
  • Run the setup command using make:
make setup

Usage

Once the API is up and running, you can access it using the provided Swagger interface. Visit the Swagger API documentation (http://localhost:8000/docs#/) page to explore and interact with the endpoints. Then to access to all the functionality you must log in with the mentionated default user:

  • username: 404bdab1-3dd5-4173-9713-43ec7858b0b5
  • password: test

LogIn

Improvement proposal

  • Atomize the user types, having classes for each type, user, manager and administrator. Eliminating the roles field.
  • Creating integration tests

user-management-api-fast-secure-redis's People

Contributors

pgalandev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.