This application helps visualize the confusing fare system of Washington Metropolitan Area Transit Authority (WMATA).
- AWS Account, the services used are S3, Lambda, IAM, and API Gateway
- Optional: Route 53 if you want to use a domain
- Terraform
- Python3.12
- React
- Node.js
- A WMATA API Key
This is a mix of automated CI/CD, Infrastructure as Code (IaC), and manual python due to AWS Free Tier limits.
-
Create IAM users & roles, a Lambda function, an API Gateway and an S3 bucket
a. Authenticate aws-cli credentials
cd infra terraform planb. Ensure you want these services and users/roles to be created
terraform apply -
Populate the bucket, I wanted this to be within an AWS Glue Job but the free tier limit does not allow the type of Glue job needed for IoC
a. Using the env.sample, populate
WMATA_API_KEYfrom the WMATA API site.WMATA_API_KEY="" S3_BUCKET="wmata-fares" S3_PREFIX="data/"b. Create a virtual env
python3.12 -m venv .venv source .venv/bin/activatec. Install requirements.txt
python3.12 -m pip install -r requirements.txtd. Run data/upload_files.py
python3.12 data/upload_files.pye. Locally you'll see 3 small JSON files, one lines, one stations, one fares. On your S3 Bucket you'll see all 3 within
s3://wmata-fares/data/
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.