Contains the source code for the service rata.digitraffic.fi/history/
- Clone the repository:
git clone https://github.com/tmfg/digitraffic-rail-history-private.git
- Create the database and run migrations:
cd db docker compose up -d # or ./db-rm-build-up.sh
- Create the file
train-history-updater/src/main/resources/application-localhost.properties
and include the db connection properties. The database username and password can be found indb/docker-compose.yml
asMYSQL_USER
andMYSQL_PASSWORD
.spring.datasource.username=JOTAIN spring.datasource.password=JOTAIN spring.datasource.url=jdbc:mysql://localhost/trainhistoryjson?autoReconnect=true&rewriteBatchedStatements=true&cachePrepStmts=true&useTimezone=true&serverTimezone=UTC&useSSL=false
- Do the same for
train-history-backend/src/main/resources/application-localhost.properties
- Start
TrainHistoryUpdaterApplication
using the profilelocalhost
mvn spring-boot:run -Dspring-boot.run.profiles=localhost
and you should start getting data into the database. - Start
TrainHistoryBackendApplication
using the profilelocalhost
mvn spring-boot:run -Dspring-boot.run.profiles=localhost
- Install
ng
if necessary:npm install -g @angular/cli
- Go the the directory
train-history-web
and runnpm install
- Start the web UI with
npm run dev
-> connects to rata.digitraffic.fi, or usenpm run dev:local
. The difference is which proxy file is used.dev
uses rata.digitraffic.fi APIs while local connects to the locally running application. - Open a browser at http://localhost:4200/
When the development environment is set up, including the database and application profile, run:
cd train-history-backend
mvn test -Dspring.profiles.active=localhost
The history service consists of three components:
- train-history-web
- Web application
- train-history-backend
- Backend system for the web application
- train-history-updater
- Fetches and stores historical data for the backend application to read