https://github.com/the-real-i9/i9lyfe-server
A Social Media API Server
https://github.com/the-real-i9/i9lyfe-server
chat-application docker go gofiber plpgsql postgresql redis redis-cache redis-streams redispubsub social-media sql websocket
Last synced: 2 months ago
JSON representation
A Social Media API Server
- Host: GitHub
- URL: https://github.com/the-real-i9/i9lyfe-server
- Owner: the-real-i9
- Created: 2023-12-18T21:59:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2026-02-17T00:18:32.000Z (4 months ago)
- Last Synced: 2026-02-17T06:35:49.631Z (4 months ago)
- Topics: chat-application, docker, go, gofiber, plpgsql, postgresql, redis, redis-cache, redis-streams, redispubsub, social-media, sql, websocket
- Language: Go
- Homepage:
- Size: 5.92 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# i9lyfe (API Server)
[](https://github.com/the-real-i9/i9lyfe-server/actions/workflows/test.yml)
A Social Media API Server
## Intro
i9lyfe is a full-fledged social media API server built in Go. It supports all of the major social media application features with a scalable, production-grade arcitecture, serving as a foundation for building apps like Instagram, TikTok, or Facebook clones.
## Technologies and Tools
### Technologies
- **Go** - Programming Language
- **Fiber v3** - HTTP (REST) API Framework
- **PostgreSQL** - Relational DBMS
- **SQL** - Structured Query Language for Relational Databases
- **PL/pgSQL** - Procedural Language for PostgreSQL. Stored functions.
- **Neo4j** - Graph DBMS
- **CypherQL** - Query Language for Neo4j
- **WebSocket** - Full-duplex, Bi-directional communications protocol. Realtime communication.
- **Redis Key/Value Store** - Cache. Fast data structures. Pagination. Aggregation.
- **Redis Streams** - Event-based messaging system. Background tasks queue.
- **Redis Pub/Sub** - PubSub pattern messaging system
- **Google Cloud Storage** - Cloud object storage
---
- **JWT** - User authentication. Token signing and verification.
- **MessagePack** - Object serializer and deserializer (major use)
- **JSON** - Object serializer and deserializer (minor use)
### Tools
- **Swagger** - HTTP API Documentation
- **AsyncAPI** - Websockets API Documention
- **Docker** - Container running Postgres and Redis instances
- **Git & GitHub** - Repository & Version Control
- **GitHub Actions** - Continuous Integration. Unit & Integration Testing
- VSCode
- Ubuntu Linux
## Table of Contents
- [Intro](#intro)
- [Technologies](#technologies)
- [Table of Contents](#table-of-contents)
- [Features](#features)
- [Upcoming features](#upcoming-features)
- [API Documentation](#api-documentation-)
- [API Diagrams](#api-diagrams-)
- [Architecture Diagram](#architecture-diagram)
- [ER Diagram](#entity-relationship-diagram)
- [Sequence Diagrams](#sequence-diagrams)
- [API Tests](#api-tests-)
## Features
The following are the features supported by this API. *Visit the API documentation for implementation guides.*
### Content Creation & Sharing
**Create posts** of various types (inspired by Instagram) including *Photo*, *Video*, and *Reel*.
- Mention users
- Include hashtags
### Feed
- Browse posts from people you follow
- Receive new posts in real-time.
### Content Engagement and Interaction
- **React** to Posts and Comments
- **Comment** on Posts and Comments (replies).
- **Repost:** Re-share posts on your feed.
- **Access Interactions:** Access comments on posts and replies to comments, and access the list of users who have reacted to a post or comment.
- **Save** posts for later
### User Profile Management
- View your profile
- Access to other user profiles.
- Edit your profile.
- Manage your posts.
- Access to saved posts.
- Access to posts you've engaged with through likes and comments.
- Access to posts you we're mentioned in.
### Networking
- Follow or unfollow users.
### Chatting and Direct Messaging
- Realtime chat with users of the application.
- Supports various message types including:
- Text and voice message
- Images and videos with caption
- Audio
- File attachments (Documents)
- Realtime user presence status and last seen.
### Realtime Notification and Message Delivery
- Users receive likes, comments, reposts, and mentions notifications involving them in realtime.
- Chat messages are delivered to target users in realtime.
- New posts are delivered to user's feed in realtime.
### Realtime Updates
- Individual posts receive real-time interaction updates (upon client subscription).
- Clients receive user "presence" and "last seen" updates (upon subscription)
## Upcoming features
The following is a list of features to be supported by this Social Media Backend API.
### Following Interests
- Users will be able to follow interests (or topics). Content will also be recommended to them based on the interests they follow.
### Search: Full-text Search | Results Ranking | Fuzzy Matching
- Full-text search through content (photos, videos, and reels)
- Search user accounts
- Search hashtaged posts
### Discover: Content Recommendation System
- A content recommendation system that pushes relevant content to the user's feed, based on:
- User following network
- User's interest followed
- User engagement stats
- and more recommendation parameters...
### User Follow Recommendation
- App will recommend users to follow, based on your follow network and content interaction stats.
## API Documentation ๐
HTTP API (REST): [Here](./docs/swagger.json). Open in [Swagger Editor](editor.swagger.io)
WebSockets API: [Here](./docs/asyncapi.json) Open in [AsyncAPI Editor](studio.asyncapi.com).
## API Diagrams ๐จ
### Architecture Diagram
API (C4) Component Level Diagram: [Here](./diagrams/arch.pu). (Open in [PlantUML Editor](editor.platuml.com))
Show Diagram

### Entity-Relationship Diagram
DBDiagram.io version: [Here](./diagrams/ER.dbml). View in [DBDiagram Editor](dbdiagram.io).
Mermaid version: [Here](./diagrams/ER.mermaid).
### Sequence Diagrams
API sequence diagrams: [Here](./diagrams/sequence-diagrams.md)
## API Tests ๐งช
We employ a testing approach where test cases are in the form of user stories. These stories simulate real-world API usage activity by a client/user, confirming that endpoints work as expected on both the client and server side.
### Feature Tests
Here we just want to test that the API endpoints/features work under normal, sane circumstances.
#### User Authentication Story
[This test case](./tests/userAuthStory_test.go) builds a story around user signup, signout, login, and password reset features of the API. It is structured by a series of user/client actions or steps that simulate a real-world authentication scenario by a user.
#### User Post & Comment Story
[This test case](./tests/userPostCommentStory_test.go) builds a story around post creation, mentioned user notifications, post fan-outs, commenting on a post, notifying the post owner, notifying users mentioned in comments, reacting to a post or comment etc.
More feature tests can be found [here](./tests)
### Upcoming tests
#### Error tests
Here we'll build user stories around everywhere error should occur in the API, including validation errors, business layer errors, database errors, and more.
#### Bad API Usage Tests
Here we'll build client stories that intend to break the API.
#### Attack Simulation Tests
Here we'll test the API's security guards and potential vulnerabilities