The Tenant Service is a serverless application built on AWS Lambda and other services using the Serverless Framework. It provides management of tenants and payments made for a property, as well as basic CRUD operations for properties.
- Tenant Management: Create, update, and delete tenant information, including name, phone, and property allocation.
- Payment Management: Record tenant payments, including payment amount and date.
- Property CRUD: Perform basic CRUD operations (Create, Read, Update) on property information, such as property details, address, and rental rates.
The Tenant Service utilizes the following AWS services:
- AWS Lambda: Handles the serverless functions for processing tenant, payment and property operations.
- API Gateway: Provides a RESTful API to interact with the service.
- DynamoDB: Stores tenant and property data, as well as payment records.
- EventBridge (CloudWatch Events): Triggers lambda function on schedule.
- AWS CloudFormation: Automates the provisioning and management of AWS resources.
- Amazon SNS Sends SMS Notification to tenants.
To get started with the Tenant Service, follow these steps:
- Clone the repository:
git clone https://github.com/charlallison/tenant-service.git
- Install dependencies:
cd tenant-service npm install
- Configure AWS credentials:
Ensure that you have valid AWS credentials setup using the AWS CLI otherwise follow the instructions on how to set up your AWS credentials - Configure service settings:
Open the serverless.yml file and update theprofile
,service name
,region
, etc. as needed. - Deploy the service using:
sls deploy
- Access the API:
Once the deployment is successful, you will receive an API endpoint URL. Use this URL to interact with the Tenant Service using an API client such as cURL or Postman.
The Tenant Service API provides the following endpoints:
GET /properties?status={status}
: Retrieves a list of all properties by status.
GET /properties/{id}
: Retrieves a specific property by ID.
POST /properties
: Creates a new property.
PATCH /properties/{id}
: Updates an existing property.
GET /tenants?status={status}
: Retrieves a list of all tenants by status.
GET /tenants/{id}
: Retrieves a specific tenant by ID.
POST /tenants
: Creates a new tenant.
PATCH /tenants/{id}
: Updates an existing tenant.
DELETE /tenants/{id}
: Deletes a tenant.
POST /tenants/{id}/pay
: Pays the rent for a property.
The Tenant Service is open-source and available under the MIT License. Feel free to use, modify, and distribute the code as per the terms of the license.