Train price monitoring WebApp that sends notifications to users when prices increase above a certain threshold, built on a serverless and low-cost tech stack using React, TypeScript, GraphQL, Docker and AWS services such as API Gateway, Lambda, DynamoDB, S3, SQS, and SNS.
- Find train journeys between two locations (currently only for Deutsche Bahn in Germany)
- Monitor train ticket prices of selected journeys
- Get notified when the ticket price of a journey exceeds a certain threshold
- Sign up and log in securely
- Responsive design for mobile and desktop
The easiest way to get in touch with this project is by opening it in Gitpod:
If you prefer to get a local copy of the project up and running, follow these steps:
- Clone the repository:
git clone https://github.com/wolfm89/train-price-monitor.git
cd frontend
- Install dependencies:
npm install
- Start the development server:
npm run start
This will start the frontend. In order to deploy the infrastructure to your AWS account, run the following:
cd infrastructure
- Install CDK with
npm install -g aws-cdk
- Bootstrap your AWS account:
cdk bootstrap aws://ACCOUNT-NUMBER/us-east-1 aws://ACCOUNT-NUMBER/REGION
- Deploy the infrastructure:
npm run cdk deploy
- In the CDK output you should note down the values for
FrontendCloudFrontUrl
,BackendQueueUrl
andBackendProfileImageBucketName
The backend can be started by executing the following steps:
cd backend
- Install dependencies:
npm install
PROFILE_IMAGE_BUCKET_NAME=<Bucket name from CDK output> TPM_SQS_QUEUE_URL=<SQS queue URL from CDK output> npm run dev
To use the application, simply sign up and log in. Then, on the search page enter the departure and arrival locations, the desired date and time of travel, and search for journeys. Select the preferred journey by pressing "Watch" and enter the threshold price. On the journeys page you can always find all your monitored journeys along with the current price. Train Price Monitor will periodically (hourly) check the ticket prices and notify you when the price exceeds your threshold. The notifications are shown in the header bar and can be accessed by clicking on the bell icon. For convenience, they are also sent to your email address.
Frontend:
- React
- TypeScript
- Material-UI
- AWS SDK
- AWS Cognito
- urql
Backend:
- Express
- GraphQL Yoga
- Serverless
- DynamoDB
- AWS S3
- AWS SQS
- AWS SES
- AWS Lambda with Docker
- AWS API Gateway
Contributions are welcome! To contribute to this project, please follow these steps:
- Fork the repository
- Create a new branch for your feature:
git checkout -b feature/feature-name
- Make your changes and commit them:
git commit -m 'Add some feature'
- Push your changes to your fork:
git push origin feature/feature-name
- Submit a pull request