Giter Club home page Giter Club logo

listing_service's Introduction

Listing MicroService

Mysql

docker pull mysql:latest
docker images
docker run -itd --name mysql-test -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql
docker ps

Connect

mysql -u root -p -h 127.0.0.1

Init

source ./sql/config.sql

Check

SHOW DATABASES;
use listing;
SHOW TABLES;
SELECT * FROM listing;

About Listing service

  1. get all listings api does not require authentication to verify consistency between users, but still need to provide a valid access token
  2. For C,U,D on specific listing, authentication is needed so that only owner of listing can make changes. To get the listing, a valid access token suffices.

How to build and run locally

  1. install deps python3 -m pip install -r requirements.txt
  2. execute script sql/config.sql to initialize the database
  3. run flask run

The application should be running on localhost:5000.

How to deploy

  1. Run eb deploy. Listing microservice is deployed on AWS elasticBeanstalk, and its database is using RDS.

Some important debugging tips about deploying

  1. when deploying, make sure the unzipping the file has application.py in it directly. If you are using PyCharm this might not be the case because of the /src directory.
  2. Make sure the naming is strictly application.py and inside the app, use application = app = Flask(..), and this is following rules of EBS.
  3. Remember to configure ENV variables on EBS too.

listing_service's People

Contributors

rl3250 avatar xzh0u avatar

Forkers

xzh0u

listing_service's Issues

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.