Skip to content
This repository has been archived by the owner on Dec 26, 2024. It is now read-only.
/ clyde-ryde Public archive

An E-Vehicle Sharing Application for COMPSCI4084 Programming and Systems Development H - 2024-25

Notifications You must be signed in to change notification settings

siddydutta/clyde-ryde

Repository files navigation

Clyde Ryde

Table of Contents


Project Description

Clyde Ryde is an e-vehicle sharing platform that enables users to locate, rent, and return electric vehicles across various locations. The system is designed for customers to reserve vehicles, operators to manage and maintain the fleet, and managers to access usage reports. Built with Django, PostgreSQL, and Redis, Clyde Ryde provides a seamless experience for all users.

Project Artifacts

Installation and Setup (Docker)

0. Prerequisites

Ensure Docker Engine and Docker Compose are installed:

docker --version
docker-compose --version

1. Clone the Project

git clone https://stgit.dcs.gla.ac.uk/programming-and-systems-development-m/2024/lb03-04/clyde-ryde.git
cd clyde-ryde

2. Build Image and Run the Containers

docker-compose up --build

3. [Optional] Run Commands in the Web Container

docker-compose exec web python manage.py showmigrations

Usage

Users can view available vehicles, rent, and return them at selected locations. Operators manage the vehicle statuses (charging, repairing, etc.), while managers can view different reports on the usage. This repository includes commands to set up and populate the application with sample data, which can be useful for testing and demonstration. This is done automatically if installed using Docker, or can be run manually (see: Management Commands to Add Dummy Data).

Sample User Data

Username User Type Password
superuser admin password
john customer password
jane customer password
emily customer password
michael operator password
william manager password

Development Setup (Without Docker)

0. Prerequisites

  1. Install Python 3.12 Verify the installation:

    python3.12 --version
  2. Install PostgreSQL 14 Verify the installation:

    psql --version
  3. [Optional] Install Redis Verify the installation:

    redis-server --version

1. Clone the Project

git clone https://stgit.dcs.gla.ac.uk/programming-and-systems-development-m/2024/lb03-04/clyde-ryde.git
cd clyde-ryde

2. Create a Python Virtual Environment

python3.12 -m venv venv/
source venv/bin/activate  # For MacOS/Linux
venv\Scripts\activate  # For Windows

3. Install Project Requirements

pip install -r requirements.txt

4. [Optional] Create the Database & User

chmod +x scripts/init_db.sh
./scripts/init_db.sh

OR run the following SQL statements:

CREATE DATABASE "clyde_ryde";
CREATE ROLE "admin" WITH LOGIN PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE "clyde_ryde" TO "admin";

5. Install Pre-Commit Hooks

pre-commit install

6. Run the Development Server

python manage.py runserver

Management Commands to Add Dummy Data

Add Users

python manage.py add_users

Password for all users is password.

Add Locations

python manage.py add_locations

Add Vehicles

python manage.py add_vehicles --number 15

Add Trips & Payments

python manage.py add_trips --start_date 2024-10-01 --number 30

Team Members

  1. Bairui Zhou ([email protected])
  2. Chaoyue Wang ([email protected])
  3. Siddhartha Pratim Dutta ([email protected])
  4. Siwei Chen ([email protected])
  5. Tingyu Zhou ([email protected])
  6. Zhiqi Gao ([email protected])
  7. Zhiying He ([email protected])

We hope you enjoy using Clyde Ryde!

About

An E-Vehicle Sharing Application for COMPSCI4084 Programming and Systems Development H - 2024-25

Topics

Resources

Stars

Watchers

Forks