Coder Social home page Coder Social logo

bookstore's Introduction

BookStore

This is a service that can help you to manage your book reserves.

Requirements

  • Ubuntu 18.04 (or any other debian based distro)
  • Python 3.6.12
  • sqlite3
  • pyenv
  • make

This project uses Makefile as automation tool.

System requirements:

The common libraries you may need for this build to work properly:

sudo apt-get install -y make build-essential libssl1.0-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl git sqlite3

See https://github.com/pyenv/pyenv/wiki/Common-build-problems for other platforms and more information.

Set-up Virtual Environment

The following commands install and set-up pyenv tool (https://github.com/pyenv/pyenv) used to create/manage virtual environments:

git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
exec "$SHELL"
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
exec "$SHELL"

After that, access the project directory and execute...

make install-python
make create-venv

... to install python version and create the virtual environment.

Run

For run and access the swagger, execute make run. This will start the server on port 5000. You can access at http://127.0.0.1:5000.

Tests and code convention

First export the following env:

export PYTHONPATH=.

... or if you prefer:

echo 'export PYTHONPATH=.' >> ~/.bashrc
source ~/.bashrc
  • For code-convention, execute make code-convention.
  • For tests, execute make test.

DB pre-load

For populate your database with books and clients, please run:

sqlite3 bookstore.db < db-init-load.sql

bookstore's People

Contributors

rrjoaofrancisco avatar

Watchers

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