Skip to content
Open
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
10 changes: 7 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Database Configuration
DATABASE_URL="postgres://daf11775fd2aee0319c70ffa56fd5141c6fad08e4a97dc21f2ca85dc024af6fc:sk_AvI2at9j-HqDOZalaMzq3@db.prisma.io:5432/postgres?sslmode=require&pool=true"
POSTGRES_URL="postgres://username:password@host:5432/database?sslmode=require"
PRISMA_DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=YOUR_PRISMA_ACCELERATE_API_KEY"
# Prisma ORM: Use this connection string as your DATABASE_URL when you initialize your Prisma Client. The API key is already embedded in the connection string.
# prisma+postgres://accelerate.prisma-data.net/?api_key=your_prisma_accelerate_api_key_here
# Any Client: Use this connection string to connect to your database with any Postgres-compatible tool or library:
# postgres://user:password@db.example.com:5432/postgres?sslmode=verify-full
DATABASE_URL="postgres://user:password@db.example.com:5432/postgres?sslmode=verify-full"
POSTGRES_URL="postgres://user:password@db.example.com:5432/postgres?sslmode=verify-full"
PRISMA_DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=your_prisma_accelerate_api_key_here"

# NextAuth Configuration
NEXTAUTH_SECRET="generate-with-openssl-rand-base64-32"
Expand Down
42 changes: 42 additions & 0 deletions .github/prompts/plan-prismaV7Upgrade.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
**Incomplete / Missing Prisma v7 Upgrade Items (Repo-Specific)**
- Generator not migrated: prisma/schema.prisma still uses `provider = "prisma-client-js"`; Prisma v7 deprecates this and expects `provider = "prisma-client"` with a required `output` path (import paths will change).
- Dev workflow drift: Prisma v7 no longer auto-runs `prisma generate` or seeding on `migrate dev/reset`, but package.json scripts (`prisma:migrate:dev`, `prisma:reset`) don’t compensate—easy to end up with stale client + unseeded DB.
- Config duplication risk: schema/seed configuration exists in 3 places (prisma.config.ts, package.json `"prisma"` block, and many scripts passing `--schema=...`). This can drift over time.
- SSL warning root cause: docs/examples (and likely your real `DATABASE_URL`) use `?sslmode=require` (seen in .env.example, .env.production.example, and multiple docs). With your chosen posture (“strict verification”), you should pin `sslmode=verify-full` explicitly to preserve behavior and silence the warning.
- Security hygiene gap (best practice): repo contains committed env files with real-looking DB/API tokens (.env, .env.example). Even if “demo”, treat as potentially sensitive and rotate/remove from git.

## Plan: Prisma v7 Upgrade Completion + SSLmode Warning

TL;DR: Stabilize day-to-day dev/prod workflows first (explicit generate + seed + SSL verify-full), then later do the larger generator migration (`prisma-client-js` → `prisma-client`) since you selected “Later”. Also reduce config duplication so Prisma v7 behavior is predictable across scripts and CI.

**Steps**
1. Fix SSL warning + align with strict verification
- Update your actual `DATABASE_URL` (where build reads it, typically `.env.local` or your CI env) from `sslmode=require` to `sslmode=verify-full`.
- Update examples/docs that currently say `sslmode=require` (at minimum: .env.example, .env.production.example, and scripts that print guidance like scripts/seed-production.js).
- If `verify-full` fails (cert/hostname/CA issues), decide whether to add CA via connection-string `sslrootcert` (or equivalent) vs relaxing verification (not recommended given your chosen posture).

2. Make Prisma v7 dev scripts explicit (generate + seed)
- Adjust package.json scripts so `prisma:migrate:dev` explicitly runs `prisma generate` after migrations.
- Add a dedicated script that restores the old “auto-seed” ergonomics, e.g. a `prisma:migrate:dev:seed` / `db:reset:seed` flow that runs `prisma db seed` (or your existing `npm run prisma:seed`) after `migrate dev/reset`.

3. Reduce Prisma config drift (pick one source of truth)
- Prefer Prisma v7 config file as the canonical schema location (prisma.config.ts).
- Then either (a) remove the `"prisma": { schema, seed }` block from package.json, or (b) keep it but stop duplicating `--schema=...` everywhere—choose one consistent pattern.

