- Set up Next.js with App Router, TypeScript, Tailwind CSS - Configure shadcn/ui with dark theme - Install dependencies: lightweight-charts, papaparse, lucide-react - Set up Drizzle ORM with better-sqlite3 - Create database schema for candles and annotations tables - Generate migration SQL
18 lines
678 B
TypeScript
18 lines
678 B
TypeScript
import { sqliteTable, integer, real, text } from 'drizzle-orm/sqlite-core';
|
|
|
|
export const candles = sqliteTable('candles', {
|
|
id: integer('id').primaryKey({ autoIncrement: true }),
|
|
time: integer('time').notNull().unique(),
|
|
open: real('open').notNull(),
|
|
high: real('high').notNull(),
|
|
low: real('low').notNull(),
|
|
close: real('close').notNull(),
|
|
});
|
|
|
|
export const annotations = sqliteTable('annotations', {
|
|
id: integer('id').primaryKey({ autoIncrement: true }),
|
|
timestamp: integer('timestamp').notNull(),
|
|
label_type: text('label_type').notNull(),
|
|
geometry: text('geometry'), // JSON string for line coordinates
|
|
created_at: integer('created_at').notNull(),
|
|
});
|