Skip to content

outhanchazima/bookstore-inventory-management-system

Repository files navigation

bookstore-inventory-management-system

A book store management system

Bookstore is an API for managing a book store inventory.

Technology Stack

Backend

Getting Started (Detailed without Docker)

  1. Make sure you have the following installed on your machine:
  • Git: Windows, Mac. (Linux users should install using their system's package manager)
  • Python 3.8.10
  • Postgres Database 13 and above.
  • make sure you have pip and virtualenv installed.

Part One

Intiallizing postgres database

CREATE USER bookstore WITH PASSWORD 'bookstore';
CREATE DATABASE bookstore;
GRANT ALL PRIVILEGES ON DATABASE bookstore TO bookstore;

Part Two: Terminal commands

Clone the repo:

git clone 

Change directory

cd bookstore-inventory-management-system

Alternative 1

Note: make sure you have pip and virtualenv installed.

Initial installation: make install

To run test: make tests

` To run application: make run

To run all commands at once : make all

Make sure to run the initial migration commands to update the database.

> python3 manage.py db init

> python3 manage.py db migrate --message 'initial database migration'

> python3 manage.py db upgrade

Alternative 2

Create virtualenv:

python3 -m venv venv

Activate the virtual environment

source venv/bin/activate

Install the requirements

pip3 install -r requirements.txt

Run the application

python3 manage.py run

Run the application: PRODUCTION Mode

gunicorn manage:app --worker-class gevent --bind 0.0.0.0:5000 --log-level info

To run tests

Run the command in alterative to and before you run the application run below command

python -m pytest -v