4. Generator migration (deferred, but planned)
- Update prisma/schema.prisma generator to `provider = "prisma-client"` and add required `output`.
- Update imports across runtime + scripts (e.g., src/lib/prisma.ts, prisma/seed.mjs) to import Prisma Client/types from the new generated output path.
- Verify build tooling + deployment packaging includes the generated client output directory.

5. Security cleanup (recommended follow-up)
- Remove committed secrets from .env and sanitize .env.example to placeholders; rotate any credentials that were real.

**Verification**
- Run `npm run build` and confirm the SSL warning is gone.
- Run `npm run prisma:migrate:dev` and confirm Prisma Client is regenerated afterward.
- Run your new explicit seed flow and confirm the app boots with expected demo data.
- For prod-like verification: run `npm run prisma:migrate:deploy` + seed as needed in a staging DB.

**Decisions**
- Decision: Generator migration deferred (per your selection), but plan includes a clean, bounded follow-up phase.
- Decision: SSL strict verification applies to prod/staging; local dev can remain non-strict if needed.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"prisma.schemaPath": "prisma/schema.prisma",
"files.autoSave": "afterDelay",
"prisma.pinToPrisma6": true,
"prisma.pinToPrisma6": false,
"github-actions.workflows.pinned.workflows": [
".github/workflows/weekly-research.lock.yml"
],
Expand Down
2 changes: 1 addition & 1 deletion IDEMPOTENCY_KEY_IMPLEMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ When database is accessible, run:

```powershell
# Set DATABASE_URL explicitly
$env:DATABASE_URL="postgres://1d421585019e812f1977d6aa0cef7dd51610436076598e55926cbd3072d017c1:sk_OfVGN0_tWDbVdYf_P28Ow@db.prisma.io:5432/postgres?sslmode=require"
$env:DATABASE_URL="postgres://your_user:your_password@db.prisma.io:5432/postgres?sslmode=verify-full"

# Run migration
npx prisma migrate dev --name add_idempotency_key --schema=prisma/schema.prisma
Expand Down
2 changes: 1 addition & 1 deletion POSTGRESQL_MIGRATION_COMPLETE.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ new PrismaClient({ adapter, log: [...] })

#### `.env.local` (Development)
```bash
DATABASE_URL="postgres://...@db.prisma.io:5432/postgres?sslmode=require"
DATABASE_URL="postgres://...@db.prisma.io:5432/postgres?sslmode=verify-full"
NEXTAUTH_SECRET="7d08e0c5225aaa9fced497c0d4d6265ea365b918c2a911bd206ecd1028cb1f69"
NEXTAUTH_URL="http://localhost:3000"
EMAIL_FROM="noreply@example.com"
Expand Down
2 changes: 1 addition & 1 deletion QUICK_FIX_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ vercel logs --limit=50 --function=api/your-route
**Solution:** Check DATABASE_URL
```bash
# Verify connection string format
postgresql://user:password@host:5432/database?sslmode=require
postgresql://user:password@host:5432/database?sslmode=verify-full
```

---
Expand Down
2 changes: 1 addition & 1 deletion docs/SSLCOMMERZ_QUICK_START.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cd f:\codestorm\stormcomui

# Set environment variable
$env:DATABASE_URL = "postgres://62f4097df5e872956ef3438a631f543fae4d5d42215bd0826950ab47ae13d1d8:sk_C9LGde4N8GzIwZvatfrYp@db.prisma.io:5432/postgres?sslmode=require"
$env:DATABASE_URL = "postgres://your_user:your_password@db.prisma.io:5432/postgres?sslmode=verify-full"

# Generate Prisma Client
npm run prisma:generate
Expand Down
2 changes: 1 addition & 1 deletion docs/UNIFIED_SCHEMA_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ DATABASE_URL="file:./dev.db"
### Production (.env.production)

```bash
DATABASE_URL="postgresql://user:password@host:5432/dbname?schema=public&sslmode=require"
DATABASE_URL="postgresql://user:password@host:5432/dbname?schema=public&sslmode=verify-full"
```

### Vercel/Cloud Deployment
Expand Down
4 changes: 2 additions & 2 deletions docs/complete-implementations/DEPLOYMENT_CHECKLIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Set these in **Settings → Environment Variables** for all environments:

