Skip to content

Latest commit

 

History

History
52 lines (43 loc) · 3.1 KB

README.md

File metadata and controls

52 lines (43 loc) · 3.1 KB

velinfo

A serveless application to detect locked Velib stations (Paris' bicycle sharing system). Hosted on AWS Serveless and visible at https://www.velinfo.fr and @Velinfo1

The raw data comes from the Velib official API. Thanks to them!

Architecture

Global Architecture

The DNS records are managed through Route53.

The frontend application is built with Angular, hosted using a S3 bucket and cached through a Cloudfront Distribution.

The backend consist of several TypeScript Lambdas and Dynamo tables processing data fetched from the Velib API. The resulting data is exposed through an AWS API Gateway.

Technical stack

  • Languages : Typescript, both for the backend (AWS Lambda) and the frontend (Angular)
  • Data storage : AWS DynamoDb
  • Infrastructure / Deployment tooling : AWS SAM (superset of AWS CloudFormation dedicated to the serverless applications)
  • Main Libraries used :

Build and deploy

What do you need ?

  • NPM
  • The AWS SAM CLI
  • The Angular CLI

If you want to self host this application, it's possible. But, the SAM template expect a certain number of parameter, mainly regarding the DNS certificates and the Twitter API keys, that are obviously not included in this repo.

Backend

npm run build
sam deploy

The backend code is in the /lambda folder. The infrastructure configuration is defined in template.yml (a SAM template). As TypeScript is not natively supported by SAM, we can't rely on sam build. Instead the build and preparation of the CloudFormation template is done via a custom build command

Frontend

cd frontend
ng build --prod
aws s3 rm s3://velinfo-frontend --recursive
aws s3 cp dist/velinfo s3://velinfo-frontend --recursive --cache-control max-age=31536000

The frontend is a standard Angular application which can be built using the Angular CLI. Once built, the content need to be pushed to the S3 bucket hosting the static part of the website.