A pet project focused on building a LAN chat using grpc for message delivery and zeroconf for device discovery
Recently at the university I was told about clean architecture and in this project I'm trying to follow what I've learned.
- api/chat
contains proto files that represent the calls server supports - internal/app/chat
contains server files that use given usecases to operate as well as does a simple validation - internal/config
just a config - internal/pkg/convert
contains methods for conversions between model and grpc structures I often use in usecases - internal/pkg/model contains structures that usecases manipulate with
- 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
is used for presenting info about incoming messages, new and closed chats - internal/pkg/presenter/dialogue represents a dialogue to ask for will to allow new chatter
- internal/pkg/presenter/chat
- internal/pkg/repository
keeps repositories to store and retrieve info about users or messages- internal/pkg/repository/connections
is used to manage connections: preventing two connections under one name and so on - internal/pkg/repository/identify
just gives out user's model to identify yourself when sending or answering requests - 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
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/repository/connections
- internal/pkg/usecases
contains actual implementations of all business logic - pkg/generated/proto
contains gRPC client and server files generated by protoc in Makefile
- 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