Giter Club home page Giter Club logo

aiohttp-base's Introduction

Aiohttp Base

Build Status Python MIT License

An extensible Aiohttp Restful API template. You can just clone this repo and start to create/customize your own RESTful API using this code as your template base :)

Getting Started

Installing

To install the Aiohttp Base you will need to:

git clone https://github.com/alefeans/aiohttp-base.git && cd aiohttp-base
pip install -r requirements.txt

Usage

Development

python run.py

Docker

Build

docker build -t aiohttp-base .

Start a New Container

docker run -d \
--name aiohttp-base \
-p 5000:5000 \
aiohttp-base

Swagger

After the application goes up, open your browser on localhost:5000/api/v1/docs to see the self-documented interactive API:

Project Structure

├── app
│   ├── __init__.py
│   ├── routes.py
│   └── views.py
├── config.py
├── Dockerfile
├── LICENSE
├── README.md
├── requirements.txt
├── run.py
├── tests
│   ├── conftest.py
│   ├── __init__.py
│   └── views
│       ├── __init__.py
│       └── test_views.py
└── tox.ini

Folders

  • app - All the RESTful API implementation is here.
  • tests/ - tests modules executed on the CI/CD pipeline.

Files

  • app/__init__.py - The Aiohttp Application factory (create_app()) and it's configuration are done here.
  • app/routes.py - The routes setup lives here.
  • app/views.py - The API endpoints (basic views).
  • config.py - Config file for envs, global config vars and so on.
  • Dockerfile - Dockerfile used to build a Docker image (using Docker Multistage Build)
  • LICENSE - MIT License, i.e. you are free to do whatever is needed with the given code with no limits.
  • tox.ini - Config file for tests using Tox.
  • .dockerignore - Lists files and directories which should be ignored while Docker build process.
  • .gitignore - Lists files and directories which should not be added to git repository.
  • requirements.txt - All project dependencies.
  • run.py - The Application entrypoint.

Tests

To run the automated tests:

# rull all tests stages (with '-q' for a better output)
tox -q

# run only lint stage
tox -q -e lint

# skip lint stage
tox -q -e py37

To do

  • API versioning

License

This project is licensed under the MIT License - see the LICENSE file for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.