golang-friends / slack-clone Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Acceptance
Let's rename AuthService
to authservice
or simply auth
(lowercase) to be consistent?
AuthService/cmd/authservice/authservice.go -> auth/cmd/authservice/authservice.go
Not all file systems are case sensitive by default.
I propose to start with web (no hybrid like ionic, no native like flutter, react-native) for the sake of simplicity. And, I propose Angular as it's already pretty opinionated on how to structure the code as well as how to maintain the states although other frameworks may be much simpler to begin with (but everyone will have different opinion on how to structure). Also, I assume we agree on using TypeScript at least.
There are mainly 3 pages.
Instead of workspace your-workspace.slack.com
, we will simply call your-workspace
This is purely done in client side. So, any outgoing requests will have this workspace ID.
We will have slightly different behaviors here. Instead of email signin/signup, we simply use email & password signup/signin.
Also, the user exists per workspace. But, I believe our current implementation is global like discord. We probably need to fix this first or the spec needs to change (slack clone -> discord clone)
And, we simply want to focus on chat functionality initially. So, let's not touch the thread part.
service ChatApi {
rpc PostMessage(PostMessageRequest) returns (EmptyResponse);
rpc UpdateMessage(UpdateMessageRequest) returns (EmptyResponse);
// only server stream is supported in grpc web (https://github.com/grpc/grpc-web#wire-format-mode)
rpc Subscribe(SubscribeRequest) returns (stream SubscribeResponse);
}
message PostMessageRequest {
string token = 1;
Message message = 2;
}
message Message {
string user_id = 1;
string workspace_id = 2;
string channel_id = 3;
string message = 4;
google.protobuf.Timestamp timestamp = 4;
}
message SubscribeRequest {
string token = 1;
string workspace_id = 2;
}
message SubscribeResponse {
Message message = 1;
}
This step was necessary to cache the dependency though.
Without it, everytime a code changes, everything has to be re downloaded and built.
For reference, https://medium.com/@petomalina/using-go-mod-download-to-speed-up-golang-docker-builds-707591336888
slack-clone/authservice/Dockerfile
Lines 1 to 11 in 34b30e6
For example, the proto fields should be lower case (https://developers.google.com/protocol-buffers/docs/style). The generator will convert the names to match the go style guide (PascalCase)
Looking for suggestions here. I am most familiar with Mongodb, Redis, and MySQL.
how it structured is monolithic because of having root internal and root pkg. Each service will freely import each other causing tight coupling.
Do you have a suggestion or expectation on how the project should be structured?
This is going to be a monorepo
Each service should be a go module as its own without root go.mod
/auth
/internal
/...
go.mod
/chat
/internal
/...
go.mod
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.