https://github.com/tushar-3549/api-development
FastAPI application showcasing backend development with Python, including RESTful APIs, database integration with PostgreSQL, and modern development practices.
https://github.com/tushar-3549/api-development
api-development backend fastapi jwt oauth2 postgresql-database sqlalchemy
Last synced: 3 months ago
JSON representation
FastAPI application showcasing backend development with Python, including RESTful APIs, database integration with PostgreSQL, and modern development practices.
- Host: GitHub
- URL: https://github.com/tushar-3549/api-development
- Owner: tushar-3549
- Created: 2024-12-16T09:29:58.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-26T15:09:20.000Z (8 months ago)
- Last Synced: 2025-06-11T15:24:02.790Z (8 months ago)
- Topics: api-development, backend, fastapi, jwt, oauth2, postgresql-database, sqlalchemy
- Language: Python
- Homepage:
- Size: 58.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## ShareThoughts API
A high-performance ShareThoughts API built using **FastAPI**, **PostgreSQL**, and **Alembic**. This project implements secure user authentication, robust database operations, and thorough testing to ensure a reliable and efficient system.
---
## ๐ Features
- ๐ **User Authentication** (JWT-based login/logout using OAuth2)
- ๐ **CRUD Operations** for posts and users
- ๐ **Password Hashing** for secure login credentials
- ๐๏ธ **PostgreSQL Integration** using SQLAlchemy ORM
- ๐ **Alembic Migrations** for schema versioning
- ๐ก๏ธ **SQL Injection Prevention** with ORM best practices
- โ
**Unit Testing** with Pytest (users, auth, DB, API endpoints)
- ๐งช **Postman API Testing** support
- โ๏ธ **GitHub Actions** for CI/CD
- ๐ณ **Docker Support** for easy containerized deployment
---
## ๐ ๏ธ Technologies Used
- **FastAPI** โ Modern, high-performance web framework
- **PostgreSQL** โ Relational database
- **SQLAlchemy** โ ORM for interacting with the DB
- **Alembic** โ Database migrations
- **OAuth2 & JWT** โ Secure authentication
- **Pytest** โ Python testing framework
- **GitHub Actions** โ CI/CD automation
---
## ๐ฆ Installation
### โ
Prerequisites
Ensure the following are installed:
- Python (3.10 or higher)
- PostgreSQL
- Virtual environment module (venv)
### ๐ง Steps
1. **Clone the repository**
```bash
git clone https://github.com/tushar-3549/API-Development.git
cd API-Development
```
2. **Create and activate a virtual environment**
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. **Install dependencies**
`pip install -r requirements.txt`
4. **Set up your `.env` file**
```
DATABASE_URL=postgresql://:@localhost/
SECRET_KEY=your_secret_key
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
```
5. **Apply Alembic migrations**
`alembic upgrade head`
6. **Run the FastAPI server**
`uvicorn app.main:app --reload`
- Visit the API at: `http://127.0.0.1:8000`
- Docs: `http://127.0.0.1:8000/docs`
- ๐งช **Running Tests**
```pytest```
**ER Diagram**
