# Project Context: Twitter Bulk Scheduler (Serverless)
## Core Stack
- **Runtime:** Cloudflare Workers (Platform: Bun/Node compat)
- **Language:** TypeScript
- **Framework:** Hono (Lightweight web framework)
- **Database:** Neon (Serverless Postgres)
- **ORM:** Drizzle ORM
- **Scheduler:** Upstash QStash
## Critical Architecture Rules
1. **Database Driver:** You MUST use `@neondatabase/serverless` for all database connections.
- NEVER use the standard `postgres` or `pg` driver.
- NEVER use `drizzle-orm/postgres-js`.
- ALWAYS use `drizzle-orm/neon-http` for queries.
- REASON: We need HTTP connection pooling to handle QStash concurrency spikes.
2. **Transactions:**
- Avoid `db.transaction()` interactive blocks.
- Use `db.batch()` if multiple write operations are needed in one go.
- If interactive transactions are absolutely necessary, switch to `drizzle-orm/neon-serverless` (WebSocket), but prefer HTTP.
3. **Deployment:**
- Target: Cloudflare Workers.
- Region: `ap-south-1` (Mumbai) via Smart Placement.
- Config File: `wrangler.toml`.
4. **No Node.js Native APIs:**
- Do not use `fs` (File System) or native `child_process`.
- Use `fetch` for all network requests.
## Coding Style
- Use `const` over `let`.
- Use `async/await` for all DB/Network calls.
- Schema definitions in `src/db/schema.ts`.
- Environment variables accessed via `env` (Hono Context), not `process.env`.
- **File Naming:**
- ALWAYS use **kebab-case** for file names (e.g., `tweet-editor.tsx`, `user-profile.ts`).
- Component names inside the file should remain **PascalCase** (e.g., `export function TweetEditor()`).
## Package Management
- **Primary Tool:** Always use `bun` for package management and script execution.
- **Prohibited:** Do NOT use `npm`, `yarn`, or `pnpm`.
## UI Guidelines
- **Components:** Always use shadcn/ui components from `@repo/ui` (located in `packages/ui`).
- **Styling:** Use the color variables and utility classes defined in `packages/ui`.
- **Consistency:** Maintain visual consistency with the existing design system.
## Common Commands
- Run Dev: `bun run dev` (or `wrangler dev`)
- Generate Migrations: `bun run drizzle-kit generate`
- Deploy: `bun run deploy`Workflows from the Neura Market marketplace related to this Cursor resource