- [ ] `DATABASE_URL` - PostgreSQL connection string
```
Format: postgresql://user:password@host:5432/database?sslmode=require
Format: postgresql://user:password@host:5432/database?sslmode=verify-full
```
- [ ] `NEXTAUTH_SECRET` - Generated with `openssl rand -base64 32`
- [ ] `NEXTAUTH_URL` - Production URL (e.g., `https://stormcom.vercel.app`)
Expand Down Expand Up @@ -99,7 +99,7 @@ Set these in **Settings → Environment Variables** for all environments:
**Solution:**
1. Verify database is running and accessible
2. Check connection string format
3. Ensure SSL is enabled (`?sslmode=require`)
3. Ensure SSL is enabled (`?sslmode=verify-full`)
4. Test connection locally:
```bash
psql "your-database-url"
Expand Down
2 changes: 1 addition & 1 deletion docs/complete-implementations/POSTGRESQL_MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If you're deploying for the first time or don't need to preserve existing data:

1. **Set up PostgreSQL connection**:
```bash
export DATABASE_URL="postgresql://user:pass@host:5432/database?sslmode=require"
export DATABASE_URL="postgresql://user:pass@host:5432/database?sslmode=verify-full"
```

2. **Run migrations**:
Expand Down
2 changes: 1 addition & 1 deletion docs/complete-implementations/PRODUCTION_FIX_SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Updated all deployment documentation:
Go to your Vercel project → Settings → Environment Variables and ensure these are set:

```env
DATABASE_URL=postgresql://user:password@host:5432/database?sslmode=require
DATABASE_URL=postgresql://user:password@host:5432/database?sslmode=verify-full
NEXTAUTH_SECRET=your-secure-secret-min-32-chars
NEXTAUTH_URL=https://stormcomui.vercel.app
EMAIL_FROM=noreply@example.com
Expand Down
4 changes: 2 additions & 2 deletions docs/complete-implementations/PRODUCTION_SEEDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ npm run prisma:seed:production

```bash
# Set DATABASE_URL environment variable
export DATABASE_URL="******host:5432/database?sslmode=require"
export DATABASE_URL="postgresql://user:password@host:5432/database?sslmode=verify-full"

# Run the production seed script
npm run prisma:seed:production
Expand Down Expand Up @@ -218,7 +218,7 @@ export DATABASE_URL="******host:5432/database"
**Solution**: Ensure you're using a PostgreSQL connection string:
```bash
# Correct format
export DATABASE_URL="******host:5432/dbname?sslmode=require"
export DATABASE_URL="postgresql://user:password@host:5432/dbname?sslmode=verify-full"
```

### Error: "relation does not exist"
Expand Down
2 changes: 1 addition & 1 deletion docs/complete-implementations/VALIDATION_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ Role, ProductStatus, OrderStatus, PaymentStatus, PaymentMethod, PaymentGateway,

**Test Configuration**:
```bash
DATABASE_URL="postgresql://vercel_user:***@db.vercel.com:5432/stormcom_prod?sslmode=require"
DATABASE_URL="postgresql://vercel_user:***@db.vercel.com:5432/stormcom_prod?sslmode=verify-full"
NEXTAUTH_SECRET="production-secret-32-chars"
NEXTAUTH_URL="https://stormcom.vercel.app"
```
Expand Down
2 changes: 1 addition & 1 deletion docs/complete-implementations/VERCEL_DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This guide walks you through deploying StormCom to Vercel with PostgreSQL databa
#### Option B: Using External PostgreSQL Provider

1. Create a PostgreSQL database with your chosen provider
2. Get the connection string (format: `postgresql://username:password@host:5432/database?sslmode=require`)
2. Get the connection string (format: `postgresql://username:password@host:5432/database?sslmode=verify-full`)

### 2. Configure Environment Variables in Vercel

Expand Down
4 changes: 2 additions & 2 deletions docs/database/outdated/migrations-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ When you update the PostgreSQL schema (`prisma/schema.postgres.prisma`):

Example:
```
DATABASE_URL="postgresql://user:password@host.region.postgres.vercel-storage.com:5432/database?sslmode=require"
DATABASE_URL="postgresql://user:password@host.region.postgres.vercel-storage.com:5432/database?sslmode=verify-full"
```

## Troubleshooting
Expand All @@ -84,7 +84,7 @@ The `init.sql` script uses `CREATE TABLE IF NOT EXISTS`, so it's safe to run mul

- Verify `DATABASE_URL` is set correctly in Vercel environment variables
- Check that the PostgreSQL database exists
- Ensure SSL mode is configured correctly (usually `?sslmode=require` for Vercel)
- Ensure SSL mode is configured correctly (use `?sslmode=verify-full` for strict verification)

