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
5 changes: 2 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
POSTGRES_URL=postgresql://root:root@localhost:5432/vitnode

NEXT_PUBLIC_BACKEND_URL=http://localhost:3000
NEXT_PUBLIC_BACKEND_CLIENT_URL=http://localhost:3000
NEXT_PUBLIC_FRONTEND_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:3000
NEXT_PUBLIC_WEB_URL=http://localhost:3000

# === Docker Database Postgres ===
POSTGRES_USER=root
Expand Down
12 changes: 12 additions & 0 deletions apps/api/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineVitNodeDrizzleConfig } from '@vitnode/core/drizzle.config';

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

export default defineVitNodeDrizzleConfig({
vitNodeApiConfig,
out: './migrations/',
dialect: 'postgresql',
dbCredentials: {
url: POSTGRES_URL,
},
});
8 changes: 8 additions & 0 deletions apps/api/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import eslintVitNode from '@vitnode/eslint-config/eslint';

export default [
...eslintVitNode,
{
ignores: ['drizzle.config.ts'],
},
];
42 changes: 42 additions & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "api",
"version": "1.2.0-canary.31",
"private": true,
"type": "module",
"scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsc && tsc-alias -p tsconfig.json",
"start": "node dist/index.js",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"drizzle-kit": "drizzle-kit"
},
"dependencies": {
"@hono/zod-openapi": "^0.19.8",
"@hono/zod-validator": "^0.7.0",
"@react-email/components": "^0.1.1",
"@vitnode/core": "workspace:*",
"drizzle-kit": "^0.31.3",
"drizzle-orm": "^0.44.2",
"hono": "^4.8.3",
"next-intl": "^4.3.1",
"react": "^19.1",
"react-dom": "^19.1",
"zod": "^3.25.67"
},
"devDependencies": {
"@hono/node-server": "^1.15.0",
"@types/node": "^24",
"@types/react": "^19.1",
"@types/react-dom": "^19.1",
"@vitnode/eslint-config": "workspace:*",
"dotenv": "^17.1.0",
"eslint": "^9.29.0",
"prettier": "^3.6.1",
"prettier-plugin-tailwindcss": "^0.6.12",
"react-email": "^4.0.17",
"tsc-alias": "^1.8.16",
"tsx": "^4.20.3",
"typescript": "^5.8.3"
}
}
29 changes: 29 additions & 0 deletions apps/api/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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 { vitNodeConfig } from './vitnode.config.js';

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

VitNodeAPI({
app,
vitNodeApiConfig,
vitNodeConfig,
});

serve(
{
fetch: app.fetch,
port: 8080,
},
info => {
const initMessage = '\x1b[34m[VitNode]\x1b[0m';

// eslint-disable-next-line no-console
console.log(
`${initMessage} API server is running on http://localhost:${info.port}`,
);
},
);
17 changes: 17 additions & 0 deletions apps/api/src/vitnode.api.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { buildApiConfig } from '@vitnode/core/vitnode.config';
import * as dotenv from 'dotenv';
import { drizzle } from 'drizzle-orm/postgres-js';

dotenv.config();

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

export const vitNodeApiConfig = buildApiConfig({
plugins: [],
dbProvider: drizzle({
connection: POSTGRES_URL,
casing: 'camelCase',
}),
});
32 changes: 32 additions & 0 deletions apps/api/src/vitnode.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { buildConfig, handleRequestConfig } from '@vitnode/core/vitnode.config';
import { getRequestConfig } from 'next-intl/server';

export const vitNodeConfig = buildConfig({
metadata: {
title: 'VitNode',
shortTitle: 'VitNode',
},
plugins: [],
i18n: {
locales: [
{
code: 'en',
name: 'English',
},
],
defaultLocale: 'en',
},
theme: {
defaultTheme: 'light',
},
});

// This is the request config for the app. It will be used in the app router.
export default getRequestConfig(
async ({ requestLocale }) =>
await handleRequestConfig({
requestLocale,
vitNodeConfig,
pathToMessages: async path => await import(`./locales/${path}`),
}),
);
16 changes: 16 additions & 0 deletions apps/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@vitnode/eslint-config/tsconfig",
"compilerOptions": {
"target": "ESNext",
"module": "NodeNext",
"baseUrl": ".",
"outDir": "./dist",
"types": ["node"],
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src"],
"exclude": ["node_modules"]
}
1 change: 1 addition & 0 deletions apps/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# deps
/node_modules
.turbo

# generated content
.contentlayer
Expand Down
11 changes: 0 additions & 11 deletions apps/docs/.prettierrc.mjs

