Add initial documentation and configuration files for AITrader project

This commit is contained in:
2026-05-12 19:50:16 +02:00
parent 818e179fd0
commit aaafe8fa3f
12 changed files with 391 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
# AGENTS.md Repository QuickStart Guide
**Purpose**: Give OpenCode agents the exact commands and conventions they need to work safely and efficiently in the *AITrader* codebase. Only include items that are easy to miss without explicit guidance.
---
## Core npm scripts (run from the repository root)
- `npm run dev` Starts the development server with hotmodule replacement via **reactrouter dev**. The app is served at `http://localhost:5173`.
- `npm run build` Produces a production build using **reactrouter build**. Output lives in `./build` with `client/` (static assets) and `server/` (Node entry point).
- `npm start` Serves the built server bundle with **reactrouter-serve ./build/server/index.js**. Use after `npm run build`.
- `npm run typecheck` Runs **reactrouter typegen** then `tsc`. Must be run before committing any TypeScript changes.
## Development workflow
1. **Install deps** `npm install` (first time only).
2. **Start dev** `npm run dev`. Changes are hotreloaded; no manual restart needed.
3. **Iterate** Edit files under `src/` (React components, routes, loaders, actions, etc.).
4. **Validate** Run `npm run typecheck` regularly; it catches missing typegen steps.
5. **Build & serve** When ready for a preview:
```bash
npm run build && npm start
```
This uses the productionready server (`@react-router/serve`).
## Docker deployment (optional)
- Build image: `docker build -t aitrader .`
- Run container: `docker run -p 3000:3000 aitrader`
- The container expects the app to be built; include `npm run build` in your Dockerfile before the final `CMD`.
## TypeScript nuances
- The `typecheck` script runs **reactrouter typegen** first; agents must not skip this step because generated types are required for successful compilation.
- The project uses ES modules (`"type": "module"`). Import paths should include file extensions (`.js`, `.ts`) where Node requires them.
## TailwindCSS
- Tailwind is configured via Vite (`@tailwindcss/vite`). No extra build steps are needed; the dev server and production build automatically process Tailwind classes.
## Common pitfalls agents might miss
- **Running the server without a build** `npm start` will fail if `npm run build` hasn't been executed first.
- **Skipping typegen** Directly running `tsc` without the preceding `react-router typegen` results in missing type definitions.
- **Assuming a `test` script exists** This repository has no test suite; any `npm test` command will error.
- **Port assumptions** Development server runs on `5173`; production server (Docker) defaults to `3000` unless overridden.
---
*Keep this file uptodate as scripts or tooling evolve.*
+328
View File
@@ -0,0 +1,328 @@
{
"nodes": [
{
"id": "react_router_config_ts",
"label": "react-router.config.ts",
"file_type": "code",
"source_file": "react-router.config.ts",
"source_location": "L1"
},
{
"id": "vite_config_ts",
"label": "vite.config.ts",
"file_type": "code",
"source_file": "vite.config.ts",
"source_location": "L1"
},
{
"id": "app_root_tsx",
"label": "root.tsx",
"file_type": "code",
"source_file": "app\\root.tsx",
"source_location": "L1"
},
{
"id": "app_root_links",
"label": "links()",
"file_type": "code",
"source_file": "app\\root.tsx",
"source_location": "L13"
},
{
"id": "app_root_layout",
"label": "Layout()",
"file_type": "code",
"source_file": "app\\root.tsx",
"source_location": "L26"
},
{
"id": "app_root_app",
"label": "App()",
"file_type": "code",
"source_file": "app\\root.tsx",
"source_location": "L44"
},
{
"id": "app_root_errorboundary",
"label": "ErrorBoundary()",
"file_type": "code",
"source_file": "app\\root.tsx",
"source_location": "L48"
},
{
"id": "app_routes_ts",
"label": "routes.ts",
"file_type": "code",
"source_file": "app\\routes.ts",
"source_location": "L1"
},
{
"id": "app_routes_home_tsx",
"label": "home.tsx",
"file_type": "code",
"source_file": "app\\routes\\home.tsx",
"source_location": "L1"
},
{
"id": "routes_home_meta",
"label": "meta()",
"file_type": "code",
"source_file": "app\\routes\\home.tsx",
"source_location": "L4"
},
{
"id": "routes_home_home",
"label": "Home()",
"file_type": "code",
"source_file": "app\\routes\\home.tsx",
"source_location": "L11"
},
{
"id": "app_welcome_welcome_tsx",
"label": "welcome.tsx",
"file_type": "code",
"source_file": "app\\welcome\\welcome.tsx",
"source_location": "L1"
},
{
"id": "welcome_welcome_welcome",
"label": "Welcome()",
"file_type": "code",
"source_file": "app\\welcome\\welcome.tsx",
"source_location": "L4"
},
{
"id": "welcome_welcome_resources",
"label": "resources",
"file_type": "code",
"source_file": "app\\welcome\\welcome.tsx",
"source_location": "L49"
}
],
"edges": [
{
"source": "react_router_config_ts",
"target": "config",
"relation": "imports_from",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "react-router.config.ts",
"source_location": "L1",
"weight": 1.0
},
{
"source": "vite_config_ts",
"target": "vite",
"relation": "imports_from",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "vite.config.ts",
"source_location": "L1",
"weight": 1.0
},
{
"source": "vite_config_ts",
"target": "vite",
"relation": "imports_from",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "vite.config.ts",
"source_location": "L2",
"weight": 1.0
},
{
"source": "vite_config_ts",
"target": "vite",
"relation": "imports_from",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "vite.config.ts",
"source_location": "L3",
"weight": 1.0
},
{
"source": "app_root_tsx",
"target": "react_router",
"relation": "imports_from",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "app\\root.tsx",
"source_location": "L1",
"weight": 1.0
},
{
"source": "app_root_tsx",
"target": "c_users_henry_programming_aitrader_app_types_root",
"relation": "imports_from",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "app\\root.tsx",
"source_location": "L10",
"weight": 1.0
},
{
"source": "app_root_tsx",
"target": "types_root_route",
"relation": "imports",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "app\\root.tsx",
"source_location": "L10",
"weight": 1.0
},
{
"source": "app_root_tsx",
"target": "c_users_henry_programming_aitrader_app_app_css",
"relation": "imports_from",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "app\\root.tsx",
"source_location": "L11",
"weight": 1.0
},
{
"source": "app_root_tsx",
"target": "app_root_links",
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "app\\root.tsx",
"source_location": "L13",
"weight": 1.0
},
{
"source": "app_root_tsx",
"target": "app_root_layout",
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "app\\root.tsx",
"source_location": "L26",
"weight": 1.0
},
{
"source": "app_root_tsx",
"target": "app_root_app",
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "app\\root.tsx",
"source_location": "L44",
"weight": 1.0
},
{
"source": "app_root_tsx",
"target": "app_root_errorboundary",
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "app\\root.tsx",
"source_location": "L48",
"weight": 1.0
},
{
"source": "app_routes_ts",
"target": "routes",
"relation": "imports_from",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "app\\routes.ts",
"source_location": "L1",
"weight": 1.0
},
{
"source": "app_routes_home_tsx",
"target": "c_users_henry_programming_aitrader_app_routes_types_home",
"relation": "imports_from",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "app\\routes\\home.tsx",
"source_location": "L1",
"weight": 1.0
},
{
"source": "app_routes_home_tsx",
"target": "types_home_route",
"relation": "imports",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "app\\routes\\home.tsx",
"source_location": "L1",
"weight": 1.0
},
{
"source": "app_routes_home_tsx",
"target": "app_welcome_welcome_tsx",
"relation": "imports_from",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "app\\routes\\home.tsx",
"source_location": "L2",
"weight": 1.0
},
{
"source": "app_routes_home_tsx",
"target": "welcome_welcome_welcome",
"relation": "imports",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "app\\routes\\home.tsx",
"source_location": "L2",
"weight": 1.0
},
{
"source": "app_routes_home_tsx",
"target": "routes_home_meta",
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "app\\routes\\home.tsx",
"source_location": "L4",
"weight": 1.0
},
{
"source": "app_routes_home_tsx",
"target": "routes_home_home",
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "app\\routes\\home.tsx",
"source_location": "L11",
"weight": 1.0
},
{
"source": "app_welcome_welcome_tsx",
"target": "c_users_henry_programming_aitrader_app_welcome_logo_dark_svg",
"relation": "imports_from",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "app\\welcome\\welcome.tsx",
"source_location": "L1",
"weight": 1.0
},
{
"source": "app_welcome_welcome_tsx",
"target": "c_users_henry_programming_aitrader_app_welcome_logo_light_svg",
"relation": "imports_from",
"context": "import",
"confidence": "EXTRACTED",
"source_file": "app\\welcome\\welcome.tsx",
"source_location": "L2",
"weight": 1.0
},
{
"source": "app_welcome_welcome_tsx",
"target": "welcome_welcome_welcome",
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "app\\welcome\\welcome.tsx",
"source_location": "L4",
"weight": 1.0
},
{
"source": "app_welcome_welcome_tsx",
"target": "welcome_welcome_resources",
"relation": "contains",
"confidence": "EXTRACTED",
"source_file": "app\\welcome\\welcome.tsx",
"source_location": "L49",
"weight": 1.0
}
],
"input_tokens": 0,
"output_tokens": 0
}
+1
View File
@@ -0,0 +1 @@
{"nodes": [], "edges": [], "hyperedges": []}
+1
View File
@@ -0,0 +1 @@
{"files": {"code": ["C:\\Users\\Henry\\programming\\AITrader\\react-router.config.ts", "C:\\Users\\Henry\\programming\\AITrader\\vite.config.ts", "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "C:\\Users\\Henry\\programming\\AITrader\\app\\routes.ts", "C:\\Users\\Henry\\programming\\AITrader\\app\\routes\\home.tsx", "C:\\Users\\Henry\\programming\\AITrader\\app\\welcome\\welcome.tsx"], "document": ["C:\\Users\\Henry\\programming\\AITrader\\AGENTS.md", "C:\\Users\\Henry\\programming\\AITrader\\README.md"], "paper": [], "image": ["C:\\Users\\Henry\\programming\\AITrader\\app\\welcome\\logo-dark.svg", "C:\\Users\\Henry\\programming\\AITrader\\app\\welcome\\logo-light.svg"], "video": []}, "total_files": 10, "total_words": 2379, "needs_graph": false, "warning": "Corpus is ~2,379 words - fits in a single context window. You may not need a graph.", "skipped_sensitive": [], "graphifyignore_patterns": 0}
+1
View File
@@ -0,0 +1 @@
C:\Users\Henry\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe
+10
View File
@@ -0,0 +1,10 @@
C:\Users\Henry\programming\AITrader\react-router.config.ts
C:\Users\Henry\programming\AITrader\vite.config.ts
C:\Users\Henry\programming\AITrader\app\root.tsx
C:\Users\Henry\programming\AITrader\app\routes.ts
C:\Users\Henry\programming\AITrader\app\routes\home.tsx
C:\Users\Henry\programming\AITrader\app\welcome\welcome.tsx
C:\Users\Henry\programming\AITrader\AGENTS.md
C:\Users\Henry\programming\AITrader\README.md
C:\Users\Henry\programming\AITrader\app\welcome\logo-dark.svg
C:\Users\Henry\programming\AITrader\app\welcome\logo-light.svg
@@ -0,0 +1 @@
{"nodes": [{"id": "c_users_henry_programming_aitrader_app_routes_ts", "label": "routes.ts", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\routes.ts", "source_location": "L1"}], "edges": [{"source": "c_users_henry_programming_aitrader_app_routes_ts", "target": "routes", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\routes.ts", "source_location": "L1", "weight": 1.0}], "raw_calls": []}
@@ -0,0 +1 @@
{"nodes": [{"id": "c_users_henry_programming_aitrader_app_welcome_welcome_tsx", "label": "welcome.tsx", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\welcome\\welcome.tsx", "source_location": "L1"}, {"id": "welcome_welcome_welcome", "label": "Welcome()", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\welcome\\welcome.tsx", "source_location": "L4"}, {"id": "welcome_welcome_resources", "label": "resources", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\welcome\\welcome.tsx", "source_location": "L49"}], "edges": [{"source": "c_users_henry_programming_aitrader_app_welcome_welcome_tsx", "target": "c_users_henry_programming_aitrader_app_welcome_logo_dark_svg", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\welcome\\welcome.tsx", "source_location": "L1", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_welcome_welcome_tsx", "target": "c_users_henry_programming_aitrader_app_welcome_logo_light_svg", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\welcome\\welcome.tsx", "source_location": "L2", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_welcome_welcome_tsx", "target": "welcome_welcome_welcome", "relation": "contains", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\welcome\\welcome.tsx", "source_location": "L4", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_welcome_welcome_tsx", "target": "welcome_welcome_resources", "relation": "contains", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\welcome\\welcome.tsx", "source_location": "L49", "weight": 1.0}], "raw_calls": [{"caller_nid": "welcome_welcome_welcome", "callee": "map", "is_member_call": true, "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\welcome\\welcome.tsx", "source_location": "L28"}]}
@@ -0,0 +1 @@
{"nodes": [{"id": "c_users_henry_programming_aitrader_vite_config_ts", "label": "vite.config.ts", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\vite.config.ts", "source_location": "L1"}], "edges": [{"source": "c_users_henry_programming_aitrader_vite_config_ts", "target": "vite", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\vite.config.ts", "source_location": "L1", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_vite_config_ts", "target": "vite", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\vite.config.ts", "source_location": "L2", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_vite_config_ts", "target": "vite", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\vite.config.ts", "source_location": "L3", "weight": 1.0}], "raw_calls": []}
@@ -0,0 +1 @@
{"nodes": [{"id": "c_users_henry_programming_aitrader_app_routes_home_tsx", "label": "home.tsx", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\routes\\home.tsx", "source_location": "L1"}, {"id": "routes_home_meta", "label": "meta()", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\routes\\home.tsx", "source_location": "L4"}, {"id": "routes_home_home", "label": "Home()", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\routes\\home.tsx", "source_location": "L11"}], "edges": [{"source": "c_users_henry_programming_aitrader_app_routes_home_tsx", "target": "c_users_henry_programming_aitrader_app_routes_types_home", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\routes\\home.tsx", "source_location": "L1", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_routes_home_tsx", "target": "types_home_route", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\routes\\home.tsx", "source_location": "L1", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_routes_home_tsx", "target": "c_users_henry_programming_aitrader_app_welcome_welcome_tsx", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\routes\\home.tsx", "source_location": "L2", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_routes_home_tsx", "target": "welcome_welcome_welcome", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\routes\\home.tsx", "source_location": "L2", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_routes_home_tsx", "target": "routes_home_meta", "relation": "contains", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\routes\\home.tsx", "source_location": "L4", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_routes_home_tsx", "target": "routes_home_home", "relation": "contains", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\routes\\home.tsx", "source_location": "L11", "weight": 1.0}], "raw_calls": []}
@@ -0,0 +1 @@
{"nodes": [{"id": "c_users_henry_programming_aitrader_app_root_tsx", "label": "root.tsx", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L1"}, {"id": "app_root_links", "label": "links()", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L13"}, {"id": "app_root_layout", "label": "Layout()", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L26"}, {"id": "app_root_app", "label": "App()", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L44"}, {"id": "app_root_errorboundary", "label": "ErrorBoundary()", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L48"}], "edges": [{"source": "c_users_henry_programming_aitrader_app_root_tsx", "target": "react_router", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L1", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_root_tsx", "target": "c_users_henry_programming_aitrader_app_types_root", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L10", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_root_tsx", "target": "types_root_route", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L10", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_root_tsx", "target": "c_users_henry_programming_aitrader_app_app_css", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L11", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_root_tsx", "target": "app_root_links", "relation": "contains", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L13", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_root_tsx", "target": "app_root_layout", "relation": "contains", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L26", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_root_tsx", "target": "app_root_app", "relation": "contains", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L44", "weight": 1.0}, {"source": "c_users_henry_programming_aitrader_app_root_tsx", "target": "app_root_errorboundary", "relation": "contains", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L48", "weight": 1.0}], "raw_calls": [{"caller_nid": "app_root_errorboundary", "callee": "isRouteErrorResponse", "is_member_call": false, "source_file": "C:\\Users\\Henry\\programming\\AITrader\\app\\root.tsx", "source_location": "L53"}]}
@@ -0,0 +1 @@
{"nodes": [{"id": "c_users_henry_programming_aitrader_react_router_config_ts", "label": "react-router.config.ts", "file_type": "code", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\react-router.config.ts", "source_location": "L1"}], "edges": [{"source": "c_users_henry_programming_aitrader_react_router_config_ts", "target": "config", "relation": "imports_from", "context": "import", "confidence": "EXTRACTED", "source_file": "C:\\Users\\Henry\\programming\\AITrader\\react-router.config.ts", "source_location": "L1", "weight": 1.0}], "raw_calls": []}