### Permission errors

Expand Down
31 changes: 27 additions & 4 deletions lint-errors.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
{
"summary": {
"totalErrors": 0,
"exitCode": 0,
"timestamp": "2026-02-16T20:04:49Z",
"exitCode": 1,
"timestamp": "2026-02-23T05:52:50Z",
"command": "npm run lint",
"totalWarnings": 0,
"totalLines": 35
"totalLines": 58
Comment on lines 3 to +8
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

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

This lint snapshot reports exitCode: 1 (and an eslint error in rawOutput), which suggests the PR is not lint-clean. The rawOutput also references issues (e.g. unused req, unused session/router) that no longer match the current diffs. Please re-run the lint collection step (or regenerate this file) after final code changes so it reflects the current state.

Copilot uses AI. Check for mistakes.
},
"rawOutput": [
"",
"\u003e stormcom@0.1.0 lint",
"\u003e eslint",
"",
"",
"F:\\codestorm\\codestorm\\stormcom-ui\\stormcom\\src\\app\\api\\integrations\\sslcommerz\\route.ts",
" 16:27 warning \u0027req\u0027 is defined but never used. Allowed unused args must match /^_/u @typescript-eslint/no-unused-vars",
" 207:30 warning \u0027req\u0027 is defined but never used. Allowed unused args must match /^_/u @typescript-eslint/no-unused-vars",
"",
"F:\\codestorm\\codestorm\\stormcom-ui\\stormcom\\src\\app\\payment\\success\\page.tsx",
" 13:17 warning \u0027session\u0027 is assigned a value but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars",
"",
"F:\\codestorm\\codestorm\\stormcom-ui\\stormcom\\src\\components\\product-form.tsx",
" 591:39 warning Compilation Skipped: Use of incompatible library",
"",
Expand All @@ -27,6 +34,16 @@
" 593 | \u003cFormControl\u003e",
" 594 | \u003cdiv className=\"relative\"\u003e react-hooks/incompatible-library",
"",
"F:\\codestorm\\codestorm\\stormcom-ui\\stormcom\\src\\components\\subscription\\grace-period-guard.tsx",
" 27:17 warning \u0027session\u0027 is assigned a value but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars",
" 52:6 warning React Hook useEffect has a missing dependency: \u0027storeId\u0027. Either include it or remove the dependency array react-hooks/exhaustive-deps",
"",
"F:\\codestorm\\codestorm\\stormcom-ui\\stormcom\\src\\components\\subscription\\trial-expiration-guard.tsx",
" 47:17 warning \u0027session\u0027 is assigned a value but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars",
" 48:9 warning \u0027router\u0027 is assigned a value but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars",
" 60:6 warning React Hook useEffect has a missing dependency: \u0027checkTrialStatus\u0027. Either include it or remove the dependency array react-hooks/exhaustive-deps",
" 172:16 warning \u0027e\u0027 is defined but never used. Allowed unused caught errors must match /^_/u @typescript-eslint/no-unused-vars",
"",
"F:\\codestorm\\codestorm\\stormcom-ui\\stormcom\\src\\components\\ui\\enhanced-data-table.tsx",
" 149:23 warning Compilation Skipped: Use of incompatible library",
"",
Expand All @@ -41,7 +58,13 @@
" 151 | getScrollElement: () =\u003e parentRef.current,",
" 152 | estimateSize: () =\u003e estimatedRowHeight, react-hooks/incompatible-library",
"",
"Ô£û 2 problems (0 errors, 2 warnings)",
"F:\\codestorm\\codestorm\\stormcom-ui\\stormcom\\src\\lib\\services\\order-processing.service.ts",
" 462:13 error Use \"@ts-expect-error\" instead of \"@ts-ignore\", as \"@ts-ignore\" will do nothing if the following line is error-free @typescript-eslint/ban-ts-comment",
"",
"F:\\codestorm\\codestorm\\stormcom-ui\\stormcom\\src\\lib\\subscription\\billing-service.ts",
" 202:27 warning \u0027billingPeriodEnd\u0027 is assigned a value but never used. Allowed unused vars must match /^_/u @typescript-eslint/no-unused-vars",
"",
"Ô£û 13 problems (1 error, 12 warnings)",
""
],
"errors": [
Expand Down
Loading
Loading