Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/augsmachado/fastapi-postgres

A robust web application built with FastAPI, PostgreSQL, and SQLAlchemy, featuring comprehensive database migrations and modern Python development practices.
https://github.com/augsmachado/fastapi-postgres

docker fastapi postgresql python sqlalchemy

Last synced: 10 days ago
JSON representation

A robust web application built with FastAPI, PostgreSQL, and SQLAlchemy, featuring comprehensive database migrations and modern Python development practices.

Awesome Lists containing this project

README

        

# FastAPI Postgres Project

## Overview

A robust web application built with FastAPI, PostgreSQL, and SQLAlchemy, featuring comprehensive database migrations and modern Python development practices.

![Screenshot 2024-12-28 at 2 06 07 AM](https://github.com/user-attachments/assets/7258e20c-bba3-4254-a2a0-6e15110c20ab)

## 🚀 Features

- FastAPI backend
- PostgreSQL database integration
- SQLAlchemy ORM
- Alembic database migrations
- Comprehensive GitHub Actions workflows
- CodeQL security analysis

## 🛠 Tech Stack

- Python 3.11
- FastAPI
- PostgreSQL
- SQLAlchemy
- Alembic
- GitHub Actions
- Docker (optional)

## 📦 Prerequisites

- Python 3.11+
- PostgreSQL
- pip

## 🔧 Installation

### 1. Clone Repository

```bash
git clone https://github.com/yourusername/fastapi-postgres.git
cd fastapi-postgres
```

### 2. Create Virtual Environment

```bash
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
```

### 3. Install Dependencies

```bash
pip install -r requirements.txt
```

### 4. Database Setup

```bash
# Configure your database connection in .env or environment variables
alembic upgrade head
```

### 🚦 Running the Application

```bash
uvicorn main:app --reload
```

### 🔍 Testing

```bash
pytest
```

### 🔐 Security

- CodeQL analysis integrated
- Dependabot for dependency updates
- Regular security scans

### 📋 Database Migrations

```bash
# Create a new migration
alembic revision --autogenerate -m "Description of changes"

# Apply migrations
alembic upgrade head
```

### 🤝 Contributing

Feel free to submit issues or pull requests for improvements or bug fixes. Use the framework below:

- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request

### 📄 License

This project is licensed under the Apache License 2.0.
See the LICENSE file for details.