Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask RESTful API with JWT Authentication

This project is a RESTful API built with Flask, supporting JWT-based authentication and role-based access control (Admin, User).

Features

  • Authentication: JWT-based login and role assignment (Admin, User).
  • CRUD Operations: Create, Read, Update, Delete operations for managing items.
  • Role-Based Access Control: Restricted access to endpoints based on user roles.
  • In-Memory Storage: No database integration, data stored in memory for demonstration.

Setup and Installation

  1. Clone the repository:
    git clone https://github.com/oleksandr-kipz/symfony-test.git
  2. Navigate to the project directory:
    cd symfony-test
  3. Create a virtual environment and activate it:
    python -m venv .venv
    .venv\Scripts\activate
  4. Install the dependencies:
    pip install -r requirements.txt
  5. Run the application:
    python API.py
  6. The server will run on http://127.0.0.1:5000.

Endpoints

  • POST /register: Register a new user.
  • POST /login: Log in and receive a JWT token.
  • POST /items: Create a new item (Admin only).
  • GET /items: Get a list of all items.
  • PATCH /items/<item_id>: Update an item by ID (Admin only).
  • DELETE /items/<item_id>: Delete an item by ID (Admin only).

Documentation

The full API documentation is available on Postman: API Documentation

Notes

  • Replace https://api333-4573.postman.co/workspace/My-Workspace~f0900c5b-bb17-4f45-8915-862ea1b9edcf/collection/41677774-34db4e5c-8cb3-40f4-b26d-5987133e7da2 with the actual link generated by Postman after sharing the collection.

Author

Rak Ivan

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages