Skip to content

A RealWorld backend implementation using Python / AIOHTTP / SQLAlchemy / asyncpg / the Clean Architecture / ⚓️

License

Notifications You must be signed in to change notification settings

stkrizh/realworld-aiohttp

 
 

Repository files navigation

RealWorld Example App

CI pipeline

Python / AIOHTTP codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully fledged backend application built with AIOHTTP including CRUD operations, authentication, routing, and more.

For more information on how this works with other frontends/backends, head over to the RealWorld repo.

Getting started

Ensure that you have Docker installed on your system. Clone the repository and switch to the main branch. To run end-to-end tests, use the following command:

make e2e-tests

This command will build, pull, and start the necessary containers required for the end-to-end tests.

The OpenAPI Specification is available on http://localhost:8080/api/docs

To stop the running containers:

make down

How it works

This implementation follows the principles of the Clean Architecture and highly inspired by the fantastic book Architecture Patterns with Python.

clean_architecture.png

The conduit.core package does not depend on any infrastructural concerns. It represents the business logic of the application. Implementations of all API endpoints are located in the conduit.api package. These implementations use UseCase classes from the conduit.core to perform business logic.

Packages

The project uses the following packages:

  • AIOHTTP - Asynchronous HTTP Client/Server for asyncio and Python.
  • SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper.
  • asyncpg - A fast PostgreSQL Database Client Library for Python/asyncio.
  • Dependency Injector - Dependency injection framework for Python.
  • Dynaconf - Configuration Management for Python.
  • structlog - The production-ready logging solution for Python.
  • mypy - Optional static typing for Python.
  • Ruff - An extremely fast Python linter and code formatter, written in Rust.
  • pytest - A mature full-featured Python testing tool that helps you write better programs.

About

A RealWorld backend implementation using Python / AIOHTTP / SQLAlchemy / asyncpg / the Clean Architecture / ⚓️

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.5%
  • Other 0.5%