Overview
PULSE — Project Rules
MVP Features
- PsychAssist: Prevents tilting/overtrading via emotional resonance + duration-based execution monitoring
- RiskFlow: AI-powered news feed interpreting macro data with IV Scoring Matrix
UI Inspiration
- macroscope.app + Cursor.com aesthetic
Tech Stack
Deployment (Priority Order)
| Priority |
Platform |
Use Case |
| Primary |
Encore.dev (Encore Cloud) |
Backend services, APIs, DB, secrets, scheduled jobs |
| Secondary |
Cloudflare (Workers/Pages) |
Edge functions, static hosting, CDN, fallback |
Frontend
- TypeScript (94%+ of codebase)
- Next.js + Tailwind CSS
- Electron for desktop app
- Framer for landing pages (limited deps: Framer Motion, Framer React only)
Backend
- Encore.dev (TypeScript runtime)
- PostgreSQL (Encore managed)
- AWS Bedrock (session management)
- Clerk (
@clerk/clerk-sdk-node) for auth
- LangChain v0.3.x for AI orchestration
- VectorDB for embeddings/semantic search
DevOps
- GitHub Actions for CI/CD
- Cloudflare Workers for edge compute
- Secrets via Encore secrets + env vars
Required Patterns
Encore API Endpoints
import { api, APIError } from "encore.dev/api";
export const myEndpoint = api(
{ method: "POST", path: "/api/resource", auth: true },
async (req: RequestType): Promise => {
// Implementation
}
);
Defensive Null Checks
if (!auth?.userID) {
console.error("Missing auth data");
return { conversations: [] };
}
Circuit Breaker
let circuitBreakerTripped = false;
const fetchWithCircuitBreaker = async (url: string) => {
if (circuitBreakerTripped) {
return { error: "System offline", data: null };
}
try {
const response = await fetch(url);
if (response.status === 500) circuitBreakerTripped = true;
return { data: await response.json(), error: null };
} catch (e) {
return { error: e.message, data: null };
}
};
API Documentation Sources
| Service |
Docs |
Key Areas |
| Encore.dev |
encore.dev/docs |
Endpoints, SQLDatabase, Secrets, Auth |
| Clerk |
clerk.com/docs |
Auth, SDK methods, webhooks |
| AWS Bedrock |
docs.aws.amazon.com/bedrock |
Session mgmt, model invocation |
| LangChain |
js.langchain.com/docs |
Chains, agents, memory, tools |
| Cloudflare |
developers.cloudflare.com/workers |
Edge functions, KV, D1 |
Codebase Summary
For a comprehensive overview of the codebase architecture, services, APIs, and implementation details, see:
.cursor/skills/pulse/CODEBASE-SUMMARY.md
This summary includes:
- Complete API endpoint documentation
- Database schema and migrations
- Service architecture and module breakdown
- Integration points (TopstepX, AWS Bedrock, Clerk)
- Known issues and build-time considerations
- Development patterns and code examples
Current Status
✅ Completed
- Encore.dev backend (Express migration done)
- AWS Bedrock Session Management
- Cloudflare architecture
- Database migrations + tagged template syntax
- Circuit breaker + error handling
- CORS + lazy initialization
- Clerk auth SDK
- Secrets management
- LangChain v0.3.x + VectorDB
- TypeScript frontend + Electron desktop
- CI/CD (GitHub Actions)
🚧 In Progress
- Autopilot Integration
- News Feed Launch & Debugging
- Agentic AI for IV Scoring
- Day-Bound Conversation Thread History
- App-Agentic Brain Layer
1---2name: pulse3description: PULSE is the world's first true AI-powered Integrated Trading Environment (ITE) under **Priced In Research.4---5
6# Overview
7
8# PULSE — Project Rules
9
10### MVP Features
11- **PsychAssist**: Prevents tilting/overtrading via emotional resonance + duration-based execution monitoring
12- **RiskFlow**: AI-powered news feed interpreting macro data with IV Scoring Matrix
13
14### UI Inspiration
15- macroscope.app + Cursor.com aesthetic
16
17---
18
19## Tech Stack
20
21### Deployment (Priority Order)
22| Priority | Platform | Use Case |
23|----------|----------|----------|
24| Primary | **Encore.dev** (Encore Cloud) | Backend services, APIs, DB, secrets, scheduled jobs |
25| Secondary | **Cloudflare** (Workers/Pages) | Edge functions, static hosting, CDN, fallback |
26
27### Frontend
28- **TypeScript** (94%+ of codebase)
29- **Next.js** + **Tailwind CSS**
30- **Electron** for desktop app
31- **Framer** for landing pages (limited deps: Framer Motion, Framer React only)
32
33### Backend
34- **Encore.dev** (TypeScript runtime)
35- **PostgreSQL** (Encore managed)
36- **AWS Bedrock** (session management)
37- **Clerk** (`@clerk/clerk-sdk-node`) for auth
38- **LangChain v0.3.x** for AI orchestration
39- **VectorDB** for embeddings/semantic search
40
41### DevOps
42- **GitHub Actions** for CI/CD
43- **Cloudflare Workers** for edge compute
44- Secrets via **Encore secrets** + env vars
45
46---
47
48## Required Patterns
49
50### Encore API Endpoints
51import { api, APIError } from "encore.dev/api";
52export const myEndpoint = api(
53{ method: "POST", path: "/api/resource", auth: true },
54async (req: RequestType): Promise<ResponseType> => {
55// Implementation
56}
57);
58
59### Defensive Null Checks
60
61if (!auth?.userID) {
62console.error("Missing auth data");
63return { conversations: [] };
64}
65
66### Circuit Breaker
67
68let circuitBreakerTripped = false;
69const fetchWithCircuitBreaker = async (url: string) => {
70if (circuitBreakerTripped) {
71return { error: "System offline", data: null };
72}
73try {
74const response = await fetch(url);
75if (response.status === 500) circuitBreakerTripped = true;
76return { data: await response.json(), error: null };
77} catch (e) {
78return { error: e.message, data: null };
79}
80};
81
82---
83
84## API Documentation Sources
85| Service | Docs | Key Areas |
86|---------|------|-----------|
87| Encore.dev | `encore.dev/docs` | Endpoints, SQLDatabase, Secrets, Auth |
88| Clerk | `clerk.com/docs` | Auth, SDK methods, webhooks |
89| AWS Bedrock | `docs.aws.amazon.com/bedrock` | Session mgmt, model invocation |
90| LangChain | `js.langchain.com/docs` | Chains, agents, memory, tools |
91| Cloudflare | `developers.cloudflare.com/workers` | Edge functions, KV, D1 |
92
93---
94
95## Codebase Summary
96
97For a comprehensive overview of the codebase architecture, services, APIs, and implementation details, see:
98**`.cursor/skills/pulse/CODEBASE-SUMMARY.md`**
99
100This summary includes:
101- Complete API endpoint documentation
102- Database schema and migrations
103- Service architecture and module breakdown
104- Integration points (TopstepX, AWS Bedrock, Clerk)
105- Known issues and build-time considerations
106- Development patterns and code examples
107
108---
109
110## Current Status
111
112### ✅ Completed
113- Encore.dev backend (Express migration done)
114- AWS Bedrock Session Management
115- Cloudflare architecture
116- Database migrations + tagged template syntax
117- Circuit breaker + error handling
118- CORS + lazy initialization
119- Clerk auth SDK
120- Secrets management
121- LangChain v0.3.x + VectorDB
122- TypeScript frontend + Electron desktop
123- CI/CD (GitHub Actions)
124
125### 🚧 In Progress
126- Autopilot Integration
127- News Feed Launch & Debugging
128- Agentic AI for IV Scoring
129- Day-Bound Conversation Thread History
130- App-Agentic Brain Layer
131