- REST API for properties and favorites
- User management with AWS Cognito
- API routing with AWS Api Gateway
- Computing with AWS Lambda (Node.js)
- Data storage with AWS DynamoDB
- Infrastructure management with Terraform
- Radius-based geospatial search supported by Google's S2 Geometry library
- Data modelling using DynamoDB's single-table design
POST /sign-up
{
"email": "[email protected]",
"password": "your-password",
"givenName: "John"
}
Note that you'll receive a verification email in the process. You can ignore it.
POST /sign-in
{
"email": "[email protected]",
"password": "your-password",
}
This request returns the idToken
that you'll need to authenticate with the rest of the API.
POST /properties
{
"name": "Cosy studio in the city center",
"country": "DE",
"city": "Cologne",
"location": {
"longitude": 50.93979502370754,
"latitude": 6.934593964765874
},
"numberOfRooms": 1
}
Authentication is required for this endpoint.
GET /properties?...
{
"longitude": 50.94170642954174,
"latitude": 6.958322074883795,
"radiusInMeters": 3000
}
POST /me/favorites
{
"propertyId": "xxxxxxxxx",
}
Authentication is required for this endpoint.
GET /me/favorites
Authentication is required for this endpoint.
The app is running on my private AWS account and I am therefore not sharing any public access data here.
See the instructions below to deploy to your own AWS account:
- AWS CLI
- Terraform 1.0.2
- Node.js 14
- Npm 7
- Replace
laurent
with your AWS profile name in the following files:
cd infrastructure
terraform init
terraform apply
cd code
npm ci
make prepare
make deploy
cd code
node_modules/.bin/ts-node scripts/seed.ts
- Find you API Gateway domain in the AWS console and use it to trigger the API.
- Here's a Postman collection that should help. Take notice of the two environment variables
api_url
andid_token
.
- No handling for DynamoDB's query response pagination
- No pagination supported for the
GET /properties
request - No pagination supported for the
GET /me/favorites
request - Limited error handling
- Limited test coverage