GithubHelp home page GithubHelp logo

keyology / proton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 1x-eng/proton

0.0 1.0 0.0 1.59 MB

High-level python framework that facilitates rapid server-side development with clean & pragmatic design!

License: BSD 3-Clause "New" or "Revised" License

Python 92.75% Shell 7.25%

proton's Introduction

PROTON Logo

PROTON

The MIC stack genesis!

PROTON is a high-level Python framework that facilitates rapid server-side development with clean & pragmatic design. Thanks for checking it out!

PROTON aims at easing server-side development for all Python enthusiasts. Essentially, by running a shell command, developer will auto generate necessary Model, Controller and APIs! All of this with connectivity to Transactional Databases (PROTON supports Postgresql, MySQL & SQL Server),caching (Redis middleware), Auto generated OpenAPI specs & descriptive logging! One command, to get a production ready server-side stack!

Getting Started

  • Install postgres on your local machine. sudo apt-get install postgresql
  • Edit connection parameters for PROTON to achieve db connectivity @ databaseConfig.ini
  • Clone PROTON using git clone https://github.com/PruthviKumarBK/PROTON.git
  • Create a virtual environment. (If using anaconda, conda create -n <env name> python=3)
  • cd PROTON
  • pip install -r requirements.txt
  • PROTON relies on Redis for caching. Install redis using sudo apt-get install redis-server
  • That's it! You are ready to create your first MIC (Model, Interface, Controller) stack!

Example

Generate a new MIC stack named testMic : ./protongen.sh -n testMic -p 3000

PROTON MIC stack for testMic

Your code base will now include, dynamically generated content for testMic all the way from Model, Controller & Interface!

PROTON MIC stack for testMic

PROTON will dynamically generate an API for every method defined in the controller for testMic. Right now, there is a method named schemaInformation within controller_testMic.py for testMic. Convention for generated route will be <get_micName_controllerMethod>. Go to, localhost:3000/get_testMic_schemaInformation; you will see the schema information for connected database in postgresql! This is the default code auto-generated by PROTON for every new MicStack

PROTON MIC stack API

PROTON MIC stack API for testMic

For every auto generated route, cache will steer PROTON on steroids for subsequent get calls! Each entry in cache will live upto a day! You can change this lifespan by editing CACHE_LIFESPAN within PROTON's configuration.py

PROTON MIC stack API Cache

PROTON MIC stack Cache

Now, when you want to add a new method/expose newer APIs within testMic, all you should be doing is write SQL and create a method within PROTON's respective MIC stack.

PROTON MIC Adding Newer Methods

With newer method now in place, to generate API, all you do is issue this one command: ./protongen.sh -s yes

PROTON MIC NewMethod API

Newly generated route will also get cache settled!

PROTON MIC NewMethod at root

PROTON MIC Cache for NewMethod

PROTON MIC Cache for NewMethod

Generating a new MIC stack will leave existing stack unaltered.

PROTON MIC generating new stack

PROTON MIC NewMethod at root

Trace for PROTON stack will be enabled throughout. Checkout ./trace/ directory.

PROTON Trace

PROTON Trace Logs

PROTON also ships with ability to automagically generate OpenAPI specs!

PROTON OpenAPI

PROTON OpenAPI

Should you want to delete from existing PROTON MIC stack, you stand one command away! Like Generator, PROTON also ships with Destroyer which pragmatically clears the desired MIC from PROTON stack. (This will also clean the Cache entries automagically; only for mic that is targeted to be killed.)

./protonkill.sh -k <micName>

PROTON destroyer

PROTON will continue to perform/live with remaining MIC stack after destroyer completing its job!

PROTON After destruction of testMic

NOTE: PROTON uses Gunicorn as High Performance Server. Gunicorn is built to utilize kernel features of Unix/Linux machines. Hence, PROTON will be seamless on Unix/Linux platforms. On Windows, PROTON will require fallback to another WSGI server which is Work In Progress at this moment.

Features in active development:

  • Support for MySql, SqlLite and SqlServer relational databases.
  • Pipelines to transfer form and to datawarehouse to database. Support for GCP's bigQuery and AWS's RedShift in progress.
  • containerization of PROTON. Docker build and Kubernetes deployable PROTON!
  • Auto generated Swagger UI from PROTON generated openAPI specs.

Support

For any feedback or issues write to Pruthvi @ [email protected]. Ensure to have a valid subject line, detailed message with appropriate stack trace to expect prompt/quick response.

Tags

0.0.1 - PROTON confirms to PEP8 standards.

0.0.2 - Cache is unique not only per route but to query params per route.

License

BSD 3-Clause License

Copyright (c) 2018, Pruthvi Kumar All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

proton's People

Contributors

1x-eng avatar

Watchers

James Cloos 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.