/PedalPals-Backend

Flask Backend for SC2006 Project: PedalPals

Primary LanguagePython

image

PedalPals

Frontend | Backend | Demo Video

PedalPals-Backend

This is the backend repository for PedalPals. Built on Flask, and MongoDB. Hosted on Railway

About the Project

PedalPals is not simply a navigation tool, it is a platform aiming to cultivate a connected community of cycling enthusiasts. Through the seamless integration of OneMap, Google Maps and data.gov.sg, PedalPals seeks to empower users, providing them with the essential tools to explore, appreciate, and revel in the dynamic cycling landscape that Singapore has to offer.

Tech Stack

  • React Native
  • Flask Server
  • MongoDB
  • Google Maps API, One Maps API

Class Diagram

image

Notable Sequence Diagrams

Finding Nearby Cyclists

image

Querying Suitable Cycle Routes

image

Prerequisites

Before you begin, make sure you have the following installed on your system:

  • Python (version 3.9.7)
  • pip (Python package manager)

Setting Up a Virtual Environment

It's a good practice to work in a virtual environment to keep project dependencies isolated. To set up a virtual environment, follow these steps:

  1. In the root directory of the project, create a new virtual environment:

    python -m venv env

    This will create a new directory called `env

  2. Activate the virtual environment:

    source env/bin/activate

    This will change your terminal prompt to indicate that you're working in the virtual environment.

  3. Install the project dependencies:

    pip install -r requirements.txt

    This will install all the dependencies listed in the requirements.txt file.

  4. Setup Config Files by creating a config.py at the given directories that contains the following:

    # app/utils/config.py
    GOOGLE_MAPS_API = 'YOUR_API_KEY'
    EMAIL = 'EMAIL USED FOR ONEMAPS ACCOUNT'
    PASSWORD = 'YOUR_PASSWORD>'

    Note that you will need to register for the OneMap API

    # app/config.py
    class Config:
        MONGO_URI = ''
        JWT_SECRET_KEY = '' 
  5. Run tests by running the following command:

    pytest