Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

tooniez/fastapi-streamlit

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 (c) 2024 tooniez.
This project is MIT licensed.

About

Full-stack application with a FastAPI backend and a Streamlit frontend

Topics

Resources

Readme

License

MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

Contributors