Convert Figma logo to code with AI

relatedcode logoMessenger

Open source alternative communication platform.

4,806
1,123
4,806
1

Top Related Projects

Telegram web application, GPL v3

The communications platform that puts data protection first.

Mattermost is an open source platform for secure collaboration across the entire software development lifecycle..

A glossy Matrix collaboration client for the web.

A private messenger for Android.

Quick Overview

Relatedcode/Messenger is an open-source, fully functional messaging app for iOS, built using Swift. It provides a comprehensive foundation for developers to create their own messaging applications, featuring real-time chat functionality, media sharing, and user management.

Pros

  • Fully functional and ready-to-use messaging app
  • Built with modern Swift programming language
  • Includes essential features like real-time chat, media sharing, and user management
  • Customizable and extendable codebase

Cons

  • Limited to iOS platform
  • May require additional work to integrate with custom backend services
  • Documentation could be more comprehensive
  • Might need regular updates to keep up with iOS and Swift changes

Code Examples

  1. Sending a message:
let message = Message()
message.userId = User.currentId
message.chatId = chat.objectId
message.text = messageText
message.type = MessageType.Text.rawValue
message.incoming = false
message.outgoing = true
message.status = MessageStatus.Sent.rawValue

Messenger.sendMessage(message)
  1. Fetching messages for a chat:
Messenger.fetchMessages(chatId: chat.objectId) { messages in
    self.messages = messages
    self.tableView.reloadData()
}
  1. Creating a new chat:
let chat = Chat()
chat.name = chatName
chat.users = [User.currentId, otherUserId]

Messenger.createChat(chat) { success in
    if success {
        print("Chat created successfully")
    } else {
        print("Failed to create chat")
    }
}

Getting Started

  1. Clone the repository:
git clone https://github.com/relatedcode/Messenger.git
  1. Open the Xcode project file:
cd Messenger
open Messenger.xcodeproj
  1. Install dependencies using CocoaPods:
pod install
  1. Configure your Firebase project and update the GoogleService-Info.plist file.

  2. Build and run the project in Xcode.

Competitor Comparisons

Telegram web application, GPL v3

Pros of Webogram

  • Web-based implementation, accessible from any browser without installation
  • Supports Telegram's MTProto protocol for secure communication
  • Open-source and actively maintained with frequent updates

Cons of Webogram

  • Limited to Telegram's ecosystem, not as flexible for custom messaging solutions
  • May have performance limitations compared to native apps
  • Requires a Telegram account, not suitable for standalone messaging systems

Code Comparison

Webogram (Angular.js):

