- NodeJs
- Express
- Typescript
- ReactJs
- Material UI
- React-leaflet
- MongoDB ##3 Testing
- Cypress for E2E testing
For the project download 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.
License and information: https://www.avoindata.fi/data/en/dataset/hsl-n-kaupunkipyoraasemat/resource/a23eef3a-cc40-4608-8aa2-c730d17e8902
Docker-compose.yml file contains all dependencies for the application.
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
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 can be run in frontend folder ./react-client
npm test
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 runningnpx cypress open
-
-
Data Import
- Data validation
- Journeys with duration less than 10 seconds and Journeys with covered distance less than 10 meters are not imported
-
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.
- Add Journey
- Form Validation
- Redirection
- Station List
- List all the stations
- Pagination
- Ordering by ascending or decending columns.
- Add Station
- Form Validate
- Redirection
- 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
- Dockerization of the Applicatin
- End to End Testing with Cypress
- Readme