Skip to main content

A simple FastAPI webserver with a bunch of useful resources.

Project description

FastAPI WebServer

This is a wrapper of a FAST API application with some additional features that might be useful for quick web development.

It features:

  • Powerful environment and settings handling with Dynamic module import like Django;
  • A Database Adapter to connect to any database on-the-fly;
  • A Data Migration Tool, to run .sql files, or migrate json data;
  • An SMTP service, implemented on top of fastapi-mail;
  • SASS Compiler;
  • Server-Side Rendering via Jinja2Template;
  • Static Files provider;
  • CORS Support;
  • TLS Support + mkcert certificates (local/development only)

Roadmap

The following features are expected to be implemented in the future. Contribution is welcome.

  • OCI-Compliant Image for Docker/Podman
  • Local Key-Value Cache
  • Logging and Tracing API (via OpenTelemetry)
  • Authentication and Authorization
  • Traffic Analyzer
    • (AI) Bot detector
    • VPN detector
    • Rate limiter
    • IP-based Access-Control List (ACL)
  • Content Providers (HTTP client and proxy)
    • Google Fonts API
    • Gravatar
    • GIPHY

Getting Started

Optionally, set up the environment variables. All environment variables can be found on .env file in the root of this repository.

import webserver
from fastapi import APIRouter, FastAPI

router: APIRouter = APIRouter()
app: FastAPI = webserver.app


@router.get("/")
def index():
  return {"Hello World": f"from {webserver.settings.APP_NAME}"}


app.include_router(router)

if __name__ == "__main__":
  webserver.start()

This enables both local execution through main method as well as fastapi (dev|run) commands.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_webserver-0.4.6.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_webserver-0.4.6-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_webserver-0.4.6.tar.gz.

File metadata

  • Download URL: fastapi_webserver-0.4.6.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for fastapi_webserver-0.4.6.tar.gz
Algorithm Hash digest
SHA256 a1d0af49a273ccc929e56d71f7930fde1abfd4d546570f55b8db3a06f2efaeb0
MD5 8a49cd577bed11e192620cdbf892f8f0
BLAKE2b-256 48a3d03574ac92b549d8faae14c45fb86c6966b5ec3619a98a8f972edecd1c12

See more details on using hashes here.

File details

Details for the file fastapi_webserver-0.4.6-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_webserver-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 02417afbb122501709e44134a55b1e7fb40baa9d1315a538627e94b01e863e33
MD5 8e859728eed30f04ffcc1cb8d192c867
BLAKE2b-256 5981926dc838734c326e9739b8aa341fb01769a305bcc4468fcaf73fe32c82bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page