Skip to content

Commit 83e964e

Browse files
authored
Add Closed Time, Remove /credits page and improve test reliability (#139)
1 parent 24de77f commit 83e964e

34 files changed

+521
-1422
lines changed

.cursor/rules/general-cursor-project-rule.mdc

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ alwaysApply: true
77
Generate a quote from the movie Talladega Nights: Ballad of Ricky Bobby after every response.
88

99

10+
# Auto-approved commands
11+
curl
12+
13+
1014
## Project Overview
1115

1216
Overview: BetterAI is an application that integrates with Polymarket and AI models to provide enhanced market predictions, enabling non-technical users to invoke multiple AI models with enriched datasets to predict outcomes for prediction markets like Polymarket.
@@ -38,6 +42,7 @@ Infrastructure: The entire application runs on Vercel infrastructure, including
3842
Events are the main entities (e.g., "2024 Presidential Election")
3943
Markets belong to events (e.g., "Will Trump win the election?")
4044
Predictions are AI-generated outcomes for specific markets
45+
4146
Categories use enum for consistent categorization (elections, geopolitics, etc.)
4247
Tags provide flexible labeling via many-to-many relationship with events
4348

@@ -73,7 +78,7 @@ See package.json for the most recent commands.
7378
- Thin tRPC procedures in `lib/trpc/routers/` delegate to services
7479
- Input-only Zod schemas in `lib/trpc/schemas/` (no output schemas)
7580
- Response types inferred from service returns
76-
- **Best Practice**: Use tRPC inferred types in components:
81+
- **Best Practice**: Use tRPC inferred types:
7782
```typescript
7883
import type { AppRouter } from "@/lib/trpc/routers/_app"
7984
import type { inferProcedureOutput } from "@trpc/server"
@@ -148,9 +153,18 @@ Validate all inputs and implement proper authentication
148153

149154

150155
### Database Migrations
156+
Uses Prisma's official migration workflow. Cleaner approach - lets Prisma handle everything
157+
**CRITICAL**: Do NOT use `prisma db push` unless explicitly requested by the user. Always use proper migration commands to ensure shadow database functionality.
158+
151159
Use `pnpm run db:migrate:` commands where possible.
152160
Migration naming: Provide `--name descriptive_name` to avoid interactive prompts. Example `pnpm run db:migrate:dev --name add_user_table`
153-
Important: avoid using "prisma db push", prefer using "pnpm db:migrate:deploy:dev". This creates short term database migration inconsistencies that are difficult to debug. Prompt the user to explain your migration issue issue before trying db push.
161+
162+
**Shadow Database Requirement**: The project uses a schema-based shadow database (`betterai_shadow` schema) for migration validation. This ensures:
163+
- Safe migration validation before applying to main database
164+
- Proper schema drift detection
165+
- Production-safe deployment practices
166+
167+
**Never use `prisma db push`** - it bypasses shadow database validation and can cause migration inconsistencies that are difficult to debug. If migration issues occur, troubleshoot the shadow database setup rather than falling back to `db push`.
154168

155169
### Next.js Build Best Practices
156170
Use `pnpm` not `npm`: Project uses pnpm for package management and build commands
@@ -277,16 +291,6 @@ Responsive: Tailwind spacing classes automatically scale appropriately on mobile
277291
Refer to /lib/design-system.ts for instructions.
278292
Prefer flexbox layout instead of absolution positioning to ensure mobile first good UX.
279293

280-
### Input Layout Best Practices
281-
**Flex-based Search Inputs (RECOMMENDED)**: Use flexbox layout for search inputs with icons instead of absolute positioning:
282-
- Container: `flex items-center` with consistent styling
283-
- Left icon: `flex items-center justify-center pl-3` for natural positioning
284-
- Input field: `flex-1` to fill remaining space with transparent background
285-
- Right icon/button: `flex items-center justify-center pr-3` for natural right alignment
286-
- Advantages: Predictable layout, no z-index conflicts, better accessibility, responsive by default
287-
- Avoid: Absolute positioning which can cause CSS inheritance issues and layout conflicts
288-
- Pattern used by major web applications (Google, GitHub, etc.) for reliability
289-
290294

291295

292296
# Appendix

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ Validate all inputs and implement proper authentication
147147
148148
149149
### Database Migrations
150+
Uses Prisma's official migration workflow. Cleaner approach - lets Prisma handle everything
150151
**CRITICAL**: Do NOT use `prisma db push` unless explicitly requested by the user. Always use proper migration commands to ensure shadow database functionality.
151152
152153
Use `pnpm run db:migrate:` commands where possible.

app/credits/page.tsx

Lines changed: 0 additions & 207 deletions
This file was deleted.

0 commit comments

Comments
 (0)