Skip to content

Commit c961b2d

Browse files
OlshanskPascal van Leeuwencommoddityfredteumer
authored
[PortalDB][Attempt 2] POC PostgREST implementation with API Autogen (#467)
This is a stripped down version of #452 so it's easier to review & understand. **Reviewing** - The key thing to review are the new `.sql` files. **Testing** - `cd ./portal-db; make quickstart` and follow the instructions. Demo: https://github.com/user-attachments/assets/11d15f28-154d-4e90-a212-dbbf9ffd291e --- Co-authored-by: Pascal van Leeuwen <[email protected]> Co-authored-by: commoddity <[email protected]> Co-authored-by: fred <[email protected]>
1 parent 755de8b commit c961b2d

27 files changed

+6232
-607
lines changed

.github/workflows/upload-pages-artifact.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: 18
25+
node-version: 20
2626
cache: "yarn"
2727
cache-dependency-path: docusaurus/yarn.lock
2828

@@ -53,7 +53,7 @@ jobs:
5353
- name: Set up Node.js
5454
uses: actions/setup-node@v4
5555
with:
56-
node-version: 18
56+
node-version: 20
5757
cache: "yarn"
5858
cache-dependency-path: docusaurus/yarn.lock
5959

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,8 @@ install.log
8080
# Generated by ./e2e/scripts/shannon-preliminary-services-test.sh
8181
supplier_report_*.json
8282

83+
# Portal DB
84+
pg_dump.sql
85+
8386
# Benchmark Results
8487
bench_results

Makefile

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,33 @@
44

55
# TODO(@olshansk): Remove "Shannon" and just use "Pocket".
66

7+
# Patterns for classified help categories (automatically used by help-unclassified)
8+
HELP_PATTERNS := \
9+
'^(help|help-unclassified):' \
10+
'^path_(build|run):' \
11+
'^config.*:' \
12+
'^(path_up.*|path_down|install_tools.*|localnet_.*):' \
13+
'^load_test.*:' \
14+
'^(test_unit|test_all|go_lint):' \
15+
'^e2e_test.*:' \
16+
'^bench.*:' \
17+
'^(get_disqualified_endpoints|grove_get_disqualified_endpoints|shannon_preliminary_services_test_help|shannon_preliminary_services_test|source_shannon_preliminary_services_helpers):' \
18+
'^(portal_db_help):' \
19+
'^proto.*:' \
20+
'^release_.*:' \
21+
'^(go_docs|docusaurus.*|gen_.*_docs):' \
22+
'^test_(request|healthz|disqualified|load).*:' \
23+
'^bench_.*:' \
24+
'^claudesync.*:'
25+
726
.PHONY: help
827
.DEFAULT_GOAL := help
928
help: ## Prints all the targets in all the Makefiles
1029
@echo ""
1130
@echo "$(BOLD)$(CYAN)🌐 PATH (Path API & Toolkit Harness) Makefile Targets$(RESET)"
1231
@echo ""
1332
@echo "$(BOLD)=== 📋 Information & Discovery ===$(RESET)"
14-
@grep -h -E '^help:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
33+
@grep -h -E '^(help|help-unclassified):.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
1534
@echo ""
1635
@echo "$(BOLD)=== 🔨 Build & Run ===$(RESET)"
1736
@grep -h -E '^path_(build|run):.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
@@ -20,7 +39,7 @@ help: ## Prints all the targets in all the Makefiles
2039
@grep -h -E '^config.*:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
2140
@echo ""
2241
@echo "$(BOLD)=== 🛠️ Development Environment ===$(RESET)"
23-
@grep -h -E '^(path_up|path_down|install_tools.*|localnet_.*):.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
42+
@grep -h -E '^(path_up.*|path_down|install_tools.*|localnet_.*):.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
2443
@echo ""
2544
@echo "$(BOLD)=== 🚀 Load Testing ===$(RESET)"
2645
@grep -h -E '^load_test.*:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
@@ -36,16 +55,14 @@ help: ## Prints all the targets in all the Makefiles
3655
@grep -h -E '^(get_disqualified_endpoints|grove_get_disqualified_endpoints|shannon_preliminary_services_test_help|shannon_preliminary_services_test|source_shannon_preliminary_services_helpers):.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
3756
@echo ""
3857
@echo "$(BOLD)=== 🗄️ Portal Database ===$(RESET)"
39-
@grep -h -E '^portal_db.*:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
58+
@grep -h -E '^(portal_db_help):.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
4059
@echo ""
4160
@echo "$(BOLD)=== 📦 Protocol Buffers ===$(RESET)"
4261
@grep -h -E '^proto.*:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
4362
@echo ""
4463
@echo "$(BOLD)=== 🚢 Release Management ===$(RESET)"
4564
@grep -h -E '^release_.*:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
4665
@echo ""
47-
@echo "$(BOLD)=== 🔧 Utilities ===$(RESET)"
48-
@echo ""
4966
@echo "$(BOLD)=== 📚 Documentation ===$(RESET)"
5067
@grep -h -E '^(go_docs|docusaurus.*|gen_.*_docs):.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
5168
@echo ""
@@ -59,6 +76,23 @@ help: ## Prints all the targets in all the Makefiles
5976
@grep -h -E '^claudesync.*:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'
6077
@echo ""
6178

79+
.PHONY: help-unclassified
80+
help-unclassified: ## Show all unclassified targets
81+
@echo ""
82+
@echo "$(BOLD)$(CYAN)📦 Unclassified Targets$(RESET)"
83+
@echo ""
84+
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sed 's/:.*//g' | sort -u > /tmp/all_targets.txt
85+
@( \
86+
for pattern in $(HELP_PATTERNS); do \
87+
grep -h -E "$$pattern.*?## .*\$$" $(MAKEFILE_LIST) 2>/dev/null || true; \
88+
done \
89+
) | sed 's/:.*//g' | sort -u > /tmp/classified_targets.txt
90+
@comm -23 /tmp/all_targets.txt /tmp/classified_targets.txt | while read target; do \
91+
grep -h -E "^$$target:.*?## .*\$$" $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "$(CYAN)%-40s$(RESET) %s\n", $$1, $$2}'; \
92+
done
93+
@rm -f /tmp/all_targets.txt /tmp/classified_targets.txt
94+
@echo ""
95+
6296
#############################
6397
#### PATH Build Targets ###
6498
#############################
@@ -93,6 +127,15 @@ check_path_config:
93127
path_run: path_build check_path_config ## Run the path binary as a standalone binary
94128
(cd bin; ./path -config ../${CONFIG_PATH})
95129

