Skip to content
/ fastapi-streamlit Public template

๐Ÿ“š Full-stack application with a FastAPI backend and a Streamlit frontend

License

Notifications You must be signed in to change notification settings

tooniez/fastapi-streamlit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

FastAPI Streamlit Stack

This repository contains a full-stack application with a FastAPI backend and a Streamlit frontend.

Features

Backend (FastAPI)

  • RESTful API routes
  • CORS (Cross-Origin Resource Sharing) support
  • OAuth authentication
  • ORM integration with a database

Frontend (Streamlit)

  • User authentication (login to server)
  • Demonstration of GET requests to the API backend
  • Demonstration of POST requests to the API backend

Setup

Prerequisites

  • Python 3.9+
  • Streamlit
  • FastAPI
  • Pytest
  • Black
  • Docker

Docker Setup

docker compose up

Backend Setup

  1. Navigate to the api directory

  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Start the FastAPI server:

    uvicorn server:app --reload
    

Frontend Setup

  1. Navigate to the app directory
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Run the Streamlit app:
    streamlit run streamlit_app.py
    

Testing

  • API and Streamlit tests: Run make test

API Documentation

Once the backend server is running, you can access the API documentation at:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

License

Copyright ยฉ 2024 tooniez.
This project is MIT licensed.

About

๐Ÿ“š Full-stack application with a FastAPI backend and a Streamlit frontend

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published