Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# AGENTS.md

## Cursor Cloud specific instructions

### Overview

StormCom is a multi-tenant SaaS e-commerce platform built with Next.js 16 (App Router), React 19, TypeScript, Prisma (PostgreSQL), and Tailwind CSS v4 + shadcn/ui.

### Required services

| Service | How to start | Port |
|---------|-------------|------|
| PostgreSQL 16 | `sudo docker compose up -d postgres` | 5432 |
| Next.js dev server | `npm run dev` | 3000 |

### Environment files

- `.env.local` (and `.env` as a copy for Prisma CLI) must have at minimum: `DATABASE_URL`, `NEXTAUTH_URL`, `NEXTAUTH_SECRET`, `RESEND_API_KEY` (can be dummy value `re_dummy_key_for_build` for dev).
- Prisma CLI reads `.env` by default (not `.env.local`), so keep both files in sync or use `dotenv-cli`.

### Database setup

After PostgreSQL is running:

```bash
npx prisma migrate deploy # apply all migrations
npm run prisma:seed # seed demo data (131 entities)
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The database setup snippet uses npx prisma migrate deploy and then seeds, but it doesn’t mention generating the Prisma Client afterward. In a fresh environment (or if postinstall skipped because DATABASE_URL wasn’t set at install time), this can leave @prisma/client missing/out of date and cause runtime errors. Consider updating these steps to run npm run prisma:generate after migrations, or use an existing npm script that already combines migrate + generate (e.g. npm run prisma:migrate:dev:seed / npm run prisma:migrate:dev).

Suggested change
npm run prisma:seed # seed demo data (131 entities)
npm run prisma:generate # generate Prisma Client
npm run prisma:seed # seed demo data (131 entities)

Copilot uses AI. Check for mistakes.
```

### Key commands

| Task | Command |
|------|---------|
| Lint | `npm run lint` |
| Type check | `npm run type-check` |
| Unit tests | `npm run test:run` |
| E2E tests | `npm run test:e2e` |
| Dev server | `npm run dev` |
| Prisma Studio | `npm run prisma:studio` |
| Prisma generate | `npm run prisma:generate` |

### Test credentials (after seeding)

- Super Admin: `admin@stormcom.io` / `Admin@123456`
- Store Owner (TechBazar): `rafiq@techbazar.io` / `Owner@123456`
- Store Owner (GadgetZone): `farida@gadgetzone.io` / `Owner@123456`

### Gotchas

- The Vitest run reports `playwright.config.test.ts` as a failed suite because it contains no Vitest tests — this is a known false positive and safe to ignore.
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc suggests ignoring a Vitest “failed suite” caused by playwright.config.test.ts, but the repo’s vitest.config.ts currently includes **/*.{test,spec}.{ts,tsx} and does not exclude that file, so this will keep recurring and can break CI depending on Vitest settings. Instead of documenting it as safe to ignore, consider addressing it by excluding playwright.config.test.ts in Vitest config or renaming the Playwright config file so it doesn’t match the Vitest include glob.

Suggested change
- The Vitest run reports `playwright.config.test.ts` as a failed suite because it contains no Vitest tests — this is a known false positive and safe to ignore.
- If Vitest reports `playwright.config.test.ts` as a failed suite, update `vitest.config.ts` to exclude this file (for example via `test.exclude`) or rename/move the Playwright config so it no longer matches the `**/*.{test,spec}.{ts,tsx}` pattern, rather than ignoring the failure.

Copilot uses AI. Check for mistakes.
- Docker must be started before PostgreSQL can run (`sudo dockerd &` if not already running, then `sudo docker compose up -d postgres`).
- The `postinstall` script in `package.json` auto-generates the Prisma client on `npm install` if `DATABASE_URL` is set.
- Optional services (Redis, Stripe, Elasticsearch, Ollama, Resend) degrade gracefully and are not needed for core development.
Loading
Loading