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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 5 additions & 3 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

The repository is a monorepo for the VitNode framework, which includes a backend API, frontend documentation site, and shared packages. The codebase uses modern web technologies and follows specific conventions for development based on Next.js 15 and Hono.js 4.

- Do not nest ternary operators,

## Architecture & Key Patterns

- **Monorepo Structure:**
- `apps/` contains main apps (`api` for backend, `docs` for docs site)
- `packages/` holds shared code, core framework, ESLint/Prettier configs, and CLI tools
- `packages/` holds shared code, core framework, Biome configs, and CLI tools
- `plugins/` for extendable features
- **Frontend:**
- Next.js 15, App Router, Server Components
Expand All @@ -33,9 +35,9 @@ The repository is a monorepo for the VitNode framework, which includes a backend
- `pnpm dev` (dev server), `pnpm build`, `pnpm lint`, `pnpm db:push`, `pnpm db:migrate`, `pnpm docker:dev`
- **CLI:**
- Create apps/plugins via `pnpm create vitnode-app@canary` (see `packages/create-vitnode-app`)
- CLI prompts for package manager, app mode, ESLint, Docker, install (see `questions.ts`)
- CLI prompts for package manager, app mode, Biome, Docker, install (see `questions.ts`)
- **Linting/Formatting:**
- Use configs from `packages/eslint/`
- Use configs from `packages/config/`
- File names: snake_case, ESModule only
- TypeScript 5 strict mode
- **Testing:**
Expand Down
4 changes: 2 additions & 2 deletions .github/docs/prd.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ VitNode is designed for individual developers and small teams who need a structu
### CI/CD

- Automated workflows using GitHub Actions:
- Code quality checks (ESLint, Prettier, TypeScript)
- Code quality checks (Biome, TypeScript)
- Test suite execution with Vitest and Playwright
- Dependency security scanning with npm audit
- Automated builds and deployments to Vercel
Expand Down Expand Up @@ -165,7 +165,7 @@ VitNode is designed for individual developers and small teams who need a structu
- Turborepo for monorepo management
- Vitest for unit testing
- Playwright for end-to-end testing
- ESLint and Prettier for code quality
- Biome for code quality
- Docker for containerization

## Features Planned for Future Releases
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/bump_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ on:
- stable
- release-candidate
type:
description: 'Type of package to publish'
description: "Type of package to publish"
required: true
type: choice
options:
- patch
- minor
- major
mode:
description: 'Mode of package to publish'
description: "Mode of package to publish"
required: true
type: choice
options:
- bump_and_publish
- bump
- publish
skip_release_github_patch_notes:
description: 'Skip generating release notes for GitHub patch notes?'
description: "Skip generating release notes for GitHub patch notes?"
required: false
type: boolean

jobs:
bump-version:
name: 'Bump Version'
name: "Bump Version"
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -57,7 +57,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org/'
registry-url: "https://registry.npmjs.org/"
node-version: 22

- name: Install dependencies
Expand All @@ -82,21 +82,21 @@ jobs:

- name: Publish canary
if: ${{ (github.event.inputs.mode == 'bump_and_publish' || github.event.inputs.mode == 'publish') && github.event.inputs.release == 'canary' }}
run: pnpm publish --filter create-vitnode-app --filter @vitnode/core --filter @vitnode/eslint-config --filter @vitnode/blog --tag canary --no-git-checks --access public
run: pnpm publish --filter create-vitnode-app --filter @vitnode/core --filter @vitnode/config --filter @vitnode/blog --tag canary --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- name: Publish release candidate
if: ${{ (github.event.inputs.mode == 'bump_and_publish' || github.event.inputs.mode == 'publish') && github.event.inputs.release == 'release-candidate' }}
run: pnpm publish --filter create-vitnode-app --filter @vitnode/core --filter @vitnode/eslint-config --filter @vitnode/blog --tag rc --no-git-checks --access public
run: pnpm publish --filter create-vitnode-app --filter @vitnode/core --filter @vitnode/config --filter @vitnode/blog --tag rc --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- name: Publish stable
if: ${{ (github.event.inputs.mode == 'bump_and_publish' || github.event.inputs.mode == 'publish') && github.event.inputs.release == 'stable' }}
run: pnpm publish --filter create-vitnode-app --filter @vitnode/core --filter @vitnode/eslint-config --filter @vitnode/blog --tag latest --no-git-checks --access public
run: pnpm publish --filter create-vitnode-app --filter @vitnode/core --filter @vitnode/config --filter @vitnode/blog --tag latest --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
Expand Down
11 changes: 0 additions & 11 deletions .prettierrc.mjs

This file was deleted.

24 changes: 24 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,29 @@
],
"search.exclude": {
"**/(plugins)/*": true
},
"[javascriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[css]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[html]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
8 changes: 4 additions & 4 deletions apps/api/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defineVitNodeDrizzleConfig } from '@vitnode/core/drizzle.config';
import { defineVitNodeDrizzleConfig } from "@vitnode/core/drizzle.config";

import { POSTGRES_URL, vitNodeApiConfig } from './src/vitnode.api.config';
import { POSTGRES_URL, vitNodeApiConfig } from "./src/vitnode.api.config";

