- Server to a maui mobile app for android chat-app.
- The server uses fiber for golang
List of topics | |
---|---|
System Diagrams | |
Miscellaneous | |
Requirements | |
Folder Structure |
---
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
Tools - [https://42crunch.com/] OpenAPI Spec - [https://swagger.io/docs/specification/v3_0/basic-structure/]
-
REST APIs [https://www.ibm.com/think/topics/rest-apis]
-
Api Management [https://www.ibm.com/think/topics/api-management]
-
JWT
- Token Claims [https://datatracker.ietf.org/doc/html/rfc7519#section-4.2]
-
Casbin for ABAC : [https://casbin.org/]
- Golang Repo: [https://github.com/casbin/casbin]
- White paper: [https://arxiv.org/abs/1903.09756]
- ABAC : [https://casbin.org/docs/abac]
- Mongodb Adapter: [https://github.com/casbin/mongodb-adapter/]
-
ABAC:
-
Govaluate
- Repo : [https://github.com/Knetic/govaluate]
oapi-codegen -package=api -generate "types,spec,fiber" oapi_codegen.yml > api/api.gen.go
[ ORIGINAL/OLD PLAN ]
[ ORIGINAL/OLD PLAN ]
- 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
- chat-server : for handling chats
- 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:
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:
- Nodejs & NPM(Node Package Manager)
- ExpressJs
- FeathersJs
- Stompjs
- Prisma
- Databases
- Mongodb (server)
- SQLite (mobile)
- RabbitMQ
- stomp plugin
/
├───design/
├───documentation/
│ ├───mobile/
│ └───server/
└───server/
├───bin/
├───cmd/
├───configs/
├───internal/
│ ├───audios/
│ ├───auth/
│ ├───messages/
│ ├───pictures/
│ ├───users/
│ └───videos/
├───pkg/
└───test/
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:
-
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
-
internal/
: Contains private application codemodels/
: Data structures that represent your domaincontrollers/
: route controllershandlers/
: HTTP/WebSocket request handlersrepository/
: Database interaction layerservice/
: Business logic layer
-
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
-
configs/
: Configuration files- YAML, JSON, or other config files
- Environment variables templates
-
api/
: API-related definitions- Route setup
- API documentation
- OpenAPI/Swagger specs if you use them
-
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/
- 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)