This project is a RESTful API built with Flask, supporting JWT-based authentication and role-based access control (Admin, User).
- 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.
- Clone the repository:
git clone https://github.com/oleksandr-kipz/symfony-test.git
- Navigate to the project directory:
cd symfony-test - Create a virtual environment and activate it:
python -m venv .venv .venv\Scripts\activate
- Install the dependencies:
pip install -r requirements.txt
- Run the application:
python API.py
- The server will run on
http://127.0.0.1:5000.
- 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).
The full API documentation is available on Postman: API Documentation
- Replace
https://api333-4573.postman.co/workspace/My-Workspace~f0900c5b-bb17-4f45-8915-862ea1b9edcf/collection/41677774-34db4e5c-8cb3-40f4-b26d-5987133e7da2with the actual link generated by Postman after sharing the collection.
Rak Ivan