Skip to content

My implementation of Solita's Dev Academy Finland 2023 pre-assignment.

Notifications You must be signed in to change notification settings

niemiville/city-bike-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Helsinki City Bike App

My implementation of Solita Dev Academy Finland 2023 pre-assignment. App has PostgreSQL database, TypeScript server and React frontend. App displays data about bike stations and journeys done with Helsinki city bikes.

Installation instructions

(I used Windows 10 and 11 operating systems)

  1. Clone this git repository

Create PostgreSQL Docker container

  1. Install Docker Desktop v.4.16.3 (probably other versions work too) and keep it open
  2. Open command prompt and pull docker image for postgresql with command docker pull postgres (Postgre version 15.1-1.pgdg110+1)
  3. Create and run postgres container and user with command docker run --name postgresql -e POSTGRES_USER=myusername -e POSTGRES_PASSWORD=mypassword -p 5432:5432 -d postgres
  4. Start the container if not already

Install Node dependencies

  1. Run command npm install in directories city-bike-app/backend and city-bike-app/frontend

Set environment variables

  1. Set environment variables to .env files in city-bike-app/backend directory and make sure city-bike-app/frontend/src/services/services.js file has same port in the api url (4000 by default).
    (I will leave .env file to the repository because this app is only run locally right now so it is easier to initialize the app. Unless you changed the PostgreSQL container's credentials or other settings, the current .env values should be good. If the app is run online, database credentials should be changed and .env keep hidden.)

Initialize the database

  1. Download the journey data and station data from its original sources.

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

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

  1. Place journeys .csv files to directory city-bike-app/backend/data/journeys and station data to directory city-bike-app/backend/data/stations
  2. In city-bike-app/backend directory run the command npm run initdb to create the database tables and send the data from .csv files to database. Journeys data will be also filtered. Make sure that the container is running. Initializing the database will take few minutes (about 2 mins on my laptop).

Start the app

  1. Start backend with command npm run dev in directory city-bike-app/backend
  2. Start frontend with comman npm start in directory city-bike-app/frontend
  3. Go to http://localhost:3000/ to test the app.

Implemented features

All the recommended features plus pagination for journey and station view. No tests have been done.

Chosen technologies

TypeScript for backend, PostgreSQL for database and React for frontend.

About

My implementation of Solita's Dev Academy Finland 2023 pre-assignment.

Resources

Stars

Watchers

Forks