export default defineVitNodeDrizzleConfig({
vitNodeApiConfig,
out: './migrations/',
dialect: 'postgresql',
out: "./migrations/",
dialect: "postgresql",
dbCredentials: {
url: POSTGRES_URL,
},
Expand Down
20 changes: 0 additions & 20 deletions apps/api/eslint.config.mjs

This file was deleted.

5 changes: 1 addition & 4 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"dev:email": "email dev --dir src/emails",
"build": "tsc && tsc-alias -p tsconfig.json",
"start": "node dist/index.js",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"drizzle-kit": "drizzle-kit"
},
"dependencies": {
Expand All @@ -34,9 +32,8 @@
"@types/node": "^24.3.0",
"@types/react": "^19.1.10",
"@types/react-dom": "^19.1.7",
"@vitnode/eslint-config": "workspace:*",
"@vitnode/config": "workspace:*",
"dotenv": "^17.2.1",
"eslint": "^9.33.0",
"react-email": "^4.2.8",
"tsc-alias": "^1.8.16",
"tsx": "^4.20.4",
Expand Down
14 changes: 7 additions & 7 deletions apps/api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { serve } from '@hono/node-server';
import { OpenAPIHono } from '@hono/zod-openapi';
import { VitNodeAPI } from '@vitnode/core/api/config';
import { serve } from "@hono/node-server";
import { OpenAPIHono } from "@hono/zod-openapi";
import { VitNodeAPI } from "@vitnode/core/api/config";

import { vitNodeApiConfig } from './vitnode.api.config.js';
import { vitNodeApiConfig } from "./vitnode.api.config.js";

const app = new OpenAPIHono().basePath('/api');
const app = new OpenAPIHono().basePath("/api");

VitNodeAPI({
app,
Expand All @@ -17,9 +17,9 @@ serve(
port: 8080,
},
info => {
const initMessage = '\x1b[34m[VitNode]\x1b[0m';
const initMessage = "\x1b[34m[VitNode]\x1b[0m";

// eslint-disable-next-line no-console
// biome-ignore lint/suspicious/noConsole: <start>
console.log(
`${initMessage} API server is running on http://localhost:${info.port}`,
);
Expand Down
23 changes: 11 additions & 12 deletions apps/api/src/vitnode.api.config.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
import { NodemailerEmailAdapter } from '@vitnode/core/api/adapters/email/nodemailer';
import { buildApiConfig } from '@vitnode/core/vitnode.config';
import * as dotenv from 'dotenv';
import { drizzle } from 'drizzle-orm/postgres-js';
import { NodemailerEmailAdapter } from "@vitnode/core/api/adapters/email/nodemailer";
import { buildApiConfig } from "@vitnode/core/vitnode.config";
import { config } from "dotenv";
import { drizzle } from "drizzle-orm/postgres-js";

dotenv.config({
config({
quiet: true,
});

export const POSTGRES_URL =
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
process.env.POSTGRES_URL || 'postgresql://root:root@localhost:5432/vitnode';
process.env.POSTGRES_URL || "postgresql://root:root@localhost:5432/vitnode";

export const vitNodeApiConfig = buildApiConfig({
plugins: [],
pathToMessages: async path => await import(`./locales/${path}`),
dbProvider: drizzle({
connection: POSTGRES_URL,
casing: 'camelCase',
casing: "camelCase",
}),
email: {
adapter: NodemailerEmailAdapter({
Expand All @@ -26,12 +25,12 @@ export const vitNodeApiConfig = buildApiConfig({
user: process.env.NOD_EMAILER_USER,
}),
logo: {
text: 'VitNode Email Test',
src: 'http://localhost:3000/logo_vitnode_dark.png',
text: "VitNode Email Test",
src: "http://localhost:3000/logo_vitnode_dark.png",
},
},
metadata: {
title: 'VitNode API',
shortTitle: 'VitNode',
title: "VitNode API",
shortTitle: "VitNode",
},
});
2 changes: 1 addition & 1 deletion apps/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vitnode/eslint-config/tsconfig",
"extends": "@vitnode/config/tsconfig",
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
Expand Down
14 changes: 6 additions & 8 deletions apps/docs/content/docs/dev/contribution.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,21 @@ vitnode/
│ └── docs/ # Documentation site
├── packages/
│ ├── vitnode/ # Core framework code
│ ├── eslint/ # ESLint configurations for workspaces
│ ├── config/ # Shared Biome,TypeScript configs
│ └── create-vitnode-app/ # CLI tool for creating new projects
└── plugins/ # Official open-source plugins
```

<Callout type="info" title="Monorepo Magic!">
VitNode uses Turborepo to keep everything organized. Apps, packages, and
plugins all live together in harmony!
VitNode uses Turborepo to keep everything organized. Apps, packages, and plugins all live together
in harmony!
</Callout>

## Coding Standards

- We use TypeScript for type safety ([TypeScript Docs](https://www.typescriptlang.org/))
- Follow ESM (ECMAScript Modules) conventions ([ESM Guide](https://nodejs.org/api/esm.html))
- Respect the ESLint configuration in each workspace ([ESLint](https://eslint.org/))
- Respect the Biome configuration in each workspace ([Biome](https://biomejs.dev/))
- Format your code with Prettier ([Prettier](https://prettier.io/))
- Use React Server Components where appropriate
- Write meaningful commit messages ([Conventional Commits](https://www.conventionalcommits.org/))
Expand Down Expand Up @@ -139,7 +139,7 @@ pnpm db:migrate # Run migrations
- TypeScript for type safety
- ESM module conventions
- React Server Components where appropriate
- Respect ESLint rules in each workspace
- Respect Biome rules in each workspace

<Callout type="warn">
Don't forget to test your changes locally! 🧪
Expand Down Expand Up @@ -192,6 +192,4 @@ pnpm db:migrate # Run migrations

Thank you for contributing to VitNode! 🚀

<Callout title="You rock!">
Every contribution makes VitNode better. We appreciate you! 💜
</Callout>
<Callout title="You rock!">Every contribution makes VitNode better. We appreciate you! 💜</Callout>
Loading