Bakcend Project
Bakcend Project
You have given High-Level Design and Low-Level Design of lite version of typical NewsLetters App.
You need to understand the requirement
Object of this assignment is to test your requirement understand knowledge and skill of
understanding or generating code using AI tools. You are free to refer code of any of Open-Source
NewsLetters App https://medevel.com/10-email-marketing-automation/
This App should provide a basic Back End for managing email campaigns and subscriber lists. Here
are some key features:
Key Features and Requirements
1. List Management: It should supports managing large subscriber lists, allowing users to add
subscribers manually or import them via CSV files. Allow only private list and it should be
visible only to user
2. Custom Fields: The application enables users to create custom fields for subscribers, which
can be utilized in newsletters through merge tags.
3. Segmentation: Users can segment their lists based on predefined rules, facilitating targeted
email campaigns without the need for multiple lists.
5. GPG Encryption: The application supports GPG public key encryption, allowing secure
communication with subscribers. (Nice to have requirement)
6. Click Statistics: After sending campaigns, users can track click statistics for each link included
in the email, providing insights into engagement. There should be appropriate security
measure taken in code to prevent unauthorised entry to database (Nice to have requirement)
7. Template Editor: It should a built-in template editor, allowing users to design newsletters
with ease. (Nice to have requirement)
8. Automation: The platform supports automation triggers, enabling users to send messages
based on specific actions. (Nice to have requirement)
10. Send via Any Provide: Supports SMTP protocol to send out newsletters e.g. SES AWS
SparkPost, SendGrid and Mailgun
High-Level Design
1. Architecture Overview
The architecture of the application can be divided into three main layers:
• Backend Layer: Implemented using NestJS for handling API requests and business logic.
• Database Layer: PostgreSQL for data storage and drizzle ORM or TypeORM for connectivity,
ensuring relational integrity and support for complex queries.
2. Components
• Tables for Users, Organizations, Subscribers, Lists, Campaigns, Templates, and Click
Stats.
• Each table will include an organization_id field to support multi-tenancy.
• Email Service:
• Integration with AWS SES/Gmail or any other E-Mail provide for sending emails and
managing email queues.
3. Multi-Tenancy
Low-Level Design
1. Database Schema
Users Table
Subscribers Table
Lists Table
User Management
Organization Management
Subscriber Management
List Management
• POST /api/lists: Create a new list.
Campaign Management
GPG Encryption
• Template Editor: Integrate GrapeJS and Mosaico for advanced template editing.
• Define triggers in the database that can be linked to specific actions (e.g., new subscriber,
new RSS feed entry).
*****