Code Monkey home page Code Monkey logo

applifting-api's Introduction

APPLIFTING API A REST API JSON Python microservice that allows user to browse a catalog and automatically updates prices from offer service.

To deploy on a local machine I advise to create a virtual environment, if you don't know how it's done refer to this documentation https://docs.python.org/3/library/venv.html. (There are other libraries but I used this one, I guess it's ok to use any of the other)

After you cd to the directory, activated the virtual environment you need to install the requirements, easy peasy do it launching this command 'pip install -r requirements.txt' from your terminal (with venv activated).

Once you have installed the requirements open a python CLI and run:

from models import db

from main import create_app

app = create_app()

app.app_context().push()

db.create_all()

This will initialize the sqlite database you need to play with the api.

To run the server run from your terminal: 'python (or python3 on mac and Linux) app.py runserver'

Take notice that the default mode is development mode with the debug active. If you prefer to run in production or testing mode just change the mode in app.py and main.py from 'DevConf' to 'ProdConf' or 'TestConf'.

Framework= FLASK

Database= SQLite

Product Schema:

uuid = Integer

ID = integer, unique, Primary Key, required

Name = string, required

Description = string

Relationship = 1 product to many offers

Offer Schema:

product_ID = integer, Foreign_key--> product.id

id = integer required

price = integer

stock = integer

First time using Flask for an API, as of today 2/12/2021 I'm still trying to solve some issues especially with module flask_sqlalchemy that doesn't get recognized from import statements even if its installed both in the venv and on the computer.

applifting-api's People

Contributors

mikeburton89 avatar

Watchers

 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.