Skip to content

Instantly share code, notes, and snippets.

@Emmanuerl
Last active March 16, 2024 12:15
Show Gist options
  • Save Emmanuerl/5c8199f4a10c3ae6c88c2aebc62a1b73 to your computer and use it in GitHub Desktop.
Save Emmanuerl/5c8199f4a10c3ae6c88c2aebc62a1b73 to your computer and use it in GitHub Desktop.
a snapchat inspired backend chat application

Go Chat

Go Version License

a snapchat inspired backend chat application

Table of Contents

Objective

Our goal is to develop the backend infrastructure for a chat application that draws inspiration from Snapchat's ephemeral messaging features. This chat application should allow users to send text, images, and videos that will disappear after a set duration. Users should also be able to engage in private and group chats.

Functional Requirements

User Registration and Authentication

  1. User Registration: Users should be able to register for an account using their email address. They should provide a username and set a password.
  2. User Authentication: Implement secure user authentication mechanisms, including password hashing and token-based authentication.

Messaging Features

  1. Text Messages: Users should be able to initate conversations, send and receive text messages in real time.
  2. Message Expiration: All messages, including text, images, and videos, should automatically disappear after a predefined time (24 hours).
  3. Saving Messages: User shoud have the option of saving messages so they don't expoire after 24 hours. Such saved message should be saved for the preceding conversation for as long as possible

Friends and Connections

  1. Friends: Users should be able to make friend requests to other users who aren't on their list of friends. Users should also be able to accept or reject a friend request.

Technology Stack

The backend should be built using Go for its scalability and performance. Utilize a suitable database (e.g., PostgreSQL) for data storage and a WebSocket library for real-time messaging.

Deliverables

A fully functional Golang backend having all the aforementioned features.

None Functional Requirements

  1. Proper Logging
  2. MongoDB as a persistence layer
  3. Redis for temporary storag
  4. Low latency
  5. Minimal memory usage
  6. Secure password hashing
  7. Web socket integration with support for horizontal scaling

Milestones

  1. Project setup
  2. Onboarding and Authentication
  3. Friend Requests
  4. Sending and Receiving of messages
  5. General application review

Getting Started

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Go (v1.17 or higher) installed on your system.
  • Docker and Docker Compose for database setup (optional).

Conclusion

The successful development of Go - chat will help develoopers have a broader understanding of building production applications in Golang, combining the best aspects of Snapchat's ephemeral messaging with modern chat app features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment