https://github.com/realchaula/pixora_api
API for pixora
https://github.com/realchaula/pixora_api
fastapi python
Last synced: 11 months ago
JSON representation
API for pixora
- Host: GitHub
- URL: https://github.com/realchaula/pixora_api
- Owner: RealChAuLa
- License: mit
- Created: 2025-03-10T19:24:11.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-05-18T05:29:50.000Z (about 1 year ago)
- Last Synced: 2025-05-18T06:27:11.265Z (about 1 year ago)
- Topics: fastapi, python
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 15
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pixora API
A FastAPI application that provides authentication and user management functionality with MongoDB integration.
## Features
- User Authentication
- Sign up with email and password
- Login with JWT authentication
- Password hashing for security
- User Management
- User profile retrieval
- Protected endpoints using JWT
- MongoDB Integration
- Connects to MongoDB Atlas cluster
- Stores user data securely
## Technologies Used
- FastAPI: Modern, fast web framework for building APIs
- MongoDB: NoSQL database for storing user data
- Motor: Asynchronous MongoDB driver for Python
- PyJWT: JSON Web Token implementation for Python
- Pydantic v2: Data validation and settings management
- Passlib & Bcrypt: Password hashing
## Project Structure
project/ │ ├── .env ├── main.py ├── requirements.txt │ ├── app/ │ ├── init.py │ ├── database.py │ │ │ ├── models/ │ │ ├── init.py │ │ └── user_model.py │ │ │ ├── auth/ │ │ ├── init.py │ │ ├── routes.py │ │ ├── jwt_handler.py │ │ └── password_handler.py │ │ │ └── user/ │ ├── init.py │ ├── routes.py │ └── utils.py
## API Endpoints
### Authentication
- **POST** `/api/auth/signup` - Register a new user
- Body Parameters:
- `first_name` (string): User's first name
- `last_name` (string): User's last name
- `email` (string): User's email
- `password` (string): User's password (with validation rules)
- `contact` (string): User's phone number
- `birthday` (string): User's birthday (YYYY-MM-DD)
- Returns: Success message with user ID
- **POST** `/api/auth/login` - Authenticate a user
- Form Parameters:
- `username` (string): User's email
- `password` (string): User's password
- Returns: JWT access token
### User Management
- **GET** `/api/users/me` - Get current user details
- Headers: Bearer token
- Returns: User profile data
- **GET** `/api/users/{user_id}` - Get user by ID
- Headers: Bearer token
- Returns: User profile data (only if requesting own profile)
## Setup and Installation
1. Clone the repository
2. Create a virtual environment:
3.