Team Management
Communication
File Sharing
Scalability
Performance
Security
These group of api's will include api's for creating team, adding member to team, get team details and remove team member.
These will include uploading file, downloading file and for listing files in a channel.
Send Message
Endpoint: POST /api/channels/{channel_id}/messages
Description: Sends a message to a channel or group chat.
Request:
{
"sender_id": "user_id_123",
"content": "Hello team, the project deadline is next week!",
"type": "text"
}
Response:
{
"message_id": "message_id_789",
"channel_id": "channel_id_456",
"sender_id": "user_id_123",
"content": "Hello team, the project deadline is next week!",
"type": "text",
"sent_at": "2024-08-25T10:10:00Z"
}
Get Messages
Endpoint: GET /api/channels/{channel_id}/messages
Description: Retrieves messages from a specific channel.
Request:
{
"limit": 50,
"offset": 0
}
Response:
[
{
"message_id": "message_id_789",
"channel_id": "channel_id_456",
"sender_id": "user_id_123",
"content": "Hello team, the project deadline is next week!",
"type": "text",
"sent_at": "2024-08-25T10:10:00Z"
},
{
"message_id": "message_id_790",
"channel_id": "channel_id_456",
"sender_id": "user_id_789",
"content": "Got it! I'll make sure everything is on track.",
"type": "text",
"sent_at": "2024-08-25T10:11:00Z"
}
]
Create Channel
Endpoint: POST /api/teams/{team_id}/channels
Description: Creates a new communication channel within a team.
Request:
{
"channel_name": "Project A",
"created_by": "user_id_123"
}
Response:
{
"channel_id": "channel_id_456",
"channel_name": "Project A",
"team_id": "team_id_456",
"created_by": "user_id_123",
"created_at": "2024-08-25T10:15:00Z"
}
Cloud Storage Service: Use AWS S3 (or equivalent) for storing files. This provides:
NoSQL Database: Store messages in a NoSQL database such as MongoDB or DynamoDB. This approach provides:
Client (Web/Mobile): The frontend interacts with the API Gateway to access all backend services. It handles rendering the UI and managing user interactions.
API Gateway: This component routes requests to the appropriate backend services, ensuring secure and efficient communication between the frontend and backend.
Authentication & Authorization Service: Manages user authentication (e.g., login, logout) and ensures that users have the correct permissions to perform actions.
User & Team Management Services: Handle the creation, retrieval, and management of user accounts and teams. They interact with the relational database to persist data.
Communication Service: Manages real-time messaging and notifications. It stores messages in the NoSQL database for scalability and supports WebSocket connections for real-time updates.
File Storage Service: Manages file uploads, downloads, and version control. Files are stored in cloud storage, and metadata is kept in the relational database.
Notification Service: Sends notifications to users about relevant events, such as new messages or file uploads.
Search Service: Provides full-text search capabilities across the platform. It indexes messages, files, and other content to allow quick retrieval.
Client: The user sends a message from the web or mobile application.
API Gateway: The request is routed to the Communication Service via the API Gateway.
Authentication & Authorization Service: The API Gateway first checks with the Authentication & Authorization Service to ensure the user is authenticated and authorized to send messages in the specified channel.
Communication Service:
Notification Service: If the message mentions specific users, the Notification Service generates notifications and updates the notification table.
Client: The message is delivered in real-time to all participants in the channel.
WebSocket Server Scalability:
Message Processing and Storage:
File Access Performance:
Operational Overhead vs. Performance: Choosing cloud-based solutions like AWS S3 and a CDN offloads much of the operational burden but introduces ongoing costs and reliance on external providers.
Consistency vs. Scalability: The choice between NoSQL for messages and relational databases for metadata reflects a trade-off between consistency and scalability, ensuring that each type of data is stored in a way that best matches its usage pattern.
End-to-End encryption to use public key infrastructure (PKI) to encrypt messages and files on the client side before they are sent, and decrypt them on the recipient's side.