https://github.com/iamarvy/nexlink
Dreamscape is a modern, scalable social media platform built with a microservices architecture. It enables users to post updates, view and engage with content, like and comment on posts, and communicate in real time via direct messages and group chats.
https://github.com/iamarvy/nexlink
docker ecs-fargate event-driven-architecture jwt microservices nestjs nuxtjs sqs typescript websockets
Last synced: 2 months ago
JSON representation
Dreamscape is a modern, scalable social media platform built with a microservices architecture. It enables users to post updates, view and engage with content, like and comment on posts, and communicate in real time via direct messages and group chats.
- Host: GitHub
- URL: https://github.com/iamarvy/nexlink
- Owner: iamArvy
- Created: 2025-05-13T14:45:30.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-07-01T18:36:26.000Z (3 months ago)
- Last Synced: 2025-07-01T19:37:21.132Z (3 months ago)
- Topics: docker, ecs-fargate, event-driven-architecture, jwt, microservices, nestjs, nuxtjs, sqs, typescript, websockets
- Language: TypeScript
- Homepage:
- Size: 7.93 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ฌ Nexlink
A scalable, modular **Social Media Backend** built with **NestJS**, supporting both **real-time communication** and traditional REST/GraphQL interactions. Built with microservices, gRPC, and WebSockets, it provides real-time chat, friend/follow systems, and a foundation for modern social features.
---
## ๐ Table of Contents
* [Features](#features)
* [Tech Stack](#tech-stack)
* [Architecture](#architecture)
* [Getting Started](#getting-started)
* [Microservices Overview](#microservices-overview)
* [Gateway API](#gateway-api)
* [Authentication](#authentication)
* [Real-time Communication](#real-time-communication)
* [API Documentation](#api-documentation)
* [Usage Examples](#usage-examples)
* [Planned Features](#planned-features)
* [Project Structure](#project-structure)
* [Contributing](#contributing)
* [License](#license)---
## โจ Features
* ๐งฑ Microservices architecture with gRPC
* ๐ REST + GraphQL API support
* ๐ Auth system with JWT and RBAC
* ๐งโ๐คโ๐ง Follow/friend request system
* ๐ฌ 1-on-1 and group chat support with Socket.IO
* ๐ฅ Group join requests with admin approval
* ๐ Real-time messaging using WebSockets
* ๐ Notification support (via Redis pub/sub)---
## ๐ Tech Stack
| Layer | Tech Used |
| ----------------- | --------------------------------------- |
| Backend Framework | NestJS |
| API Protocols | REST, GraphQL, gRPC |
| Real-time Engine | WebSockets, Socket.IO |
| Messaging Queue | Redis Pub/Sub |
| Database | PostgreSQL |
| Auth | JWT, RBAC |
| Containerization | Docker, Docker Compose |
| DevOps | GitHub Actions (CI/CD), Terraform (WIP) |---
## ๐ Architecture
\[Insert system architecture diagram here: gateway, services, Redis, WebSockets, etc.]
---
## ๐ Getting Started
### Prerequisites
* Node.js (v18+)
* Docker & Docker Compose
* PostgreSQL
* Redis### Clone the Repo
```bash
git clone https://github.com/iamarvy/social-media-api.git
cd social-media-api
```### Install Dependencies
```bash
npm install
```### Run with Docker
```bash
docker-compose up --build
```### Run Individual Services
```bash
cd services/auth
npm run start:dev
```---
## ๐งฉ Microservices Overview
| Service | Description |
| -------------------- | ---------------------------------------- |
| Auth Service | Handles sign up, login, token generation |
| User Service | Stores user profile and connection data |
| Post Service | Manages posts, comments, and likes |
| Chat Service | Handles real-time and group messaging |
| Notification Service | Sends real-time or async notifications |---
## ๐ Gateway API
* Unified **REST and GraphQL** entry point for frontend clients
* Integrates with all microservices over gRPC
* Handles WebSocket connections for real-time communication
* Includes role and token validation middleware---
## ๐ Authentication
* Uses **JWT-based** auth across services
* Role-based permissions: User, Admin, Group Admin
* Token validation handled at gateway + gRPC level guards---
## ๐ Real-time Communication
* WebSocket gateway powered by **Socket.IO**
* Chat service emits and listens to events using Redis pub/sub
* Group messaging with join requests and admin approval
* Message persistence using PostgreSQL---
## ๐ API Documentation
This project uses **Swagger** for automatic API documentation.
* ๐งญ **Full REST Docs**: Available at `http://localhost:3000/api`
* โ๏ธ **Generated via**: NestJS + Swagger module### Sample Endpoints
| Method | Endpoint | Description |
| ------ | -------------- | ------------------------ |
| POST | `/auth/signup` | Register a new user |
| POST | `/auth/login` | Authenticate and get JWT |
| GET | `/users/me` | Fetch current user info |
| POST | `/posts` | Create a new post |๐ For the complete list of endpoints, request/response schemas, and error formats, see the Swagger UI at `/api/docs`.
---
## ๐งช Usage Examples
### Authentication
```bash
curl -X POST http://localhost:3000/auth/login \
-H 'Content-Type: application/json' \
-d '{ "email": "user@example.com", "password": "123456" }'
```### Create Post
```bash
curl -X POST http://localhost:3000/posts \
-H 'Authorization: Bearer ' \
-H 'Content-Type: application/json' \
-d '{ "text": "My first post!" }'
```### Send WebSocket Message (via Socket.IO client)
```js
socket.emit('send_message', {
roomId: 'abc123',
message: 'Hello, world!',
});
```---
## ๐ Planned Features
* [ ] Story/Status system
* [ ] Media uploads with storage microservice
* [ ] Notification preferences & batching
* [ ] Activity logs and admin moderation tools
* [ ] Full-text post and comment search---
## ๐ Project Structure
```bash
/services
โโโ auth/
โโโ users/
โโโ posts/
โโโ chat/
โโโ notifications/
โโโ common/
/gateway
โโโ api-gateway/
/proto
โโโ *.proto
/docker
โโโ docker-compose.yml
```---
## ๐ค Contributing
1. Fork this repo
2. Create a branch (`git checkout -b feature/my-feature`)
3. Commit your changes
4. Push to your branch (`git push origin feature/my-feature`)
5. Open a Pull Request---
## ๐ License
This project is licensed under the MIT License.
ยฉ 2025 Oluwaseyi Oke