.service('AppMessagesManager', function ($q, $rootScope, $location, $filter, $timeout, $sce, ApiUpdatesManager, AppUsersManager, AppChatsManager, AppPeersManager, AppPhotosManager, AppVideoManager, AppDocsManager, AppStickersManager, AppWebPagesManager) {
  var messagesStorage = {};
  var messagesForHistory = {};
  var messagesForDialogs = {};

Messenger (Swift):

class Message: Object {
    @objc dynamic var objectId = ""
    @objc dynamic var chatId = ""
    @objc dynamic var userId = ""
    @objc dynamic var type = 0
    @objc dynamic var text = ""

Webogram focuses on integrating with Telegram's services using Angular.js, while Messenger is built as a standalone iOS app using Swift and Realm for local storage. Webogram's code is more complex due to its web-based nature and integration with Telegram's API, whereas Messenger's code is more straightforward, reflecting its native app architecture.

The communications platform that puts data protection first.

Pros of Rocket.Chat

  • More comprehensive feature set, including video conferencing and file sharing
  • Larger community and more active development
  • Self-hosted option for better data control and customization

Cons of Rocket.Chat

  • More complex setup and configuration
  • Higher resource requirements due to its extensive features
  • Steeper learning curve for administrators and users

Code Comparison

Rocket.Chat (TypeScript):

import { Meteor } from 'meteor/meteor';
import { Messages } from '../../../app/models/server';

Meteor.methods({
  sendMessage(message) {
    // Message sending logic
  }
});

Messenger (Swift):

func sendMessage(_ message: String, completion: @escaping (Error?) -> Void) {
    // Message sending logic
}

The code snippets show different approaches to message sending. Rocket.Chat uses Meteor methods in TypeScript, while Messenger implements a Swift function. Rocket.Chat's approach is more suitable for its full-stack JavaScript environment, whereas Messenger's code is tailored for iOS development.

Rocket.Chat offers a more feature-rich and scalable solution with broader platform support, making it suitable for larger organizations. Messenger, on the other hand, provides a simpler, more focused messaging experience, which may be preferable for smaller teams or projects with specific iOS requirements.

Mattermost is an open source platform for secure collaboration across the entire software development lifecycle..

Pros of Mattermost

  • Open-source, self-hosted platform with extensive customization options
  • Robust enterprise features including compliance, SSO, and advanced permissions
  • Active community and regular updates

Cons of Mattermost

  • More complex setup and maintenance compared to Messenger
  • Requires server infrastructure and technical expertise to deploy
  • May be overkill for small teams or simple chat applications

Code Comparison

Mattermost (Go):

func (a *App) CreatePost(c *request.Context, post *model.Post, channel *model.Channel, triggerWebhooks bool, setOnline bool) (savedPost *model.Post, err *model.AppError) {
    // Post creation logic
}

Messenger (Swift):

func sendMessage(_ message: Message, completion: @escaping (Bool) -> Void) {
    // Message sending logic
}

Mattermost uses Go for its backend, offering a more structured approach to handling posts and channels. Messenger, built with Swift, focuses on a simpler message-sending mechanism tailored for iOS applications. Mattermost's code reflects its more complex, feature-rich nature, while Messenger's code emphasizes simplicity and ease of use for mobile messaging.

A glossy Matrix collaboration client for the web.

Pros of Element

  • Open-source, decentralized, and based on the Matrix protocol, offering enhanced privacy and security
  • Cross-platform support with web, desktop, and mobile clients
  • Rich feature set including end-to-end encryption, voice/video calls, and file sharing

Cons of Element

  • More complex setup and configuration due to its decentralized nature
  • Potentially steeper learning curve for users accustomed to centralized messaging apps
  • May have slower adoption rates compared to mainstream messaging platforms

Code Comparison

Element (JavaScript/React):

const roomId = this.props.roomId;
const room = MatrixClientPeg.get().getRoom(roomId);
if (room) {
    const members = room.getJoinedMembers();
    // Process room members
}

Messenger (Swift):

if let chatId = self.chatId {
    let chat = ChatManager.shared.getChat(chatId: chatId)
    if let participants = chat?.participants {
        // Process chat participants
    }
}

Both repositories implement messaging functionality, but Element focuses on decentralized communication using the Matrix protocol, while Messenger appears to be a more traditional centralized messaging app. Element's codebase reflects its integration with the Matrix client, whereas Messenger's code suggests a simpler, custom implementation for managing chats and participants.

A private messenger for Android.

Pros of Signal-Android

  • Open-source and fully auditable, enhancing security and transparency
  • Robust end-to-end encryption implementation
  • Active development with frequent updates and security patches

Cons of Signal-Android

  • Limited customization options compared to Messenger
  • Smaller user base, potentially affecting adoption rates
  • Fewer features beyond core messaging and calling functionality

Code Comparison

Signal-Android (Java):

public class SignalServiceMessageSender {
    public void sendMessage(SignalServiceAddress address, 
                            SignalServiceDataMessage message) 
                            throws IOException, UntrustedIdentityException {
        // Encryption and sending logic
    }
}

Messenger (Swift):

class MessageSender {
    func sendMessage(_ message: String, to recipient: String) {
        // Message sending logic
    }
}

Signal-Android focuses on secure message transmission with built-in encryption, while Messenger provides a simpler interface for sending messages without explicit encryption handling in the example code.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

OVERVIEW

RelatedChat is an open-source alternative communication platform. Both iOS (Swift), Android (React Native), and Web (React) version source codes are available.

NEW FEATURES

  • Updated iOS (Swift) codebase
  • New Android (React Native) version
  • New Desktop browser (React) version
  • Single backend server (using GraphQLite)

FEATURES

  • Direct chat functionality
  • Channel chat functionality
  • Sending text messages
  • Sending emoji messages
  • Sending photo messages
  • Sending video messages
  • Sending audio messages
  • Sending stickers
  • Sending GIF messages
  • Media file local cache
  • Media message re-download option
  • Media download network settings (Wi-Fi, Cellular or Manual)
  • Cache settings for media messages (automatic/manual cleanup)
  • Typing indicator
  • Load earlier messages
  • Message delivery receipt
  • Message read receipt
  • Arbitrary message sizes
  • Send/Receive sound effects
  • Copy and paste text messages
  • Video length limit possibility
  • Save photo messages to device
  • Save video messages to device
  • Realtime conversation view for ongoing chats
  • All media view for chat media files
  • Picture view for multiple pictures
  • Basic Settings view included
  • Basic Profile view for users
  • Edit Profile view for changing user details
  • Sign in with Email
  • Privacy Policy view
  • Terms of Service view
  • Full source code is available
  • No backend programming is needed
  • Native and easy to customize user interface
  • Supports native iOS Dark Mode
  • Supported devices: iPhone SE - iPhone 13 Pro Max

INSTALLATION (iOS)

1., Create some test users by using a demo server.

2., Open the app.xcodeproj from Xcode and select Product/Run (⌘ R).

INSTALLATION (Android)

1., Setup Gradle variables by following the official docs.

2., Open a terminal and run npm start.

3., Open another terminal and run npx react-native run-android --variant=release.

For a complete guide on how to publish and run your React Native app, please refer to the official docs.

INSTALLATION (Web)

You can install RelatedChat on any servers (Windows, Linux or macOS), by using Docker. Just download the Docker Compose file to your computer and initiate the process.

curl -o docker-compose.yml https://rel.codes/messenger/docker-compose.yml

docker compose up -d

Make sure to change all the sensitive values in your YAML file before building your server.

environment:
  DB_HOST: pg
  DB_PORT: 5432
  DB_DATABASE: gqlserver
  DB_USER: gqlserver
  DB_PASSWORD: gqlserver

  CACHE_HOST: rd
  CACHE_PORT: 6379
  CACHE_PASSWORD: gqlserver

  MINIO_ROOT_USER: gqlserver
  MINIO_ROOT_PASSWORD: gqlserver

  ADMIN_EMAIL: admin@example.com
  ADMIN_PASSWORD: gqlserver

  SECRET_KEY: f2e85774-9a3b-46a5-8170-b40a05ead6ef

LICENSE

MIT License

Copyright (c) 2024 Related Code

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.