Skip to content

Commit e04524b

Browse files
Merge pull request #668 from aXenDeveloper/email
feat: Add send email
2 parents 6c420cd + 69f1575 commit e04524b

File tree

103 files changed

+2304
-1835
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+2304
-1835
lines changed

.env.example

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
POSTGRES_URL=postgresql://root:root@localhost:5432/vitnode
22

3-
NEXT_PUBLIC_BACKEND_URL=http://localhost:3000
4-
NEXT_PUBLIC_BACKEND_CLIENT_URL=http://localhost:3000
5-
NEXT_PUBLIC_FRONTEND_URL=http://localhost:3000
3+
NEXT_PUBLIC_API_URL=http://localhost:3000
4+
NEXT_PUBLIC_WEB_URL=http://localhost:3000
65

76
# === Docker Database Postgres ===
87
POSTGRES_USER=root

apps/api/drizzle.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineVitNodeDrizzleConfig } from '@vitnode/core/drizzle.config';
2+
3+
import { POSTGRES_URL, vitNodeApiConfig } from './src/vitnode.api.config';
4+
5+
export default defineVitNodeDrizzleConfig({
6+
vitNodeApiConfig,
7+
out: './migrations/',
8+
dialect: 'postgresql',
9+
dbCredentials: {
10+
url: POSTGRES_URL,
11+
},
12+
});

apps/api/eslint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import eslintVitNode from '@vitnode/eslint-config/eslint';
2+
3+
export default [
4+
...eslintVitNode,
5+
{
6+
ignores: ['drizzle.config.ts'],
7+
},
8+
];

apps/api/package.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "api",
3+
"version": "1.2.0-canary.31",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "tsx watch src/index.ts",
8+
"build": "tsc && tsc-alias -p tsconfig.json",
9+
"start": "node dist/index.js",
10+
"lint": "eslint .",
11+
"lint:fix": "eslint . --fix",
12+
"drizzle-kit": "drizzle-kit"
13+
},
14+
"dependencies": {
15+
"@hono/zod-openapi": "^0.19.8",
16+
"@hono/zod-validator": "^0.7.0",
17+
"@react-email/components": "^0.1.1",
18+
"@vitnode/core": "workspace:*",
19+
"drizzle-kit": "^0.31.3",
20+
"drizzle-orm": "^0.44.2",
21+
"hono": "^4.8.3",
22+
"next-intl": "^4.3.1",
23+
"react": "^19.1",
24+
"react-dom": "^19.1",
25+
"zod": "^3.25.67"
26+
},
27+
"devDependencies": {
28+
"@hono/node-server": "^1.15.0",
29+
"@types/node": "^24",
30+
"@types/react": "^19.1",
31+
"@types/react-dom": "^19.1",
32+
"@vitnode/eslint-config": "workspace:*",
33+
"dotenv": "^17.1.0",
34+
"eslint": "^9.29.0",
35+
"prettier": "^3.6.1",
36+
"prettier-plugin-tailwindcss": "^0.6.12",
37+
"react-email": "^4.0.17",
38+
"tsc-alias": "^1.8.16",
39+
"tsx": "^4.20.3",
40+
"typescript": "^5.8.3"
41+
}
42+
}

apps/api/src/index.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { serve } from '@hono/node-server';
2+
import { OpenAPIHono } from '@hono/zod-openapi';
3+
import { VitNodeAPI } from '@vitnode/core/api/config';
4+
5+
import { vitNodeApiConfig } from './vitnode.api.config.js';
6+
import { vitNodeConfig } from './vitnode.config.js';
7+
8+
const app = new OpenAPIHono().basePath('/api');
9+
10+
VitNodeAPI({
11+
app,
12+
vitNodeApiConfig,
13+
vitNodeConfig,
14+
});
15+
16+
serve(
17+
{
18+
fetch: app.fetch,
19+
port: 8080,
20+
},
21+
info => {
22+
const initMessage = '\x1b[34m[VitNode]\x1b[0m';
23+
24+
// eslint-disable-next-line no-console
25+
console.log(
26+
`${initMessage} API server is running on http://localhost:${info.port}`,
27+
);
28+
},
29+
);

apps/api/src/vitnode.api.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { buildApiConfig } from '@vitnode/core/vitnode.config';
2+
import * as dotenv from 'dotenv';
3+
import { drizzle } from 'drizzle-orm/postgres-js';
4+
5+
dotenv.config();
6+
7+
export const POSTGRES_URL =
8+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
9+
process.env.POSTGRES_URL || 'postgresql://root:root@localhost:5432/vitnode';
10+
11+
export const vitNodeApiConfig = buildApiConfig({
12+
plugins: [],
13+
dbProvider: drizzle({
14+
connection: POSTGRES_URL,
15+
casing: 'camelCase',
16+
}),
17+
});

apps/api/src/vitnode.config.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { buildConfig, handleRequestConfig } from '@vitnode/core/vitnode.config';
2+
import { getRequestConfig } from 'next-intl/server';
3+
4+
export const vitNodeConfig = buildConfig({
5+
metadata: {
6+
title: 'VitNode',
7+
shortTitle: 'VitNode',
8+
},
9+
plugins: [],
10+
i18n: {
11+
locales: [
12+
{
13+
code: 'en',
14+
name: 'English',
15+
},
16+
],
17+
defaultLocale: 'en',
18+
},
19+
theme: {
20+
defaultTheme: 'light',
21+
},
22+
});
23+
24+
// This is the request config for the app. It will be used in the app router.
25+
export default getRequestConfig(
26+
async ({ requestLocale }) =>
27+
await handleRequestConfig({
28+
requestLocale,
29+
vitNodeConfig,
30+
pathToMessages: async path => await import(`./locales/${path}`),
31+
}),
32+
);

apps/api/tsconfig.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"extends": "@vitnode/eslint-config/tsconfig",
4+
"compilerOptions": {
5+
"target": "ESNext",
6+
"module": "NodeNext",
7+
"baseUrl": ".",
8+
"outDir": "./dist",
9+
"types": ["node"],
10+
"paths": {
11+
"@/*": ["./src/*"]
12+
}
13+
},
14+
"include": ["src"],
15+
"exclude": ["node_modules"]
16+
}

apps/docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# deps
22
/node_modules
3+
.turbo
34

45
# generated content
56
.contentlayer

apps/docs/.prettierrc.mjs

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)