An open API service indexing awesome lists of open source software.

https://github.com/mcsamuelshoko/telko-moment-server

Messenger API backend e.g telegram-like -> started as "college students venturing into the world of web sockets on a nodejs server as they(we) create a server for our chat-app that will be made using dart's flutter framework."
https://github.com/mcsamuelshoko/telko-moment-server

fiber-framework go golang layered-architecture mongodb

Last synced: 4 months ago
JSON representation

Messenger API backend e.g telegram-like -> started as "college students venturing into the world of web sockets on a nodejs server as they(we) create a server for our chat-app that will be made using dart's flutter framework."

Awesome Lists containing this project

README

          

# telko-moment-server πŸ–₯

> - Server to a maui mobile app for android chat-app.
> - The server uses fiber for golang

| | List of topics |
|---|:------------------------------------|
| | [System Diagrams](#system-diagrams) |
| | [Miscellaneous](#miscellaneous) |
| | [Requirements](#requirements) |
| | [Folder Structure](#folder-structure) |

## System Diagrams (C4)

### System Context

```mermaid
---
title:"Main System Overview"
---
flowchart TD
User["Premium User
[Person]

A user of the platform that purchased a subscription"]

TS["Telko-Momment Service
[Software System]

Provides an API to use telko-messenger apps
"]

User --" Sends messages, receives messages,\nand views higlights using"--> TS

classDef person fill:#08427b,stroke:#052e56,color:#ffffff
classDef focusSystem fill:#1168bd,stroke:#0b4884,color:#ffffff

class User person
class TS focusSystem
```

## Miscellaneous

- []
- []
- Open-API-Extensions []

- []
- []
- []
- []

---
Tools - []
OpenAPI Spec - []
---

- REST APIs []
- Api Management []

- JWT
- Token Claims []

- Casbin for ABAC : []
- Golang Repo: []
- White paper: []
- ABAC : []
- Mongodb Adapter: []
- ABAC:
- []
- []
-

- Govaluate
- Repo : []
---

### Running the App

```shell
oapi-codegen -package=api -generate "types,spec,fiber" oapi_codegen.yml > api/api.gen.go
```

> **[ ORIGINAL/OLD PLAN ]**

About

> - Server to a flutter android chat-app.
> - The server uses nodejs and frameworks such as ExpressJs, featherJs, stompjs & Prisma ORM.
> - it is split into 2 different servers
> 1. **chat-server** : for handling chats
> 2. **media-server** : for handling media files or basically files
> - _*more information on this will be found in the documentation folder_
> - figma links for the designs:
> 1. **auth maps & personas:** Β Β  [visit πŸ”—](https://www.figma.com/file/SBMlL6FtJD69ajJFPGJToU/Telko-moment-%7C-auth-map-%26-User-personas?t=eWpYCmGxitRb2tc7-1)
> 2. **wire frame & prototype** Β Β  [visit πŸ”—](https://www.figma.com/file/ZuSQwcxKaC3hUuFuSnsCqK/Telko-moment-%7C-wireframe-%26-Prototype?t=eWpYCmGxitRb2tc7-1)

## Requirements

> Most of the server requirements are mostly javascript based and a few are other languages but mostly for supporting architecture.
> The requirements are as follows:

1. Nodejs & NPM(Node Package Manager)
2. ExpressJs
3. FeathersJs
4. Stompjs
5. Prisma
6. Databases
1. Mongodb (server)
2. SQLite (mobile)
7. RabbitMQ
- stomp plugin

## Folder Structure

/
β”œβ”€β”€β”€design/
β”œβ”€β”€β”€documentation/
β”‚ β”œβ”€β”€β”€mobile/
β”‚ └───server/
└───server/
β”œβ”€β”€β”€bin/
β”œβ”€β”€β”€cmd/
β”œβ”€β”€β”€configs/
β”œβ”€β”€β”€internal/
β”‚ β”œβ”€β”€β”€audios/
β”‚ β”œβ”€β”€β”€auth/
β”‚ β”œβ”€β”€β”€messages/
β”‚ β”œβ”€β”€β”€pictures/
β”‚ β”œβ”€β”€β”€users/
β”‚ └───videos/
β”œβ”€β”€β”€pkg/
└───test/

---


>## `The conventional Go project structure.`

```plaintext
chat-app/
β”œβ”€β”€ cmd/
β”‚ └── server/
β”‚ └── main.go # Application entry point
β”œβ”€β”€ internal/
β”‚ β”œβ”€β”€ models/
β”‚ β”‚ β”œβ”€β”€ message.go # Message data structures
β”‚ β”‚ └── auth.go # User data structures
β”‚ β”œβ”€β”€ controllers/
β”‚ β”‚ β”œβ”€β”€ auth_controller.go # Authentication controllers
β”‚ β”‚ β”œβ”€β”€ message_controller.go # Message controllers
β”‚ β”‚ └── websocket_controller.go # WebSocket connection controller
β”‚ β”œβ”€β”€ handlers/
β”‚ β”‚ β”œβ”€β”€ auth.go # Authentication handlers
β”‚ β”‚ β”œβ”€β”€ message.go # Message handling
β”‚ β”‚ └── websocket.go # WebSocket connection handling
β”‚ β”œβ”€β”€ repository/
β”‚ β”‚ β”œβ”€β”€ message_repo.go # Message database operations
β”‚ β”‚ └── user_repo.go # User database operations
β”‚ └── service/
β”‚ β”œβ”€β”€ auth_service.go # Authentication business logic
β”‚ └── chat_service.go # Chat business logic
β”œβ”€β”€ pkg/
β”‚ β”œβ”€β”€ websocket/
β”‚ β”‚ └── client.go # WebSocket client implementation
β”‚ └── utils/
β”‚ └── validator.go # Common validation utilities
β”œβ”€β”€ configs/
β”‚ └── config.yaml # Application configuration
β”œβ”€β”€ api/
β”‚ └── routes.go # API route definitions
β”œβ”€β”€ migrations/
β”‚ └── schema.sql # Database migrations
β”œβ”€β”€ go.mod # Go module file
└── go.sum # Go module checksum file

```

Each directory and its purpose:

1. `cmd/`: Contains the main applications of your project
- This is where your main.go lives
- Each subdirectory should match the name of the executable you want to build

2. `internal/`: Contains private application code
- `models/`: Data structures that represent your domain
- `controllers/`: route controllers
- `handlers/`: HTTP/WebSocket request handlers
- `repository/`: Database interaction layer
- `service/`: Business logic layer

3. `pkg/`: Contains code that's ok to be used by external applications
- Put reusable components here
- In your case, websocket handling utilities could go here

4. `configs/`: Configuration files
- YAML, JSON, or other config files
- Environment variables templates

5. `api/`: API-related definitions
- Route setup
- API documentation
- OpenAPI/Swagger specs if you use them

6. `migrations/`: Database migration files

This structure follows these key Go principles:

- Separation of concerns
- Clear dependency direction (dependencies flow inward)
- Package-by-feature rather than package-by-layer
- Private application code in `internal/`
- Shared code in `pkg/`

---

### Packages

- fiberi18n: []

---

### Use of AI
- AIs have been used in making this app (well; it is 2025 and an extra hand/boost won't hurt) .... although it doesn't control anything or take lead, only for quick questions and some boring but necessary stuff
- Claude 3.5 & 3.6 (anthropic)
- Grok 3 Beta
- Gemini (google)

---