GithubHelp home page GithubHelp logo

flask_engine's Introduction

flask_engine

Flask Engine is the Turing School's Rales Engine project written in Python. It is an API returning JSON from the SalesEngine data set.

hosted at: https://flask-engine-api.herokuapp.com/

Getting Started

Versions

Python 3.6.4
Flask 0.12.2
Postgresql 9.6.3

Prerequisites

Python3
Pipenv
Postgresql

Setup

Database setup:

create database in psql:

$ psql
username=# CREATE DATABASE flask_engine;
CREATE DATABASE
\q

App Setup/Installation:

clone the repo and cd into the directory:

$ git clone [email protected]:erose357/flask_engine.git
$ cd flask_engine

install dependencies:
$ pipenv install

set the following environment variables(MacOS):

$ export FLASK_APP=run.py
$ export APP_SETTINGS=development
$ export DATABASE_URL=<YOUR_DB_PATH>

activate the virtual environment:

$ pipenv shell
Spawning environment shell (/bin/bash). Use 'exit' to leave.
bash-3.2$ source .local/share/virtualenvs/flask_engine-wL03M76k/bin/activate
(flask_engine-wL03M76k) bash-3.2$

migrate the database:

(flask_engine-wL03M76k) bash-3.2$ python manage.py db upgrade
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> 5488175015cc, empty message

seed the database:

(flask_engine-wL03M76k) bash-3.2$ python manage.py seed
merchants table seeded
customers table seeded
items table seeded
invoices table seeded
transactions table seeded
invoice_items table seeded

run the app:

(flask_engine-wL03M76k) bash-3.2$ flask run
 * Serving Flask app "run"
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

the root path gives an explanation of the currently available endpoints

flask_engine's People

Contributors

erose357 avatar

Watchers

James Cloos avatar

flask_engine's Issues

GET /api/v1/customers/:id

Each data category should include a show action which renders a JSON representation of the appropriate record

GET /api/v1/customers

Each data category should include an index action which renders a JSON representation of all the appropriate records

GET /api/v1/transactions/find_all?parameters

Each category should offer find_all finders which should return all matches for the given query. It should work with any of the attributes defined on the data type and always be case insensitive

GET /api/v1/transactions/1

Each data category should include a show action which renders a JSON representation of the appropriate record

GET /api/v1/merchants/1

Each data category should include a show action which renders a JSON representation of the appropriate record

try to reorder json

json returned from the endpoints looks to be sorted alphabetically by first letter, look into orderdict

GET api/v1/merchants/find_all?parameters

Each category should offer find_all finders which should return all matches for the given query. It should work with any of the attributes defined on the data type and always be case insensitive

GET /api/v1/transactions/find?parameters

Each data category should offer find finders to return a single object representation. The finder should work with any of the attributes defined on the data type and always be case insensitive

GET /api/v1/merchants

Each data category should include an index action which renders a JSON representation of all the appropriate records

GET /api/v1/merchants/find?parameters

Each data category should offer find finders to return a single object representation. The finder should work with any of the attributes defined on the data type and always be case insensitive

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.