Skip to content

An API that helps you find available on-street parking in Melbourne CBD, Victoria, Australia.

License

Notifications You must be signed in to change notification settings

hingyeung/find-parking

Repository files navigation

Serverless Backend of Melbourne City On-street Parking Finder

This is an API implemented with serverless technologies and it serves the frontend of Melbourne City On-street Parking Finder. It consists of two components:

  1. An AWS Lambda function that handles queries from UI.
  2. A workflow for ingesting On-street parking sensor data from City of Melbourne Open Data Platform, orchestrated with AWS Step Functions and Lambda functions.

Dev Setup

  1. Install AWS SAM Local
  2. Use virtualenv.
    mkvirtualenv find-parking, or workon find-parking if the virtualenv find-parking already exists.
  3. Install python dependencies.
    pip install -r requirements.txt
  4. Start localstack.
    npm run start_localstack
  5. Seed local S3 bucket and SSM with test data.
    npm run seed_data
  6. Watch and transpile individual Lambda function.
    npm run watch_load_parking_sensor_data_from_s3 npm run watch_download_parking_sensor_data npm run watch_download_parking_restrictions_data npm run watch_parking_sensor_query_handler
  7. Run individual Lambda functions.
    npm run run_load_parking_sensor_data_from_s3 npm run run_download_parking_sensor_data npm run run_download_parking_restrictions_data npm run run_parking_sensor_query_handler
  8. Run the API locally.
    npm run run_parking_sensor_query_api
  9. Test the API locally.
    Visit http://127.0.0.1:3001/findAvailableParkings?lat=-37.8147527&lng=144.9647163&radiusInMeter=500

Deployment

  1. Transpile all Typescript code in preparation for packaging.
    npm run transpile
  2. Package the Lambda function.
    sam package --template-file deploy/template.yaml --s3-bucket <bucket_name> --s3-prefix find-parking/artefacts --output-template-file tmp/find_parking_cfn.yaml
  3. Deploy stack with CloudFormation.
    aws cloudformation deploy --template-file /Users/samli/dev/find-parking/tmp/find_parking_cfn.yaml --stack-name <stack_name> --capabilities CAPABILITY_IAM --parameter-overrides dataBucket=<bucket_name> downloadDestPrefix=find-parking/data

About

An API that helps you find available on-street parking in Melbourne CBD, Victoria, Australia.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published