This directory contains two FastAPI applications: one for basic CRUD operations (task management) and another for user authentication using JWT (JSON Web Tokens).
-
Task Management API (
fastapi-curd.py):- Implements basic CRUD operations for managing tasks.
- Tasks have attributes like
id,title,description, andcompleted.
-
User Authentication API (
fastapi-tutorial.py):- Implements user registration, login, and token-based authentication.
- Uses JWT for secure access and stores user information in a simulated database.
To run the applications, ensure you have Python and FastAPI installed. You can install FastAPI and Uvicorn using pip:
pip install fastapi uvicorn python-jose passlib[bcrypt]You can run each application separately.
To run the task management API:
python fastapi-curd.pyThe API will be available at http://localhost:8000/tasks/.
To run the user authentication API:
python fastapi-tutorial.pyThe API will be available at http://localhost:8000/token for login and http://localhost:8000/users/me/ for user information.
- Create Task:
POST /tasks/ - Retrieve All Tasks:
GET /tasks/ - Retrieve Specific Task:
GET /tasks/{task_id} - Update Task:
PUT /tasks/{task_id} - Delete Task:
DELETE /tasks/{task_id}
- Token Generation:
POST /token - Get Current User:
GET /users/me/ - Get Current User's Items:
GET /users/me/items