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 SQL Migration Tool, to run .sql files;
  • An SMTP service, implemented on top of fastapi-mail;
  • 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.

from webserver import app, settings  # A FastAPI app
from fastapi import APIRouter

router: APIRouter = APIRouter()

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

app.include_router(router)


if __name__ == "__main__":
    from webserver import server
    server.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.2.0.tar.gz (12.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.2.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_webserver-0.2.0.tar.gz
  • Upload date:
  • Size: 12.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.2.0.tar.gz
Algorithm Hash digest
SHA256 8e2fc3cfe40c11fbb0c6eef5a1cbf91ff9ec6fc6adaf11614054350810cf0e4f
MD5 fc3ab3a0d58c403fd9dfcac8b8ae0ac9
BLAKE2b-256 584a0d4893fea54376476bd9e0b3da65d6484d676968aaf5dc69bf6aae9bc1b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_webserver-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ab8d1d856c298adad2f6a9bad5c8397bca4a066aa606ee96c7852c5fc08258e
MD5 e006bdb0e8a96b7aa93b643d54c342a3
BLAKE2b-256 445d7155ec1e4ae6840a7d80907bd62c1f310cbd6a17e8da3a43b70f155c8322

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