Skip to main content

A learning project - ASGI web framework built to understand async Python patterns

Project description

Velocix

Velocix Logo

A learning project where I rebuilt Starlette's core patterns to understand how modern async Python web frameworks work.


What This Is

  • A study project built during my B.Tech CSE studies
  • Heavily inspired by Starlette's architecture and patterns
  • An exercise in understanding ASGI and async Python
  • A way to learn performance optimization concepts
  • A minimal framework experiment

What This Is NOT

  • A production-ready framework
  • Faster than existing solutions (FastAPI/Starlette)
  • Something you should use instead of established frameworks
  • A unique or groundbreaking implementation

What I Learned

  • How ASGI works under the hood
  • Async Python patterns and best practices
  • Why performance optimization requires actual measurement, not assumptions
  • How routing, middleware, and request handling work internally
  • That framework overhead is usually negligible compared to database queries and business logic
  • The importance of honest benchmarking and documentation

📦 Installation

Prerequisites

  • Python 3.10 or higher
  • pip

Install Dependencies

pip install -r requirements.txt

Core Dependencies

  • orjson - Fast JSON serialization
  • msgspec - Fast validation and serialization
  • httptools - HTTP request parsing
  • Any ASGI server (uvicorn, granian, hypercorn)

🚀 Quick Start

from velocix import Velocix
from velocix.core.response import JSONResponse

app = Velocix()

@app.get("/")
async def hello():
    return {"message": "Hello World"}

@app.get("/users/{user_id}")
async def get_user(user_id: int):
    return {"user_id": user_id}

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000)

🏗️ Code Structure

velocix/
├── core/           # Core ASGI application and routing (based on Starlette patterns)
├── http/           # HTTP utilities
├── middleware/     # Middleware implementations
├── security/       # Authentication and security utilities
├── validation/     # Request validation (msgspec)
├── websocket/      # WebSocket support
├── monitoring/     # Health checks and metrics
└── testing/        # Test client utilities

📚 Documentation


🤝 Contributing

This is a learning project, but if you find it useful or want to suggest improvements, feel free to open an issue or PR.


🙏 Acknowledgments

This project is heavily inspired by:

  • Starlette - Most patterns and architecture are based on Starlette's design
  • FastAPI - For the elegant decorator-based API
  • msgspec - For fast validation
  • orjson - For efficient JSON serialization

Special thanks to the authors of these frameworks for their excellent documentation and open-source code that made this learning project possible.


📖 Learning Resources

If you want to build something similar, I recommend:

  • Reading Starlette's source code (it's very well written)
  • Understanding the ASGI specification
  • Studying async Python patterns
  • Actually measuring performance instead of assuming optimizations work

📄 License

MIT License - See LICENSE file for details


Built as a learning exercise by a CSE student

A minimal framework experiment - use Starlette or FastAPI for real projects.

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

velocix-0.1.1.tar.gz (67.5 kB view details)

Uploaded Source

Built Distribution

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

velocix-0.1.1-py3-none-any.whl (78.2 kB view details)

Uploaded Python 3

File details

Details for the file velocix-0.1.1.tar.gz.

File metadata

  • Download URL: velocix-0.1.1.tar.gz
  • Upload date:
  • Size: 67.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for velocix-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1907856e16bce27bb256b151c2e0c64d8e3136aa4b6c038554b03054676e278d
MD5 81f593bec12557ab576ac85872082608
BLAKE2b-256 dead3a5a4d0f9d83ca412f0aa9fc69527ea3788df725bc5064998ccb5caf0dbd

See more details on using hashes here.

File details

Details for the file velocix-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: velocix-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 78.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for velocix-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 343bb1ddc34ebccbc777ac04ceabb1017185ed493b75c2827cac78da19eca9d9
MD5 0827fd7ef6446ba0de38cb50e679c90e
BLAKE2b-256 f5815c112646590901efb3596336a87d36fad6d40408a2322c08b75988f13772

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