Skip to content

Commit ce98c57

Browse files
FEATURE (docs): Add contribution docs
1 parent 3654b77 commit ce98c57

File tree

3 files changed

+111
-4
lines changed

3 files changed

+111
-4
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
154154

155155
## 🤝 Contributing
156156

157-
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
158-
159-
To see diagrams it is recommended to install "Markdown Preview Enhanced" plugin
157+
Contributions are welcome! Read [contributing guide](contribute/readme.md) for more details, prioerities and rules are specified there.

backend/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ instead of postgresus-db from docker-compose.yml in the root folder.
55

66
> Copy .env.example to .env
77
> Copy docker-compose.yml.example to docker-compose.yml (for development only)
8+
> Go to tools folder and install Postgres versions
89
910
# Run
1011

@@ -69,4 +70,4 @@ If there are couple of models:
6970

7071
# Project rules
7172

72-
Always use time.Now().UTC() instead of time.Now()
73+
Read .cursor/rules folder, it contains all the rules for the project.

contribute/README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
### Prerequisites
2+
3+
1. Read docs in /docs folder, README.md in /backend and /frontend folders
4+
2. Run both backend and frontend following the instructions in their respective README.md files (for development)
5+
3. Read this file till the end
6+
7+
### How to create a pull request?
8+
9+
We use gitflow approach.
10+
11+
1. Create a new branch from main
12+
2. Make changes
13+
3. Create a pull request to main
14+
4. Wait for review
15+
5. Merge pull request
16+
17+
Commits should be named in the following format depending on the type of change:
18+
19+
- `FEATURE (area): What was done`
20+
- `FIX (area): What was fixed`
21+
- `REFACTOR (area): What was refactored`
22+
23+
To see examples, look at commit history in main branch.
24+
25+
Branches should be named in the following format:
26+
27+
- `feature/what_was_done`
28+
- `fix/what_was_fixed`
29+
- `refactor/what_was_refactored`
30+
31+
Example:
32+
33+
- `feature/add_support_of_kubernetes_helm`
34+
- `fix/make_healthcheck_optional`
35+
- `refactor/refactor_navbar`
36+
37+
Before any commit, make sure:
38+
39+
1. You created critical tests for your changes
40+
2. `golangci-lint fmt` and `golangci-lint run` are passing
41+
3. All tests are passing
42+
4. Project is building successfully
43+
44+
If you need to add some explanation, do it in appropriate place in the code. Or in the /docs folder if it is something general. For charts, use Mermaid.
45+
46+
### Priorities
47+
48+
Before taking anything more than a couple of lines of code, please write Rostislav via Telegram (@rostislav_dugin) and confirm priority. It is possible that we already have something in the works, it is not needed or it's not project priority.
49+
50+
Deploy flow:
51+
52+
- add support of Kubernetes Helm (in progress by Rostislav Dugin)
53+
- add devcontainers for backend and frontend
54+
55+
Backups flow:
56+
57+
- add FTP
58+
- add Dropbox
59+
- add OneDrive
60+
- add NAS
61+
- add Yandex Drive
62+
- think about pg_dumpall / pg_basebackup / WAL backup / incremental backups
63+
- add encryption for backups
64+
65+
Notifications flow:
66+
67+
- add Mattermost
68+
- add MS Teams
69+
70+
Extra:
71+
72+
- add prettier labels to GitHub README
73+
- allow to download backup file (via streaming)
74+
- add linters and formatters on each PR
75+
- add versioning instead of :latest
76+
- create pretty website like rybbit.io with demo
77+
- add HTTPS for Postgresus
78+
- add simple SQL queries via UI
79+
- add brute force protection on auth (via local RPS limiter)
80+
81+
Monitoring flow:
82+
83+
- add system metrics (CPU, RAM, disk, IO)
84+
- add queries stats (slowest, most frequent, etc. via pg_stat_statements)
85+
- add alerting for slow queries (listen for slow query and if they reach >100ms - send message)
86+
- add alerting for high resource usage (listen for high resource usage and if they reach >90% - send message)
87+
- add DB size distribution chart (tables, indexes, etc.)
88+
- add performance test for DB (to compare DBs on different clouds and VPS)
89+
- add DB metrics (pg_stat_activity, pg_locks, pg_stat_database)
90+
- add chart of connections (from IPs, apps names, etc.)
91+
- add chart of transactions (TPS)
92+
- deadlocks chart
93+
- chart of connection attempts (to see crash loops)
94+
- add chart of IDLE transactions VS executing transactions
95+
- show queries that take the most IO time (suboptimal indexes)
96+
- show chart by top IO / CPU queries usage (see page 90 of the PostgreSQL monitoring book)
97+
98+
```
99+
exec_time | IO | CPU | query
100+
105 hrs | 73% | 27% | SELECT * FROM users;
101+
```
102+
103+
- chart of read / update / delete / insert queries
104+
- chart with deadlocks, conflicts, rollbacks (see page 115 of the PostgreSQL monitoring book)
105+
- stats of buffer usage
106+
- status of IO (DB, indexes, sequences)
107+
- % of cache hit
108+
- replication stats

0 commit comments

Comments
 (0)