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

https://github.com/rinnothing/grpc-chat

A pet project focused on building a LAN chat using grpc for message delivery and zeroconf for device discovery
https://github.com/rinnothing/grpc-chat

go golang grpc grpc-go pet-projects zeroconf

Last synced: about 1 year ago
JSON representation

A pet project focused on building a LAN chat using grpc for message delivery and zeroconf for device discovery

Awesome Lists containing this project

README

          

# grpc-chat

A pet project focused on building a LAN chat using grpc for message delivery and zeroconf for device discovery

### currently in development

# Clean Architecture

Recently at the university I was told about clean architecture and in this project I'm trying to follow what I've
learned.

### Below is the description of what every folder does:

- [api/chat](api/chat)
contains proto files that represent the calls server supports
- [internal/app/chat](internal/app/chat)
contains server files that use given usecases to operate as well as does a simple validation
- [internal/config](internal/config)
just a config
- [internal/pkg/convert](internal/pkg/convert)
contains methods for conversions between model and grpc structures I often use in [usecases](internal/pkg/usecases)
- [internal/pkg/model](internal/pkg/model)
contains structures that [usecases](internal/pkg/usecases) manipulate with
- [internal/pkg/presenter](internal/pkg/presenter)
contains tools to exchange with the world around
(just a template, will be later rewritten to use some TUI framework)
- [internal/pkg/presenter/chat](internal/pkg/presenter/chat)
is used for presenting info about incoming messages, new and closed chats
- [internal/pkg/presenter/dialogue](internal/pkg/presenter/dialogue)
represents a dialogue to ask for will to allow new chatter
- [internal/pkg/repository](internal/pkg/repository)
keeps repositories to store and retrieve info about users or messages
- [internal/pkg/repository/connections](internal/pkg/repository/connections)
is used to manage connections: preventing two connections under one name and so on
- [internal/pkg/repository/identify](internal/pkg/repository/identify)
just gives out user's model to identify yourself when sending or answering requests
- [internal/pkg/repository/message](internal/pkg/repository/message)
stores messages, returning their ids and returns messages by them
(later will be rewritten using proper database, for now in-memory)
- [internal/pkg/repository/user](internal/pkg/repository/user)
stores users, returning their ids, will later implement some black/whitelist function
(later will be rewritten using proper database, for now in-memory)
- [internal/pkg/usecases](internal/pkg/usecases)
contains actual implementations of all business logic
- [pkg/generated/proto](pkg/generated/proto)
contains gRPC client and server files generated by protoc in [Makefile](Makefile)

### Later I will add following folders:

- [cmd/app](cmd/app)
launches an app by building all repos and injecting them into an app
- and all the others that are needed to make server like this to handle new clients appearing on zeroconf and probably
one to handle the UI