130+
###############################
131+
### Portal Database Help ###
132+
###############################
133+
134+
.PHONY: portal_db_help
135+
portal_db_help: ## Show Portal DB makefile targets
136+
@echo "To use these commands: ${CYAN}cd ./portal-db && make <command>${RESET}"
137+
@cd ./portal-db && make help
138+
96139
###############################
97140
### Makefile imports ###
98141
###############################
@@ -104,7 +147,6 @@ include ./makefiles/deps.mk
104147
include ./makefiles/devtools.mk
105148
include ./makefiles/docs.mk
106149
include ./makefiles/localnet.mk
107-
include ./makefiles/portal-db.mk
108150
include ./makefiles/test.mk
109151
include ./makefiles/bench.mk
110152
include ./makefiles/test_requests.mk

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ For Bug Reports and Enhancement Requests, please open an [Issue](https://github.
3535

3636
For Technical Support please open a ticket in [Grove's Discord](https://discord.gg/build-with-grove).
3737

38+
## Portal DB
39+
40+
The portal DB is the source of truth for running a SaaS using PATH to deploya service similar to [Grove's Portal](https://portal.grove.city)
41+
42+
See the following docs for more information:
43+
44+
- [portal-db](./portal-db/README.md)
45+
- [portal-db/api](./portal-db/api/README.md)
46+
3847
---
3948

4049
## License

docusaurus/docs/develop/path/4_path_localnet.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ description: Development environment for the full PATH, GUARD & WATCH stack
3434
- [Development Workflow](#development-workflow)
3535
- [Hot Reloading](#hot-reloading)
3636
- [Viewing Logs](#viewing-logs)
37-
- [Recommended: **Tilt UI** (http://localhost:10350):](#recommended-tilt-ui-httplocalhost10350)
38-
- [**Inside the container**:](#inside-the-container)
39-
- [**Using k9s**:](#using-k9s)
4037

4138
## Overview
4239

@@ -73,7 +70,6 @@ make configs_copy_values_yaml # Copy default .values.yaml
7370
- `./local/path/.config.yaml` - PATH gateway configuration
7471
- `./local/path/.values.yaml` - Helm values override file
7572

76-
7773
:::note 🌿 Are you a Grove employee 🌿?
7874

7975
<details>
@@ -224,7 +220,6 @@ The PATH Localnet runs as a Docker container that internally manages a complete
224220
- **Tilt**: Development orchestrator that manages hot reloading and service lifecycle
225221
- **Kind**: Kubernetes-in-Docker providing the cluster environment
226222

227-
228223
## Make Targets
229224

230225
The PATH Localnet provides several make targets for managing your development environment:
@@ -375,20 +370,20 @@ The PATH Localnet supports hot reloading for rapid development:
375370

376371
Multiple ways to view logs:
377372

378-
#### Recommended: **Tilt UI** (http://localhost:10350):
373+
1. **Tilt UI** (http://localhost:10350):
379374

380-
- Real-time log streaming
381-
- Filtered by service
382-
- Search functionality
375+
- Real-time log streaming
376+
- Filtered by service
377+
- Search functionality
383378

384-
#### **Inside the container**:
379+
2. **Inside the container**:
385380

386381
```bash
387382
make localnet_exec
388383
kubectl logs -f deployment/path
389384
```
390385

391-
#### **Using k9s**:
386+
3. **Using k9s**:
392387

393388
```bash
394389
make localnet_k9s

docusaurus/docusaurus.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const config = {
3636
baseUrl: "/",
3737

3838
onBrokenLinks: "throw",
39-
onBrokenMarkdownLinks: "warn",
4039

4140
i18n: {
4241
defaultLocale: "en",

docusaurus/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"write-heading-ids": "docusaurus write-heading-ids"
1515
},
1616
"dependencies": {
17-
"@docusaurus/core": "^3.8.1",
18-
"@docusaurus/preset-classic": "^3.8.1",
19-
"@docusaurus/theme-mermaid": "^3.8.1",
17+
"@docusaurus/core": "^3.9.1",
18+
"@docusaurus/preset-classic": "^3.9.1",
19+
"@docusaurus/theme-mermaid": "^3.9.1",
2020
"@easyops-cn/docusaurus-search-local": "^0.46.1",
2121
"@mdx-js/react": "^3.0.0",
2222
"clsx": "^2.0.0",
@@ -31,8 +31,8 @@
3131
"remark-mermaid-plugin": "^1.0.2"
3232
},
3333
"devDependencies": {
34-
"@docusaurus/module-type-aliases": "^3.8.1",
35-
"@docusaurus/types": "^3.8.1"
34+
"@docusaurus/module-type-aliases": "^3.9.1",
35+
"@docusaurus/types": "^3.9.1"
3636
},
3737
"browserslist": {
3838
"production": [

0 commit comments

Comments
 (0)