Chat app for ios.
The project consists of 3 parts:
- chat-app – client iOS app
- chat-app-server – backend, developed in Go
- chat-app-proto – proto files
App was developed using SwiftUI for iOS version >= 14. WebSocket is used for client-server communication. For data serialization i chose Google Protobuf ❤️ because it's very convenient data serializing protocol. Alamofire library was used for http networking. SDWebImage library was used for image/gif downloading and caching.
You can test app in simulator or on real device using ngrok, for example by running the server first.
github_chat.mp4
- list of chats
- the ability to change app icon in settings tab
- you can send text, GIF(using Giphy API) and images in chats
- you can reply on any type of message, edit text message, and delete any type of message
NOTE: you should have paid Apple developer account to make authorization through "Sign in with Apple" and FCM notifications work. In addition you must add 2 corresponding capabilities in .xcodeproj file -> Signing & Capabilities. Without these, however, you can log in using "useGuestUser" constant in Config.swift file. Additionally, for FCM you should provide GoogleService-Info.plist for iOS app and private key file in JSON format for server. Read: https://firebase.google.com/docs/admin/setup and https://firebase.google.com/docs/ios/setup
The backend was developed using Go. Currently server can only be started from localhost because i didn't set up docker and other things. But you must create 2 databases and make them running in Docker or something, and provide necessary data (database name, username, password) to config.go file.
The server uses 2 databases. The first is MySQL for storing various stuff, e.g. user data. The second is MongoDB, primarily for storing chat messages.