This file was deleted.

7 changes: 7 additions & 0 deletions apps/docs/content/docs/dev/deployments/cloud/vercel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ description: How to deploy your Vitnode app on Vercel.
We're working hard to bring you the best documentation experience.
</Callout>

## Limitations

Some features of Vitnode are not supported on Vercel due to its serverless architecture. These include:

- Self-hosted static files
- WebSockets

## Requirements

- A Vercel account
Expand Down
15 changes: 7 additions & 8 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,28 @@
"motion": "^12.23.0",
"next": "^15.3.5",
"next-intl": "^4.3.4",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react": "^19.1",
"react-dom": "^19.1",
"react-hook-form": "^7.60.0",
"react-use": "^17.6.0",
"sonner": "^2.0.6",
"zod": "^3.25.74"
"sonner": "^2.0.6"
},
"devDependencies": {
"@playwright/test": "^1.53.2",
"@tailwindcss/postcss": "^4.1.11",
"@types/mdx": "^2.0.13",
"@types/node": "^24.0.10",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@types/react": "^19.1",
"@types/react-dom": "^19.1",
"@vitnode/eslint-config": "workspace:*",
"class-variance-authority": "^0.7.1",
"dotenv": "^17.0.1",
"eslint": "^9.30.1",
"postcss": "^8.5.6",
"react-email": "^4.0.17",
"shiki": "^3.7.0",
"tailwindcss": "^4.1.11",
"tw-animate-css": "^1.3.5",
"typescript": "^5.8.3"
"typescript": "^5.8.3",
"zod": "^3.25.74"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default async function Page(props: {
</h1>
<p className="text-muted-foreground text-lg">{page.data.description}</p>

<div className="flex flex-row items-center gap-2 border-b pt-2 pb-6">
<div className="flex flex-row items-center gap-2 border-b pb-6 pt-2">
<ViewOptions
githubUrl={`https://github.com/aXenDeveloper/vitnode/blob/canary/apps/docs/content/docs/${page.path}`}
markdownUrl={page.url}
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/app/[locale]/(docs)/docs/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function Layout({ children }: { children: ReactNode }) {
...option,
icon: (
<div
className="size-full rounded-lg max-md:border max-md:bg-(--tab-color)/10 max-md:p-1.5 [&_svg]:size-full"
className="max-md:bg-(--tab-color)/10 size-full rounded-lg max-md:border max-md:p-1.5 [&_svg]:size-full"
style={
{
color,
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/src/app/[locale]/(main)/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ export default function HomePage() {
<div className="flex max-w-2xl flex-col">
<span className="group relative mx-0 mb-6 flex max-w-fit flex-row items-center justify-center rounded-2xl bg-white/40 px-4 py-1.5 text-sm font-medium shadow-[inset_0_-8px_10px_#8fdfff1f] backdrop-blur-sm transition-shadow duration-500 ease-out [--bg-size:300%] hover:shadow-[inset_0_-5px_10px_#8fdfff3f] dark:bg-black/40">
<div
className={`animate-gradient absolute inset-0 block h-full w-full [border-radius:inherit] bg-gradient-to-r from-[#ffaa40]/50 via-[#9c40ff]/50 to-[#ffaa40]/50 bg-[length:var(--bg-size)_100%] ![mask-composite:subtract] p-[1px] [mask:linear-gradient(#fff_0_0)_content-box,linear-gradient(#fff_0_0)]`}
className={`animate-gradient absolute inset-0 block h-full w-full bg-gradient-to-r from-[#ffaa40]/50 via-[#9c40ff]/50 to-[#ffaa40]/50 bg-[length:var(--bg-size)_100%] p-[1px] [border-radius:inherit] ![mask-composite:subtract] [mask:linear-gradient(#fff_0_0)_content-box,linear-gradient(#fff_0_0)]`}
/>
🎉{` `}
VitNode 2.0 in progress...
{/* <ChevronRight className="ml-1 size-3 transition-transform duration-300 ease-in-out group-hover:translate-x-0.5" /> */}
</span>

<h1 className="text-5xl font-semibold tracking-tight text-balance sm:text-6xl">
<h1 className="text-balance text-5xl font-semibold tracking-tight sm:text-6xl">
Extendable <span className="text-primary">Framework</span> for
Building <span className="text-primary">Apps</span>
</h1>

<p className="text-muted-foreground mt-6 leading-relaxed text-balance md:text-lg">
<p className="text-muted-foreground mt-6 text-balance leading-relaxed md:text-lg">
Simplifies development with a powerful Plugin System, Admin Control
Panel and extensible architecture.
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const AdminSection = () => {
</h2>
</div>
<div className="relative rounded-3xl p-3 md:-mx-8 lg:col-span-3">
<div className="relative aspect-88/36">
<div className="from-background absolute inset-0 z-1 bg-linear-to-t to-transparent"></div>
<div className="aspect-88/36 relative">
<div className="from-background z-1 bg-linear-to-t absolute inset-0 to-transparent"></div>
<Image
alt="payments illustration dark"
className="hidden dark:block"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export const CallToActionSection = () => {
return (
<section className="py-16">
<Card className="flex flex-col items-center gap-4 px-6 py-16 text-center">
<h2 className="text-4xl font-semibold tracking-tight text-balance sm:text-5xl">
<h2 className="text-balance text-4xl font-semibold tracking-tight sm:text-5xl">
Start <span className="text-primary">Building</span>
</h2>
<p className="text-muted-foreground leading-relaxed text-balance md:text-lg">
<p className="text-muted-foreground text-balance leading-relaxed md:text-lg">
Everything you need for modern web apps, zero config.
</p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const TailwindCSSLogo = () => {
return (
<svg
aria-label="TailwindCSS logotype"
className="h-8 w-42"
className="w-42 h-8"
fill="none"
viewBox="0 0 262 33"
xmlns="http://www.w3.org/2000/svg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export const PoweringBySection = () => {
</Link>
</InfiniteSlider>

<div className="from-background absolute inset-y-0 left-0 w-20 bg-linear-to-r"></div>
<div className="from-background absolute inset-y-0 right-0 w-20 bg-linear-to-l"></div>
<div className="from-background bg-linear-to-r absolute inset-y-0 left-0 w-20"></div>
<div className="from-background bg-linear-to-l absolute inset-y-0 right-0 w-20"></div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/examples/separator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default function ProgressDemo() {
return (
<div>
<div className="space-y-1">
<h4 className="text-sm leading-none font-medium">Radix Primitives</h4>
<h4 className="text-sm font-medium leading-none">Radix Primitives</h4>
<p className="text-muted-foreground text-sm">
An open-source UI component library.
</p>
Expand Down
6 changes: 0 additions & 6 deletions apps/docs/src/vitnode.api.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ import { DiscordSSOApiPlugin } from '@vitnode/core/api/adapters/sso/discord';
import { FacebookSSOApiPlugin } from '@vitnode/core/api/adapters/sso/facebook';
import { GoogleSSOApiPlugin } from '@vitnode/core/api/adapters/sso/google';
import { buildApiConfig } from '@vitnode/core/vitnode.config';
import * as dotenv from 'dotenv';
import { drizzle } from 'drizzle-orm/postgres-js';
import { join } from 'path';

dotenv.config({
path: join(process.cwd(), '..', '..', '.env'),
});

export const POSTGRES_URL =
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
"test:e2e": "turbo test:e2e"
},
"devDependencies": {
"@types/node": "^24.0.10",
"@types/node": "^24",
"@vitnode/eslint-config": "workspace:*",
"prettier": "^3.6.2",
"prettier-plugin-tailwindcss": "^0.6.13",
"tsx": "^4.20.3",
"turbo": "^2.5.4",
"typescript": "^5.8.3",
"zod": "^3.25.74"
Expand Down
11 changes: 6 additions & 5 deletions packages/create-vitnode-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ bun create vitnode-app@latest

## Options

| Option | Description |
| ------------------- | ---------------------------------------------------------- |
| `--package-manager` | Specify the package manager to use. Support `npm`, `pnpm`. |
| `--eslint` | Initialize with eslint config. |
| `--skip-install` | Skip installing packages after initializing the project. |
| Option | Description |
| ------------------- | --------------------------------------------------------------------------------- |
| `--package-manager` | Specify the package manager to use. Support `npm`, `pnpm`. |
| `--eslint` | Initialize with eslint config. |
| `--skip-install` | Skip installing packages after initializing the project. |
| `--mode` | Specify the type of app to create. Support `singleApp`, `apiMonorepo`, `onlyApi`. |
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
POSTGRES_URL=postgresql://root:root@localhost:5432/vitnode

NEXT_PUBLIC_BACKEND_URL=http://localhost:3000
NEXT_PUBLIC_BACKEND_CLIENT_URL=http://localhost:3000
NEXT_PUBLIC_FRONTEND_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:3000
NEXT_PUBLIC_WEB_URL=http://localhost:3000

# === Docker Database Postgres ===
POSTGRES_USER=root
Expand Down
Loading