AWS Expert Needed for Prisma Postgres Lambda based MVP -- 2

Job ID: 38175347

Budget: $250 – $750 AUD

Project Overview
The goal is to build a serverless MVP solution using AWS Serverless architecture. The solution will allow private lenders to create lending products and lend money securely and efficiently. The initial phase involves developing a robust microservice template in Node.js with TypeScript, leveraging AWS Lambda, API Gateway, and other AWS services. The project will be developed using industry standards and best practices for security and scalability.

Objectives
Develop a Node.js TypeScript microservice template.
Integrate Prisma ORM to connect to a PostgreSQL database hosted on an EC2 instance.
Implement logging using Winston with logs stored on AWS.
Secure the microservice with API Key authentication.
Deploy the microservice as a Docker image on AWS Lambda.
Create a sample application to demonstrate the functionality.
Set up automated batch processing using AWS Lambda orchestration.
Utilize Pulumi for infrastructure as code (IaC) in TypeScript.


Requirements for Freelancer
1. Node.js TypeScript Microservice Template:

Project Structure (For an example of best practices):
/src: Contains all application source code.
/config: Configuration files (e.g., database config, environment config).
index.ts: Centralizes and exports configurations.
/controllers: Handle HTTP requests and responses.
/middlewares: Custom middleware functions for Express.
/models: Prisma models.
/routes: Define application routes.
/services: Business logic.
/utils: Utility functions, including logging.
app.ts: Initializes the Express application.
server.ts: Entry point of the application.
/prisma: Prisma schema and migration files.
/scripts: Scripts for database initialization and setup.
.env: Environment variables file.
.gitignore: Files and directories to be ignored by Git.
Dockerfile: Docker configuration file.
package.json: Project dependencies and scripts.
tsconfig.json: TypeScript configuration file.
README.md: Project documentation.

2. Prisma Client Integration:

Database Connection:
Use Prisma ORM to connect to a PostgreSQL database hosted on an EC2 instance running as a Docker image.
3. Logging:

Implementation:
Use Winston for logging.
Configure logging to be stored on AWS (CloudWatch or S3).
4. Security:

API Gateway:
Secure microservice with API Key authentication.
5. Docker and AWS Lambda:

Deployment:
Create Docker image of the microservice.
Deploy the Docker image to AWS Lambda.
6. Sample Application:

Database Tables:
data_inputs: Columns: sum_a, sum_b, sub_a, sub_b, div_a, div_b, mul_a, mul_b, random_result.
sum_of_inputs: Columns: sum_datetime, total_sum.
div_of_inputs: Columns: div_datetime, final_division.
mul_of_inputs: Columns: mul_datetime, mul_sum_division.
Lambda Orchestration:
First Lambda: Sums columns in data_inputs and stores in sum_of_inputs.
Second Lambda: Triggered by the first Lambda, divides total_sum by div_a and stores in final_division.
Third Lambda: Uses data from the first and second Lambdas, divides total_sum by final_division, and multiplies by mul_a.
Daily Batch: Runs at 12 AM to execute the sequence of operations.

7. Infrastructure Setup with Pulumi:

EC2 Instance:
Create T2G-Medium EC2 instance using Pulumi.
Run PostgreSQL as a Docker image with persistent volume.
Flexibility:
Ensure easy addition of new Docker images to the EC2 stack.
Additional Enhancements:

Security:
Implement IAM roles and policies for secure resource access.
Use AWS Secrets Manager or Parameter Store for sensitive configurations.
Scalability:
Set up auto-scaling for the Lambda functions.
Use RDS for PostgreSQL instead of EC2 for managed database service.
Monitoring:
Integrate CloudWatch Alarms for proactive monitoring.
Set up AWS X-Ray for tracing requests and debugging.