Skip to content

tosintubi/bookie-map

Repository files navigation

Project logo

BookieMap

Status GitHub issues GitHub pull requests License



📝 Table of Contents

🧐 About

Bookie-Map core is the backend of Bookie, a Peer to Peer Book Loan App.

💻 Tech

BookieMap is written in Python 3 and Flask 2.0.1.

⚙️ Installation

MacOS/Linux

Please install these packages and set up your environment in the order listed below. Run an upgrade or update if you find that the package is already installed:

  • Python 3. Run the 'python3 -V' command to see the version you have installed.

  • Ensure you have python version >= 3.8+ installed.

  • Using VS Code as our text editor: right click on the folder explorer and open a terminal

  • create and activate your virtual environment

python -m venv <envname>
source <envname>/bin/activate
  • Install the requirements.
pip install -r requirements.txt

That is all, you have successfully created your own virtual environment. Now you can run Python (see above) and start working on your project.

Windows 10 Users

Please install and set up the following packages first. Upgrade if you find the package is already installed:

  • Download Python3. It is advisable to install the python package as an administrator. Click on the 'Add path' checkbox before moving on to the next step of the installation process. Run this command in your terminal to see the version you have installed.

    python3 -V
  • Download pip and follow the instructions in the link as an installation guide.

  • Create virtual environment. You could use any virtualenv package of your choice but for Windows, install this virtual environment wrapper:

    python -m pip install virtualenvwrapper-win
  • Create a new virtual environment:

    mkvirtualenv <envname>
  • Activate the virtual environment with:

    workon <envname>
  • Install requirements in the virtual environment created:

    pip install -r requirements.txt

PostgreSQL

  • Install PostgreSQL.

  • Create a database with PostgresQL, the installation instructions for Fedora can be found here. Make sure to note Database name, Database Username and Password and also ensure that the server is running

  • Create a .env file in the root directory of the project and copy the content of .env.example file to it. Other values not listed below but present in the .env.example file should also be replaced with your own values in your .env file.

  • Replace DATABASE_URL with your database connection string.\

  • Run migrations command to create the tables in heroku after deployment.

    flask create_tables
  • Seed data generation. This will generate some data on your local postgresql database for testing purposes. The argument NUMBER indicates the amount of seed data to be generated. NUMBER = 1 will generate 2 User profiles (1 Borrower and 1 Lender), 2 Books (the first Book is borrowed, while second Book is available for loan). This command will also generate seed data on your heroku database if you execute this command on heroku's console.

    Note: The database need to be have been created and the DATABASE_URL environment variable is set in your .env file.

    flask generate_data [NUMBER]

Using the API Endpoint.

  • Run server to ensure everything is running properly.

    flask run
  • Refer to the API documentation

OAth Setup Intstructions

Google

  • TBD

Python installation instructions for Windows, macOS and other Linux distro Users

⛏️ Built Using

✍️ Authors

🤝 Collaboration

  • You need to have PostgresQL installed and set up on your machine.

  • Clone the repository from the staging branch and please read the contributing guide.

  • Update your environment variables by remaning the environment variables file from .env.example to .env and provide entries for the environment placeholders in the .env file.

  • To run the testcases covering various functionalities, run the following command in terminal

    python -m unittest -v

Contact Toßin for more details.

📝 License

This project is licensed under the MIT License - see the LICENSE file for more details.

About

Bookmark REST API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages