Skip to content

Commit 998ce29

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 1d8fa7b + a07fbe2 commit 998ce29

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Imageboard Clean Architecture Back-End
2+
3+
*This is the part of project which includes back-end and mobile client.*
4+
5+
**Also check:**
6+
`Android Compose Clean Architecture Client (in progress)`
7+
8+
## Project description:
9+
**Simple anonymous imageboard which allows to create threads, posts and reply to users by quoting their posts.**
10+
11+
## Techs:
12+
- **Golang**
13+
- **MongoDB**
14+
- **gRPC**
15+
- **Protobuf**
16+
- **Docker**
17+
- **Yaml**
18+
19+
### Thoughts:
20+
**Well, I use `Golang` when I need to get simple and obvious product. I really like it, because I can create what I need without tons of libs and avoiding extra dependencies. Also Golang is great to fit with *Clean Architecture* because of abstraction through composition. I think that the stucture of this project is pretty good and I will use it again.**
21+
22+
**I like `MongoDB` because it's flexible and not very complicated to compose effective database query inside repository. Also it doesn't need to create a special abstraction on top of database methods which is definitely an advantage.**
23+
24+
**What about `gRPC`? I think that it's good to be used as a CRUD alternative to REST, but I would prefer Web Sockets for real-time (I mean "actually real-time", e.g. chatting) operations to avoid polling strategy, although gRPC is good for it, but I just think that each task needs it's own tool.**
25+
26+
**`Protobuf` is good to use for crossplatform products, but it's a bit tricky to set up the projects, because the implementations are different (especially in the case of the JVM). Sometimes it matters.**
27+
28+
**`Docker` is simply the best way to deploy an application, especially if you want to use database replication (which is really painful without it).**
29+
30+
**`Yaml` is just the simple way to create separate config file.**

data/repository/post_repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (r *postRepository) CreatePost(ctx context.Context, post *domain.Post) (str
6363
if err != nil {
6464
return err
6565
}
66-
if _, err = r.db.Threads.UpdateOne(ctx, bson.M{"_id": post.ThreadId}, bson.M{"post_count": count}); err != nil {
66+
if _, err = r.db.Threads.UpdateOne(ctx, bson.M{"_id": post.ThreadId}, bson.M{"$set": bson.M{"post_count": count}}); err != nil {
6767
return err
6868
}
6969
return nil

0 commit comments

Comments
 (0)