Skip to content

asimx07/HelsinkiBikeApp2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HELSINKI BIKE APP

Techstack

Backend

  • NodeJs
  • Express

Frontend

  • Typescript
  • ReactJs
  • Material UI
  • React-leaflet

Database

  • MongoDB ##3 Testing
  • Cypress for E2E testing

Data

For the project download datasets of journey data. The data is owned by City Bike Finland.

Journey Data File 1

Journey Data File 2

Journey Data File 3

Also, there is a dataset that has information about Helsinki Region Transport’s (HSL) city bicycle stations.

Station File

License and information: https://www.avoindata.fi/data/en/dataset/hsl-n-kaupunkipyoraasemat/resource/a23eef3a-cc40-4608-8aa2-c730d17e8902

Running in Docker

Docker-compose.yml file contains all dependencies for the application.

Adding Data

Add downloaded csv files of journeys in ./server/data/journeys and stations in ./server/data/stations. Don't forget to remove add_journeys_csv_here and add_stations_csv_here files from the folders

Running The Project

docker-compose up --build

This will start up all the instances required. First let the mongo-import to import all the data into mongodb. Once all the data is inserted this instance will exit. You can then use the application

Backend will run on localhost:3000 Frontend will run on localhost:5000

by default. Changes can be made in docker-compose.yml file.

Note: You can disable mongo-import configuration from docker-compose.yml file if you wish NOT to import data again once it is already imported. Make sure you also change depends on from mongo-import to mongo in backend and frontend configurations.

Tests

Tests can be run in frontend folder ./react-client

npm test

Running Locally

This application can be run locally by setting up environment and adding dependencies.

  • Setup mongodb server Setting up MongoDb server Locally

  • Data is being imported through MongoImport. Install mongoimport and set environment path

  • Backend:

    • Add the downloaded csv data into ./server/data/journeys and ./server/data/stations.Don't forget to remove add_journeys_csv_here and add_stations_csv_here files from the folders

    -cd ./server/

    • create .env like provided example.env in ./server or you can simply rename the example.env to .env

    -Run npm install Note: Node 16 or latest is required.

    -Run node ./scripts/import.js and wait for import.js script to finish importing all the data

    -Run npm run start to start the server

  • Frontend

    -cd ./react-client

    -Run npm install

    -Run npm run dev to start the frontend.

  • Testing

    • cd ./react-client

    • Run npm test to run cypress E2E tests in terminal or you can also open Cypress UI by running npx cypress open

Features:

  1. Data Import

    • Data validation
    • Journeys with duration less than 10 seconds and Journeys with covered distance less than 10 meters are not imported
  2. Journey List

  • List All Journeys with departure and return stations, covered distance in kilometers and duration in minutes - Pagination - Ordering by ascending or descending columns.
  1. Add Journey
    • Form Validation
    • Redirection

  1. Station List
    • List all the stations
    • Pagination
    • Ordering by ascending or decending columns.

  1. Add Station
  • Form Validate
  • Redirection

  1. Single Station List
    • Listing Station Name, Address, Total number of journeys ending and starting from that station
    • Map View
    • The average distance of a journey starting from the station
    • The average distance of a journey ending at the station
    • Top 5 most popular return stations for journeys starting from the station
    • Top 5 most popular departure stations for journeys ending at the station

Additional Features

  • Dockerization of the Applicatin
  • End to End Testing with Cypress
  • Readme

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published