Skip to content

MirkoAvramovic/FastAPI_postgreSQL_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI PostgreSQL App

Python FastAPI PostgreSQL

This is a sample FastAPI application with a PostgreSQL database backend. It demonstrates how to create a RESTful API using FastAPI and interact with a PostgreSQL database to manage users and items.

Features

  • Create, read, update, and delete users and items via API endpoints.
  • Hashed passwords for users
  • PostgreSQL database integration using SQLAlchemy.
  • Pydantic models for data validation and serialization.
  • Interactive API documentation with Swagger UI (available at /docs).

Prerequisites

  • Python 3.11 or higher
  • PostgreSQL 13.4 or higher

Getting Started

Clone this repository:

git clone https://github.com/yourusername/FastAPI_postgreSQL_app.git

Change to the project directory:
cd FastAPI_postgreSQL_app

Install project dependencies:
pip install -r requirements.txt

Configure the database connection in sql_app/database.py:
SQLALCHEMY_DATABASE_URL = "postgresql://yourusername:yourpassword@localhost:5432/employee_database"

Apply database migrations:
alembic upgrade head

Start the FastAPI application:
uvicorn sql_app.main:app --reload

Access the interactive API documentation at http://127.0.0.1:8000/docs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors