Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
9d47440
chore(platform): #227: add platform AGENTS.md and codebase rules
imdeepmind Nov 21, 2026
cfc5098
refactor(platform): #227: move non-route folders outside app directory
imdeepmind Nov 21, 2026
84de46a
refactor(platform): #227: resolve import violations and remove barrel…
imdeepmind Nov 21, 2026
1b275e7
feat(platform): #227: add storybook support and initial componentsV2 bit
imdeepmind Nov 21, 2026
0a2a64b
feat(platform): #227: add componentsV2 bits and items with storybook …
imdeepmind Nov 21, 2026
ef16f76
feat(platform): #227: add componentsV2 containers with storybook stories
imdeepmind Nov 21, 2026
ada870f
refactor(platform): #227: minimize classNameOverride and enforce layo…
imdeepmind Nov 21, 2026
2ea28b4
refactor(platform): #227: eliminate classNameOverride in landing cont…
imdeepmind Nov 21, 2026
0330324
refactor(platform): #227: split dashboard page containers and elimina…
imdeepmind Nov 21, 2026
caa4329
refactor(platform): #227: migrate app pages to componentsV2
imdeepmind Nov 21, 2026
f896ae7
refactor(platform): #227: refactor navbar and hero styling using desi…
imdeepmind Nov 21, 2026
d619507
refactor(platform): #227: align features and how it works with origin…
imdeepmind Nov 21, 2026
926856e
refactor(platform): #227: align projects preview and why rocket with …
imdeepmind Nov 21, 2026
dee7350
refactor(platform): #227: align open source and footer with original …
imdeepmind Nov 21, 2026
9968c8a
refactor(platform): #227: restore solid auth card styling and shadow
imdeepmind Nov 21, 2026
e70c4bf
refactor(platform): #227: align app navbar and sidebar with props-dri…
imdeepmind Nov 21, 2026
642d042
refactor(platform): #227: align dashboard cards and table with respon…
imdeepmind Nov 21, 2026
64dadf4
refactor(platform): #227: align create project flow and container wit…
imdeepmind Nov 21, 2026
74940a6
refactor(platform): #227: remove legacy components and container, pro…
imdeepmind Nov 21, 2026
f683577
refactor(platform): #227: unify components and container architecture…
imdeepmind Nov 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ web_modules/
.next
out

# Storybook build output
storybook-static

# Nuxt.js build / generate output
.nuxt
dist
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Commands can be run from the repository root via `./dev.sh` (which delegates to
| `./dev.sh db` | Start redis and db Docker containers |
| `./dev.sh csserve` | Serve coverage report via HTTP |

Run `./dev.sh check` after every change before committing.
Commits automatically run pre-commit hooks, so there is no need to manually run tests or `./dev.sh check` before committing.

## Testing

Expand Down
2 changes: 2 additions & 0 deletions rocket/platform/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ drizzle
.env*
public
next-env.d.ts
storybook-static
*.tsbuildinfo

12 changes: 5 additions & 7 deletions rocket/platform/.prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ module.exports = {
'',
'<THIRD_PARTY_MODULES>',
'',
'^@/app/container(/.*)?$',
'^@/components(/.*)?$',
'',
'^@/app/components(/.*)?$',
'^@/icons(/.*)?$',
'',
'^@/app/icons(/.*)?$',
'^@/lib(/.*)?$',
'',
'^@/app/lib(/.*)?$',
'',
'^@/app/interfaces(/.*)?$',
'^@/app/types(/.*)?$',
'^@/interfaces(/.*)?$',
'^@/types(/.*)?$',
'',
'^@/(.*)$',
'',
Expand Down
13 changes: 13 additions & 0 deletions rocket/platform/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type {StorybookConfig} from '@storybook/nextjs';

const config: StorybookConfig = {
stories: ['../components/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [],
framework: {
name: '@storybook/nextjs',
options: {},
},
staticDirs: ['../public'],
};

export default config;
27 changes: 27 additions & 0 deletions rocket/platform/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import type {Preview} from '@storybook/react';

import '../app/globals.css';

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
backgrounds: {
default: 'dark',
values: [
{name: 'dark', value: '#08080d'},
{name: 'surface', value: '#171722'},
{name: 'light', value: '#ffffff'},
],
},
nextjs: {
appDirectory: true,
},
},
};

export default preview;
115 changes: 115 additions & 0 deletions rocket/platform/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# AGENTS.md — Rocket Platform

Next.js frontend application for the Rocket platform (App Router, React 19, TypeScript, Tailwind CSS, Better Auth, Drizzle ORM).

<!-- BEGIN:nextjs-agent-rules -->

## This is NOT the Next.js you know
Expand All @@ -7,3 +11,114 @@ This version has breaking changes — APIs, conventions, and file structure may
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.

<!-- END:nextjs-agent-rules -->

## Commands

Run commands inside `rocket/platform/` (or via npm scripts):

| Command | Action |
| ------------------------- | -------------------------------------------------------------- |
| `npm run dev` | Start Next.js development server |
| `npm run build` | Build production Next.js bundle |
| `npm run start` | Start production server |
| `npm run lint` | Run ESLint |
| `npm run prettier` | Check code formatting |
| `npm run prettier:write` | Format code with Prettier |
| `npm run auth:generate` | Generate Better Auth schema (`lib/db/schema/auth.ts`) |
| `npm run db:generate` | Generate new SQL migrations in `drizzle/` from schemas |
| `npm run db:migrate` | Apply pending migrations from `drizzle/` to PostgreSQL |
| `npm run db:push` | Push schema changes directly to the database (prototyping/dev) |
| `npm run storybook` | Start Storybook development server on port 6006 |
| `npm run build-storybook` | Build static Storybook site |

Always ensure `npm run lint` and `npm run prettier:write` pass cleanly.

## Database & Migrations

- **ORM & Dialect:** Drizzle ORM with PostgreSQL (`pg` pool, `drizzle-orm`, `drizzle-kit`).
- **Configuration:** `drizzle.config.ts` reads `DATABASE_URL` and points to schema `lib/db/schema/index.ts` with output in `drizzle/`.
- **Database Client:** Initialized in `lib/db/index.ts` using connection pool in `lib/db/pool.ts`.
- **Schema Directory:** All schemas live in `lib/db/schema/` and are re-exported by `lib/db/schema/index.ts`.
- **Better Auth Schema:** Managed via Better Auth CLI. Run `npm run auth:generate` whenever `lib/auth/auth.ts` changes.
- **Migration Workflow:**
1. Update or create schemas under `lib/db/schema/` (or update auth config and run `npm run auth:generate`).
2. Generate a new migration with `npm run db:generate`. This creates versioned SQL files under `drizzle/` (e.g. `drizzle/0000_...sql`).
3. Apply migrations to the database with `npm run db:migrate`.
4. Always commit generated migration files in `drizzle/` along with the schema changes.

## Codebase Architecture & Rules

### 1. Component Hierarchy: `bits`, `items`, and `container` (`components/`)

All UI components reside in `components/` and are organized into three distinct tiers:

- **`bits` (`components/bits/`)**: Atomic, low-level primitive building blocks focused on single responsibilities (e.g., `Box`, `Flex`, `Grid`, `Button`, `IconButton`, `TextBox`, `Card`, `Typography`, `Tag`, `IconBadge`, `Avatar`, `ProgressBar`, `Section`, `Select`). Bits encapsulate styling variants and accessibility, and serve as drop-in replacements for raw HTML elements.
- **`items` (`components/items/`)**: Reusable composite UI components constructed by composing multiple `bits` (e.g., `ActionMenu`, `Breadcrumb`, `FileDropzone`, `MetricCard`, `OAuthButtonGroup`, `OptionCardGroup`, `Stepper`, `Table`, `Tabs`, `TerminalViewer`).
- **`container` (`components/container/`)**: Page-targeted and section-level containers assembled by composing `bits` and `items` for dedicated views or feature areas (e.g., `components/container/landing/`, `components/container/auth/`, `components/container/dashboard/`, `components/container/navigation/`, `components/container/create-project/`, `components/container/billing/`, `components/container/settings/`, `components/container/usage/`).

### 2. Avoid Direct HTML Entities & Tags

- Direct HTML tags and entities (`<button>`, `<input>`, `<p>`, `<span>`, `<h1>`–`<h6>`, raw tables, etc.) are highly discouraged and must be avoided almost all the time.
- Always use the dedicated primitive `bits` (e.g., `Text`, `Button`, `TextBox`, etc.) or `items` instead of raw HTML elements.

### 3. Component Styling & `classNameOverride`

- Every component should accept a `classNameOverride` prop (instead of freeform `className` where possible).
- `classNameOverride` is an escape hatch and should only be used when strictly necessary.
- All component styling and variants (size, color variant, layout states) must be encapsulated within the component itself and controlled via component props.

### 4. Design Tokens & CSS Variables (`globals.css`)

- Design tokens for colors, padding, margin, border-radius, standard widths, and spacing must be defined as CSS variables in `app/globals.css`.
- Always use these CSS variables and constants instead of adding arbitrary or hardcoded values across components and CSS modules.

### 5. Direct Component Imports (No Barrel Imports)

- Avoid importing from barrel/index re-exports of parent folders, such as `import { Button } from "@/components/bits"`.
- Always import directly from the specific component module:

```typescript
// Direct import for primitive bits:
import Button from '@/components/bits/Button';
import Button, {ButtonProps} from '@/components/bits/Button';
// Direct import for page containers:
import Hero from '@/components/container/landing/Hero';
// Direct import for page containers:
import Hero from '@/components/container/landing/Hero';
// Direct import for composite items:
import Stepper from '@/components/items/Stepper';
// Direct import for composite items:
import Stepper from '@/components/items/Stepper';
```

### 6. Relative vs. Absolute Imports

- Relative imports are **only allowed within the exact same folder** (e.g., `./styles.module.css` or `./SubComponent.tsx`).
- Parent directory traversal using `../` is **strictly forbidden** (e.g., `../Button/Button.tsx` is not allowed).
- Any import from outside the current directory must use the `@/*` absolute path alias (e.g., `@/components/bits/Button`).

### 7. Icons Location (`icons/`)

- All icon components must reside in the `icons/` directory.

### 8. Module Exports

- Avoid named exports and prefer `default export` for components and modules.
- Named exports should only be used when a single file genuinely needs to export multiple items (such as type definitions accompanying a component or multi-utility modules).

### 9. Folder Organization & Routing (`app/` vs Outside)

- In Next.js App Router, folders within `app/` define routes when they contain `page.tsx` or `route.ts`.
- `app/` should strictly contain pages, layouts, and route handlers.
- Other shared code—such as `components/`, `icons/`, `lib/`, etc.—should be kept outside `app/` to prevent confusion between routing endpoints and internal codebase modules.

## Import Order (enforced by Prettier)

1. Node built-in modules
2. Third-party packages
3. `@/components/*` (all component tiers: `bits`, `items`, and `container`)
4. `@/icons/*`
5. `@/lib/*`
6. `@/interfaces/*` & `@/types/*`
7. `@/*` (other absolute aliases)
8. `./*` (same-directory relative imports only)
2 changes: 1 addition & 1 deletion rocket/platform/app/api/auth/[...all]/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {toNextJsHandler} from 'better-auth/next-js';

import {auth} from '@/app/lib/auth/auth';
import {auth} from '@/lib/auth/auth';

export const {GET, POST} = toNextJsHandler(auth.handler);
5 changes: 3 additions & 2 deletions rocket/platform/app/auth/forgot-password/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type {Metadata} from 'next';
import React from 'react';

import ForgotPassword from '@/app/container/auth/ForgotPassword';
import ForgotPasswordCard from '@/components/container/auth/ForgotPasswordCard';

export const metadata: Metadata = {
title: 'Reset Password · Rocket',
description: 'Reset your password to regain access to your Rocket account.',
};

export default function ForgotPasswordPage(): React.JSX.Element {
return <ForgotPassword />;
return <ForgotPasswordCard />;
}
7 changes: 4 additions & 3 deletions rocket/platform/app/auth/reset-password/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type {Metadata} from 'next';
import React, {Suspense} from 'react';

import ResetPassword from '@/app/container/auth/ResetPassword';
import Box from '@/components/bits/Box';
import ResetPasswordCard from '@/components/container/auth/ResetPasswordCard';

export const metadata: Metadata = {
title: 'Reset Password · Rocket',
Expand All @@ -10,8 +11,8 @@ export const metadata: Metadata = {

export default function ResetPasswordPage(): React.JSX.Element {
return (
<Suspense fallback={<div className="min-h-screen bg-[#08080D]" />}>
<ResetPassword />
<Suspense fallback={<Box classNameOverride="min-h-screen bg-[#08080D]" />}>
<ResetPasswordCard />
</Suspense>
);
}
5 changes: 3 additions & 2 deletions rocket/platform/app/auth/sign-in/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type {Metadata} from 'next';
import React from 'react';

import SignIn from '@/app/container/auth/SignIn';
import SignInCard from '@/components/container/auth/SignInCard';

export const metadata: Metadata = {
title: 'Sign In · Rocket',
description: 'Sign in to deploy and manage your backends on Rocket.',
};

export default function SignInPage(): React.JSX.Element {
return <SignIn />;
return <SignInCard />;
}
5 changes: 3 additions & 2 deletions rocket/platform/app/auth/sign-up/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {Metadata} from 'next';
import React from 'react';

import SignUp from '@/app/container/auth/SignUp';
import SignUpCard from '@/components/container/auth/SignUpCard';

export const metadata: Metadata = {
title: 'Create Account · Rocket',
Expand All @@ -9,5 +10,5 @@ export const metadata: Metadata = {
};

export default function SignUpPage(): React.JSX.Element {
return <SignUp />;
return <SignUpCard />;
}
7 changes: 4 additions & 3 deletions rocket/platform/app/auth/verify-email/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type {Metadata} from 'next';
import React, {Suspense} from 'react';

import VerifyEmail from '@/app/container/auth/VerifyEmail';
import Box from '@/components/bits/Box';
import VerifyEmailCard from '@/components/container/auth/VerifyEmailCard';

export const metadata: Metadata = {
title: 'Verify Email · Rocket',
Expand All @@ -10,8 +11,8 @@ export const metadata: Metadata = {

export default function VerifyEmailPage(): React.JSX.Element {
return (
<Suspense fallback={<div className="min-h-screen bg-[#08080D]" />}>
<VerifyEmail />
<Suspense fallback={<Box classNameOverride="min-h-screen bg-[#08080D]" />}>
<VerifyEmailCard />
</Suspense>
);
}
40 changes: 0 additions & 40 deletions rocket/platform/app/components/bits/Badge/index.tsx

This file was deleted.

Loading
Loading