Skip to content

Commit 090f771

Browse files
committed
Merge branch 'canary' into landing_page
2 parents 2d9aad6 + d7faed0 commit 090f771

File tree

137 files changed

+4552
-1305
lines changed

Some content is hidden

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

137 files changed

+4552
-1305
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
LOGIN_TOKEN_SECRET=vitnode_secret
21
POSTGRES_URL=postgresql://root:root@localhost:5432/vitnode
32

43
NEXT_PUBLIC_BACKEND_URL=http://localhost:3000

.github/docs/prd.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ VitNode is designed for individual developers and small teams who need a structu
120120
- Component scaffolding
121121
- API endpoint generation
122122
- Database schema generation from models
123+
- Logging system with structured logs:
124+
- Log levels (debug, info, warn, error)
125+
- Contextual logging with request/response metadata
123126

124127
### File Management
125128

.github/workflows/build-lint-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: pnpm/action-setup@v4
2323
name: Install pnpm
2424
with:
25-
version: 10.12.1
25+
version: 10.12.4
2626

2727
- name: Install Node.js
2828
uses: actions/setup-node@v4

.github/workflows/bump_publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- uses: pnpm/action-setup@v4
5353
name: Install pnpm
5454
with:
55-
version: 10.12.1
55+
version: 10.12.4
5656

5757
- name: Install Node.js
5858
uses: actions/setup-node@v4

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"cSpell.words": ["vitnode"],
2+
"cSpell.words": ["sonner", "vitnode"],
33
"github.copilot.chat.commitMessageGeneration.instructions": [
44
{
55
"text": "Follow the Conventional Commits format strictly for commit messages. Use the structure below:\n\n```\n<type>[optional scope]: <gitmoji> <description>\n```\n\nGuidelines:\n\n1. **Type and Scope**: Choose an appropriate type (e.g., `feat`, `fix`, `refactor`, `docs`) and optional scope to describe the affected module or feature.\n\n2. **Gitmoji**: Include a relevant `gitmoji` that best represents the nature of the change.\n\n3. **Description**: Write a concise, informative description in the header; use backticks if referencing code or specific terms.\n\nCommit messages should be clear, informative, and professional, aiding readability and project tracking."

apps/docs/content/docs/dev/auth.mdx renamed to apps/docs/content/docs/dev/config/auth.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ You can configure the authentication settings in the `VitNodeAPI` function and `
1313

1414
For example you can change the expiration time of the cookie:
1515

16-
import { TypeTable } from 'fumadocs-ui/components/type-table';
17-
18-
```ts title="src/app/api/[...route]/route.ts"
16+
```ts title="src/vitnode.api.config.ts"
1917
VitNodeAPI({
2018
app,
2119
plugins: [],
@@ -28,6 +26,8 @@ VitNodeAPI({
2826
});
2927
```
3028

29+
import { TypeTable } from 'fumadocs-ui/components/type-table';
30+
3131
### Options
3232

3333
<TypeTable
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"title": "Config",
3+
"pages": ["..."]
4+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Rate Limiter
3+
description: Stop brute-force attacks and abuse with rate limiting.
4+
---
5+
6+
Rate limiting is a powerful feature that helps protect your API from abuse and brute-force attacks. It allows you to limit the number of requests a client can make within a specified time frame.
7+
8+
## Usage
9+
10+
```ts title="src/vitnode.api.config.ts"
11+
export const vitNodeApiConfig = buildApiConfig({
12+
// [!code ++:4]
13+
rateLimiter: {
14+
points: 40,
15+
duration: 60,
16+
},
17+
});
18+
```
19+
20+
### Options
21+
22+
import { TypeTable } from 'fumadocs-ui/components/type-table';
23+
24+
<TypeTable
25+
type={{
26+
points: {
27+
description:
28+
'The number of requests allowed within the specified duration.',
29+
type: 'number',
30+
default: '80 (120 in dev)',
31+
},
32+
duration: {
33+
description:
34+
'The time window in seconds during which the requests are counted.',
35+
type: 'number',
36+
default: '60',
37+
},
38+
execEvenly: {
39+
description:
40+
'If true, the requests are distributed evenly over the duration. If false, the requests are counted in a sliding window.',
41+
type: 'boolean',
42+
default: 'false',
43+
},
44+
execEvenlyMinDelayMs: {
45+
description:
46+
'The minimum delay in milliseconds between requests when execEvenly is true.',
47+
type: 'number',
48+
default: 'duration * 1000 / points',
49+
},
50+
blockDuration: {
51+
description:
52+
'The duration in seconds for which the client is blocked after exceeding the rate limit.',
53+
type: 'number',
54+
default: '0',
55+
},
56+
}}
57+
/>

apps/docs/content/docs/dev/database/pagination.mdx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,13 @@ On the frontend, the pagination system works seamlessly with the DataTable compo
127127
When fetching data from the API, include the pagination parameters in your request:
128128

129129
```tsx
130+
const query = await searchParams; // Assume searchParams is a Promise from the Next.js page context
130131
const res = await fetcher(userModule, {
131132
path: '/users',
132133
method: 'get',
133134
module: 'user',
134135
args: {
135-
query: {
136-
cursor: searchParams.cursor,
137-
first: searchParams.first,
138-
last: searchParams.last,
139-
order: searchParams.order,
140-
orderBy: searchParams.orderBy,
141-
},
136+
query,
142137
},
143138
withPagination: true, // Important flag for pagination
144139
});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"title": "Cloud",
3+
"pages": ["..."]
4+
}

0 commit comments

Comments
 (0)