Skip to content

user management microservice with github actions and aws infra

Notifications You must be signed in to change notification settings

akhilk2802/webapp-fork

 
 

Repository files navigation

Webapp

A scalable User Management Service built with Node.js and Express.js, supporting CRUD operations along with email verification during user registration. The infrastructure is deployed on AWS, provisioned using Terraform.

Features

  • User Management: Provides complete CRUD functionality for managing user information.
  • Health Monitoring: Includes a dedicated endpoint to monitor the application’s health and its connected services.
  • Secure Deployment: Ensures data protection through HTTPS using SSL certificates and customer-managed encryption keys.
  • Scalability and Reliability: Achieves high availability and scalability using managed instance groups and load balancers.
  • Event-Driven Architecture: Leverages AWS SNS and lambda Functions to send verification emails through Mailgun.

Architecture Diagram

Architecture diagram

Technologies used:

  • Programming Language: JavaScript
  • Relational Database: PostgreSQL
  • Backend Framework: Node.js, Express.js
  • ORM Framework: Sequelize

To run the packer build command

Create variables.pkrvars.hcl file with the following fields:

aws_profile    = ""
vpc_default    = ""
subnet_default = ""
artifact_path  = ""
ami_name       = ""
instance_type  = ""
region         = ""

db_user     = ""
db_password = "" 
db_name     = ""

source_ami_id   = ""
demo_account_id = ""

To build and run the application locally

  1. Generate npm packages
npm install
  1. Add .env file
PORT=
DB_HOST=
DB_PORT=
DB_USER=
DB_PASSWORD=
DB_DATABASE=
DB_POOL_MAX=
DB_POOL_MIN=
DB_POOL_ACQUIRE=
DB_POOL_IDLE=
BCRYPT_SALT_ROUNDS=
TOKEN_EXPIRATION_TIME=
CLOUDWATCH_LOG_GROUP=
CLOUDWATCH_LOG_STREAM=
AWS_REGION=
ENVIRONMENT=
S3_BUCKET_NAME=
AWS_PROFILE=
SNS_TOPIC_ARN=
  1. To Run the Application
npm run start
  1. To Debug the Application
npm run dev
  1. To Run tests for the Application
npm run test

To Setup Infra with Terraform

References

  1. Creating users and managing psql
  2. Sequelize
  3. Cache-Control
  4. HTTP Status Codes

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 89.9%
  • Shell 5.8%
  • HCL 4.3%