Introduction

Introduction to Splitly

  • Splitly is a group expense management and sharing platform that helps users track shared expenses, calculate the amounts owed between members, and manage transaction history in a transparent manner.

  • The system is built using a modern web architecture consisting of a React + Vite frontend, a Node.js/Express backend, and MongoDB Atlas as the database. The application is deployed on AWS to leverage the scalability, security, and monitoring capabilities of the cloud platform.

  • Amazon EC2 is used to deploy the backend API and frontend, Amazon S3 is used to store invoice and receipt files, Amazon CloudWatch supports log collection and system monitoring, while Amazon VPC and Security Groups ensure secure network connectivity between system components.

System Overview

The main components of the Splitly system include:

  • Frontend Application

    • Built using React + Vite.
    • Provides an interface for users to manage groups, expenses, and payment statuses.
  • Backend Application

    • Uses Node.js/Express to provide REST APIs.
    • Handles business operations such as group creation, expense management, settlement calculation, and user authentication.
  • Database

    • Uses MongoDB Atlas to store user information, groups, transactions, and payment history.
  • Cloud Storage

    • Amazon S3 is used to store images, electronic invoices, and receipts uploaded by users.
  • Monitoring & Security

    • Amazon CloudWatch is used to collect logs and monitor the operational status of the system.
    • Amazon VPC, Security Groups, and AWS IAM help control network connectivity and access permissions to AWS resources.

The upgraded architecture enables Splitly to improve performance, security, availability, and scalability by separating the frontend and backend components. The React frontend is built and hosted on Amazon S3 and then distributed through Amazon CloudFront. Route 53 is responsible for DNS resolution, while AWS WAF and AWS Certificate Manager (ACM) help protect the application and provide secure HTTPS connectivity.

The Backend API is deployed on Amazon EC2 instances located in Private Subnets across two Availability Zones and is accessed through an Application Load Balancer. This architecture distributes incoming traffic and improves fault tolerance in the event that one Availability Zone experiences a failure. The EC2 instances use IAM Roles to access the required AWS services.

The database layer uses Amazon DocumentDB with a Primary/Replica configuration across two Availability Zones, improving system availability and supporting data recovery capabilities. The EC2 instances hosting the backend can access DocumentDB through internal connectivity within the VPC.

For receipt data, Amazon S3 is used as a dedicated storage service, and the backend accesses S3 through a VPC Gateway Endpoint. This ensures that traffic between the EC2 instances and S3 does not need to pass through an Internet Gateway or NAT Gateway.

In addition, Amazon CloudWatch, Amazon SNS, and AWS Budgets are used respectively for system monitoring, alerting, and cost management. AWS Systems Manager Session Manager supports secure EC2 administration without requiring SSH access to be exposed directly to the Internet.

This architecture provides a foundation for Splitly to scale its backend services, improve system availability, and integrate additional AWS services in the future without requiring major changes to the overall system.