You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fc5a5d0
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+30-67Lines changed: 30 additions & 67 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,11 +31,40 @@ dalgo/
31
31
│ ├── docker-compose.yml ← production
32
32
│ └── docker-compose.dev.yml ← local dev
33
33
└── scripts/
34
-
└── sync.sh ← pull latest from individual repos (transition period)
34
+
├── install-hooks.sh ← run once after cloning to install git hooks
35
+
└── hooks/pre-commit ← the hook (black + prettier + eslint on staged files)
35
36
```
36
37
37
38
---
38
39
40
+
## Contributing
41
+
42
+
### One-time setup after cloning
43
+
44
+
```bash
45
+
./scripts/install-hooks.sh
46
+
```
47
+
48
+
This installs a git pre-commit hook that runs automatically on every `git commit`:
49
+
50
+
| Service | Tool | Behaviour |
51
+
|---|---|---|
52
+
|`backend/`| black | auto-formats and re-stages |
53
+
|`prefect-proxy/`| black | auto-formats and re-stages |
54
+
|`webapp/`| prettier | auto-formats and re-stages |
55
+
|`webapp/`| eslint | check only — fix errors manually |
56
+
57
+
**Auto-formatting:** black and prettier rewrite files in place and re-stage them, so your commit always lands clean. If prettier or black reformats something, just re-run `git commit` — the second attempt will pass.
58
+
59
+
**ESLint errors:** fix them manually, then commit again. Warnings are also blocked (`--max-warnings=0`) to stay in sync with CI.
60
+
61
+
### Requirements
62
+
63
+
-`uv` — for backend/prefect-proxy black ([install](https://docs.astral.sh/uv/getting-started/installation/))
64
+
-`node` + `npm` — for webapp prettier/eslint (node_modules must be installed: `cd webapp && npm install`)
65
+
66
+
---
67
+
39
68
## Docker setup
40
69
41
70
All compose commands run from the `docker/` directory.
Two scripts handle keeping the monorepo in sync with the individual repos while they're still active.
87
-
88
-
### `scripts/bootstrap.sh` — full re-import with complete git history
89
-
90
-
Rebuilds the monorepo from scratch: clones all four repos, rewrites their history into the correct subdirectory paths, merges them together, and commits the monorepo Docker infra on top.
91
-
92
-
```bash
93
-
# Rebuild locally
94
-
./scripts/bootstrap.sh
95
-
96
-
# Rebuild and force-push to origin/main in one step
97
-
./scripts/bootstrap.sh --push
98
-
```
99
-
100
-
After a `--push`, teammates sync with:
101
-
```bash
102
-
git fetch --force && git reset --hard origin/main
103
-
```
104
-
105
-
**When to use:** when you want the monorepo to fully reflect the latest commits (and history) from all individual repos — e.g. before archiving the individual repos, or after a batch of changes has landed across multiple services.
106
-
107
-
**Requires:**`brew install git-filter-repo`
108
-
109
-
---
110
-
111
-
### `scripts/sync.sh` — lightweight code sync (no history rewrite)
112
-
113
-
Pulls the latest code from each repo via rsync. Faster than bootstrap — caches clones in `.sync-cache/` so subsequent runs only fetch new commits. Does **not** touch `docker/`.
114
-
115
-
```bash
116
-
# Sync all services
117
-
./scripts/sync.sh
118
-
119
-
# Sync one service
120
-
./scripts/sync.sh backend
121
-
122
-
# Review what changed, then commit
123
-
git diff --stat
124
-
git add -A && git commit -m "sync: $(date +%Y-%m-%d)"
125
-
```
126
-
127
-
**When to use:** for routine day-to-day syncing between bootstraps — pulls latest code and `.env` files without rewriting history.
128
-
129
-
---
130
-
131
-
### Which to use when
132
-
133
-
| Scenario | Script |
134
-
|---|---|
135
-
| Catch up on a batch of changes, preserve per-commit history |`bootstrap.sh --push`|
136
-
| Quick pull of latest code between bootstraps |`sync.sh`|
137
-
| Final sync before archiving individual repos |`bootstrap.sh --push`|
138
-
139
-
### Source repo → monorepo directory mapping
140
-
141
-
| Source repo | Monorepo dir |
142
-
|---|---|
143
-
|`DalgoT4D/DDP_backend`|`backend/`|
144
-
|`DalgoT4D/webapp_v2`|`webapp/`|
145
-
|`DalgoT4D/prefect-proxy`|`prefect-proxy/`|
146
-
|`DalgoT4D/ai-llm-service`|`ai-llm-service/`|
147
-
148
-
---
149
-
150
113
## Adding / changing Docker config
151
114
152
115
All Dockerfiles and compose files live in `docker/`. Changes here do not affect the individual repos.
0 commit comments