Skip to content

sirbh/helsinki-city-bike

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helsinki City Bike App

An application where you can view journey details and station details generated by bikes in Helsinki Capital area.

Dataset is downloaded from here:

License and Other helpful info:

Features

Journey list view

  • List journeys data.
  • For each journey departure and return stations, covered distance in kilometers and duration in minutes has been shown

Additional

  • Pagination
  • Ordering per column
  • Searching
  • Filtering

Station list

  • List all the stations

Additional

  • Pagination
  • Searching

Single station view

  • Station name
  • Station address
  • Total number of journeys starting from the station
  • Total number of journeys ending at the station

Additional

  • Station location on the map
  • 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

Other things done

  • Endpoints to store new bicycle stations after authenticating
  • Dockerization of app
  • Authentication
  • Implemented E2E tests
  • UI for Adding bicycle stations
  • Station deletion by user who created it

Deployment

Project has been deployed using fly.io Live URL: https://helsinki-city-bike.fly.dev/

CI pipeline has been setup using github actions: https://github.com/sirbh/helsinki-city-bike/actions

Tech used

Backend

Frontend

Storage

Testing

Running the app

Docker can be used to setup the dev environment. Make sure you have docker installed and running. Sql script is present in db/init.sql which perform validation on data before presenting.

First copy following files in db/files of project root.

To start dev server simply run the following command in terminal opened in root of project directory:-

docker compose -f docker-compose.dev.yml up

after running the above command the app will be live on http://localhost:3000/

  • stop and rerun backend container if app shows error message.

Running the tests

For testing separate docker file has been created. To run the test simply run the following command in the root.

docker compose -f docker-compose.test.yml up -d

The above command will setup the test environment in docker To run test start container backend-test in interactive mode using following command

docker exec -it backend-test bash

After running above command you can access the terminal to the already running backend server

  • Unit test can be run by npm run test
  • End-to-end test can be run by npm run test:e2e

There is a sql file in test-db/init.sql which add few records of data required for testing. Output of both the test command can also be viewed on github action page.

time keeping

-https://github.com/sirbh/helsinki-city-bike/blob/master/timeKeeping.md

Further scope of improvements

I plan to further enhance this application; however, I have already invested over 175 hours in its development, and therefore, I am submitting it.

  • Functionality to add stations with help of GooglePlaces API.
  • Functionality to add journeys.
  • Cypress test can be moved into its own folder.
  • Performance can be improved using hooks like useMemo and useCallback.
  • Adding authentication so that only some privileged user can add stations and journeys.
  • More validations can be added to database.
  • Relations can be added to database.
  • Swagger can be added for API management.
  • API security can be added as at the moment anyone can access the API.

About

Helsinki City Bike Application

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages