System Design Document2317065
System Design Document2317065
for
Abhishek Gaonkar
2317065
MCA
St Aloysius Institute of Management and Information Technology(AIMIT)
Mangalore
20/05/2025
Submitted to
The purpose of this Software Design Document (SDD) is to present a clear, detailed blueprint
for implementing Blink_Chat, guiding developers from the SRS to working code. It describes
the overall system architecture, individual software components, interfaces, and data
structures needed for construction. Each requirement defined in the SRS is mapped to one or
more design entities herein, ensuring full traceability. This document is intended for software
architects, developers, testers, and project evaluators who will implement, verify, and maintain
the system. By consolidating design decisions in one place, it minimizes ambiguity, promotes
consistency, and speeds up development. It also serves as a reference for future
enhancements or troubleshooting of Blink_Chat.
1.2 Scope
This SDD covers the end-to-end design of the Blink_Chat platform, from user interface
components through backend services to database schemas and external integrations. It
builds directly on the SRS, detailing how each functional requirement—real-time messaging,
profile management, status updates, media handling—is realized in software. The scope
includes decomposition of the system into modules, description of their interactions, data
flows, and deployment considerations. It does not cover the physical network infrastructure or
cloud provisioning steps, which are handled separately by DevOps documentation. Future
extensions (e.g., video calling, chatbots) are noted but out of scope for this version. This SDD
ensures the development team has everything needed to proceed to coding and testing.
3.2 Type
Entities are categorized by their nature, such as:
• Module (e.g., AuthModule)
• Service (e.g., SocketService)
• Component (React UI elements)
• Data Schema (Mongoose models)
• Utility (e.g., EncryptionUtils)
3.3 Purpose
Each entity exists to satisfy one or more SRS requirements. For instance, ChatService
implements real-time message routing (FR-1 through FR-8). ProfileController enables profile
updates and image uploads, meeting requirements for secure media handling and user
personalization.
3.4 Function
This attribute specifies input-to-output transformations.
•MessageComponent takes user-entered text and emits a send_message event.
•AuthService validates credentials and returns JWT tokens.
•CloudinaryAdapter receives binary image data and returns an accessible URL.
3.5 Subordinates
Composite entities list their children, for example:
• ChatModule includes MessageInput, MessageList, NotificationBanner.
• DatabaseLayer comprises UserSchema, MessageSchema, ConnectionPool.
3.6 Dependencies
Entities declare interactions with others:
•ChatService depends on SocketService for real-time transport and on MessageRepository
for persistence.
•AuthController relies on EncryptionUtils and UserRepository.
3.7 Interface
Defines how external or internal clients interact:
•POST /login expects { username, password } and returns { token } or error codes.
•WebSocket event update_status expects { userId, status } and broadcasts to all contacts.
3.8 Resources
Specifies required external resources:
• CPU and memory budgets for handling 100+ concurrent sockets.
• MongoDB Atlas cluster connections.
• Cloudinary API key and bandwidth.
3.9 Processing
Describes core algorithms and control flow:
• Socket reconnection policy: retry every 2 seconds, up to 5 attempts.
• Message queueing logic to buffer offline deliveries.
• Validation pipeline for incoming profile images.
3.10 Data
Defines data structures, formats, and constraints:
•User document: { _id, username: String(3–20), passwordHash, profileUrl }
•Message document: { _id, from: ObjectId, to: ObjectId, text: String, timestamp: Date }
•Acceptable image formats: JPEG, PNG; max size: 2 MB.
Messages
Attribute Datatype Constraint
4. Decomposition Description
6. Interface Description
External Interfaces
• REST API:
• POST /api/auth/login
• GET /api/messages/:userId
• WebSocket:
• Client emits send_message, server replies message_sent.
• Event user_status_change broadcasts { userId, status }.
Internal Interfaces
• Controllers call services, passing DTOs (Data Transfer Objects).
• Services interact with repositories returning Promises.
• Utility modules provide shared functions (e.g., validation, error formatting).
7. Detailed Design
Fig2:login
Fig 3:Home