Giter Club home page Giter Club logo

falcon-restful-api-boilerplate's Introduction

Falcon RESTful API boilerplate

It is sample RESTful API project using Falcon framework.

Project structure

  • alembic - database migrations toolkit directory. All migrations are stored in alembic/versions folder.
  • docs - documentation images and other stuff
  • middlewares - falcon middlewares
  • models - SQLAlchemy models
  • resources - falcon resources
  • schemas - marshmallow schemas
  • utils - all other functions

Features

  • SQLAlchemy ORM - SQL toolkit
  • Alembic - database migrations
  • Marshmallow - object serialization/deserialization and requests validation

Database schema

alt text

Endpoints

Endpoint Method Request body Description
/api/ GET None Returns status of an API
/api/groups GET None Returns all groups
POST Fields by GroupSchema Creates new group
/api/groups/{id} GET None Returns single group
PATCH Partial fields by GroupSchema Updates group data
DELETE None Deletes group
/api/items GET None Returns all items
POST Fields by ItemSchema Creates new item
/api/items/{id} GET None Returns single item
PATCH Partial fields by ItemSchema Updates item data
DELETE None Deletes item
/api/group/{group_id}/items GET None Returns single group all items
/api/group/{group_id}/items/{item_id} POST None Assigns item to a group
DELETE None Deletes item from a group

Install and run

  • Clone repo git clone [email protected]:tomasrasymas/falcon-restful-api-boilerplate.git
  • Install libraries pip install -r requirements.txt
  • Create database
    • Create alembic migration file alembic revision --autogenerate -m "Groups and items". It will generate file into alembic/versions
    • Write changes to database alembic upgrade head
    • After that sample.db will be created in your root project directory
  • Execute app.py. It uses wsgiref sample server to expose API on 8080 port

falcon-restful-api-boilerplate's People

Contributors

tomasrasymas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.