Intelligence, Advanced Charting & Trading Platform
docs: advance state to PostgreSQL core implementation
davoodmehraban89 committed
Oct 5, 2026 at 09:52 UTC
ecf90dbbdc7a2ad60ec798a3758423898c4fa4c2
1 file changed
+28
-33
PROJECT_STATE.md
+28
-33
@@ -3,7 +3,7 @@
3
Last updated: 2026-10-05
4
5
## Current phase
6
-Phase 0 — Foundation & Governance
6
+Phase 0 — Foundation & Governance; PostgreSQL core implementation in progress.
7
8
## Product scope locked for MVP
9
- Iran free-market USD/IRT
@@ -15,45 +15,40 @@ Phase 0 — Foundation & Governance
15
16
## Architecture baseline
17
- Modular monolith for the MVP.
18
-- TypeScript/React/Next.js web application; exact package versions are pinned when implementation begins.
19
-- PostgreSQL as canonical datastore; Supabase is the preferred MVP PostgreSQL/Auth/Realtime platform, pending project connection.
20
-- Cloudflare as edge/runtime/cache/protection layer, not the primary database.
18
+- TypeScript/React/Next.js web application.
19
+- PostgreSQL is the canonical datastore; hosting is provider-portable through `DATABASE_URL`.
20
+- Neon is the preferred initial managed PostgreSQL provider, but is not a domain dependency.
21
+- Cloudflare is edge/runtime/cache/protection; Hyperdrive may front PostgreSQL after credentials exist.
22
- Provider adapters feed immutable raw observations, normalization, quality gates, candle construction, and derived-series calculation.
23
- UTC canonical storage; Asia/Tehran presentation.
24
24
-## Connection priority
25
-P0: GitHub, Context7, PostgreSQL/Supabase, Cloudflare.
26
-P1: Figma, Notion.
27
-P2: TradingCursor (benchmark/research only), Gmail, Railway/Render if a demonstrated need appears.
28
-
25
## Completed
30
-- Independent private GitHub repository created: `davoodmehraban89/VELYQOR`.
31
-- Initial `main` branch established by owner.
32
-- Foundation branch created: `foundation/phase-0`.
33
-- Product README normalized.
34
-- Engineering/agent operating rules added.
35
-- Next.js current documentation checked through Context7; current v16 documentation requires Node.js >=20.9 and supports TypeScript/App Router defaults.
26
+- Independent private GitHub repository established.
27
+- Phase 0 foundation PR passed CI and was merged to `main`.
28
+- Engineering rules, Definition of Done, architecture baseline and canonical market contracts established.
29
+- PostgreSQL portability decision recorded in ADR-0002.
30
+- Initial PostgreSQL migrations created for instruments, providers, raw observations, normalized ticks, candles, derived values, data-quality events, users, workspaces and drawings.
31
+- Six canonical MVP instruments are seeded.
32
+- Database invariant test added for canonical instruments and invalid OHLC rejection.
33
+- Cloudflare account connection verified; Hyperdrive API is available and currently has no configurations.
34
+- Neon plugin is installed in the ChatGPT environment, but its operational actions are not exposed in this conversation yet.
35
36
## In progress
38
-- Architecture Decision Records.
39
-- Canonical instrument/unit/time contracts.
40
-- Repository skeleton and CI baseline.
41
-- Supabase/PostgreSQL connection.
42
-- Cloudflare environment connection.
43
-- Phase 1 provider research and data proof.
44
-
45
-## Blockers / external actions
46
-- Supabase project for VELYQOR is not yet identified/connected.
47
-- Cloudflare application/environment for VELYQOR is not yet identified/connected.
48
-- Figma and Notion project spaces are not required to start data proof, but are pending for P1.
37
+- Provisioning a managed PostgreSQL database for VELYQOR.
38
+- Applying and executing database migrations/invariant tests against a real PostgreSQL instance.
39
+- Cloudflare Hyperdrive configuration after PostgreSQL credentials exist.
40
+- Phase 1 provider research/data proof.
41
+
42
+## External blocker
43
+A live PostgreSQL instance has not yet been provisioned/connected in this conversation. Until a database connection is available, migrations cannot truthfully be reported as executed. Neon is the selected initial provider; the schema itself remains portable PostgreSQL.
44
45
## Risks
51
-- Iranian market-data providers may have licensing, timestamp-quality, anti-bot, history, or reliability limitations.
52
-- UI timeframe availability must be constrained by actual observation frequency; synthetic precision is prohibited.
53
-- XAU/USD and USD/IRT source timestamps require explicit alignment and staleness thresholds for theoretical gold.
46
+- Iranian market-data provider licensing, timestamp quality, anti-bot restrictions, history and reliability.
47
+- UI timeframes must reflect actual observation frequency; synthetic precision is prohibited.
48
+- XAU/USD and USD/IRT source timestamps require explicit alignment/staleness thresholds.
49
50
## Next checkpoint
56
-1. Commit initial ADRs and data contracts.
57
-2. Establish minimal TypeScript/Next.js repository skeleton and CI.
58
-3. Connect/create PostgreSQL/Supabase resources.
59
-4. Begin provider research and implement the first raw-ingestion proof only after provider/legal/technical suitability is documented.
51
+1. Provision/connect VELYQOR PostgreSQL.
52
+2. Execute migrations and invariant tests.
53
+3. Create Cloudflare Hyperdrive against the database.
54
+4. Start Phase 1 provider adapters and data-quality proof.