Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(frontend): Move admin pages to dynamic routing #425

Merged
merged 11 commits into from
Jul 27, 2024
Merged
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ pnpm create vitnode-app@latest
| Node.js | 18 | 20 |
| PostgreSQL | 14 | 16 |

| 🖥️ Hardware | Minimum | Recommended | Development |
| :---------- | :------------- | :------------- | :------------- |
| CPU | 1GHz (2+ core) | 1GHz (4+ core) | 1GHz (4+ core) |
| RAM | 2GB | 4GB | 8GB |
| Storage | 10GB | 20GB | 20GB |
| Network | 100Mbps | 300Mbps | 100Mbps |
| 🖥️ Hardware | Minimum | Development |
| :---------- | :------------- | :------------- |
| CPU | 1GHz (2+ core) | 1GHz (4+ core) |
| RAM | 4GB | 8GB |
| Storage | 10GB | 20GB |
| Network | 100Mbps | 100Mbps |

| 🧑‍💻 Browser | Minimum | Recommended |
| :--------- | :------ | :---------- |
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backend",
"version": "0.0.8-canary.1",
"version": "0.0.8-canary.6",
"license": "MIT",
"scripts": {
"config:init": "vitnode-backend init",
Expand Down
12 changes: 6 additions & 6 deletions apps/docs/content/docs/dev/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ npx create-vitnode-app@latest
| Node.js | 18 | 20 |
| PostgreSQL | 14 | 16 |

| 🖥️ Hardware | Minimum | Recommended | Development |
| :---------- | :------------- | :------------- | :------------- |
| CPU | 1GHz (2+ core) | 1GHz (4+ core) | 1GHz (4+ core) |
| RAM | 2GB | 4GB | 8GB |
| Storage | 10GB | 20GB | 20GB |
| Network | 100Mbps | 300Mbps | 100Mbps |
| 🖥️ Hardware | Minimum | Development |
| :---------- | :------------- | :------------- |
| CPU | 1GHz (2+ core) | 1GHz (4+ core) |
| RAM | 4GB | 8GB |
| Storage | 10GB | 20GB |
| Network | 100Mbps | 100Mbps |

| 🧑‍💻 Browser | Minimum | Recommended |
| :--------- | :------ | :---------- |
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "0.0.8-canary.1",
"version": "0.0.8-canary.6",
"private": true,
"scripts": {
"dev:docs": "next dev --port 3030",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {
SlugAdminView,
generateMetadataSlugAdmin,
SlugAdminViewProps,
} from 'vitnode-frontend/views/admin/views/slug';

export const generateMetadata = generateMetadataSlugAdmin;

export default function Page(props: SlugAdminViewProps) {
return <SlugAdminView {...props} />;
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 7 additions & 0 deletions apps/frontend/app/[locale]/admin/(auth)/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use client';

import { InternalErrorView } from 'vitnode-frontend/views/global/internal-error/internal-error-view';

export default function Error() {
return <InternalErrorView />;
}
7 changes: 1 addition & 6 deletions apps/frontend/app/[locale]/admin/(auth)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@ import {
AdminLayout,
generateMetadataAdminLayout,
} from 'vitnode-frontend/views/admin/layout/admin-layout';
import { AuthAdminLayout } from 'vitnode-frontend/views/admin/layout/auth/auth-admin-layout';

export const generateMetadata = generateMetadataAdminLayout;

export default function Layout({ children }: { children: React.ReactNode }) {
return (
<AdminLayout>
<AuthAdminLayout>{children}</AuthAdminLayout>
</AdminLayout>
);
return <AdminLayout>{children}</AdminLayout>;
}
5 changes: 5 additions & 0 deletions apps/frontend/app/[locale]/admin/(auth)/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ErrorView } from 'vitnode-frontend/views/theme/views/error/error-view';

export default function NotFoundPage() {
return <ErrorView code="404" />;
}
6 changes: 3 additions & 3 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "0.0.8-canary.1",
"version": "0.0.8-canary.6",
"author": "Maciej Piotr (aXenDev) Balcerzak",
"license": "GPL-3.0 license",
"scripts": {
Expand All @@ -17,15 +17,15 @@
},
"dependencies": {
"geist": "^1.3.1",
"next": "15.0.0-canary.79",
"next": "15.0.0-canary.86",
"next-intl": "^3.17.2",
"react": "^19.0.0-rc.0",
"react-dom": "^19.0.0-rc.0",
"vitnode-frontend": "workspace:*",
"vitnode-shared": "workspace:*"
},
"devDependencies": {
"@next/bundle-analyzer": "15.0.0-canary.79",
"@next/bundle-analyzer": "15.0.0-canary.86",
"@types/node": "^20.14.12",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vitnode-backend",
"version": "0.0.8-canary.1",
"version": "0.0.8-canary.6",
"description": "Backend wrapper for VitNode projects",
"author": "VitNode Team",
"license": "MIT",
Expand Down
1 change: 0 additions & 1 deletion packages/backend/src/core/languages/show/show.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export class ShowCoreLanguageService {
});

const where = ilike(core_languages.name, `%${search}%`);

const edges = await this.databaseService.db.query.core_languages.findMany({
...pagination,
where: and(pagination.where, where),
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/functions/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export async function inputPaginationCursor<T extends TableConfig>({
return {
where: eq(database.id, -1),
orderBy,
limit: 0,
limit: undefined,
};
}

Expand All @@ -164,6 +164,6 @@ export async function inputPaginationCursor<T extends TableConfig>({
return {
where,
orderBy,
limit: first || last ? (last ? last + 1 : first) + 1 : 0,
limit: first || last ? (last ? last + 1 : first) + 1 : undefined,
};
}
2 changes: 1 addition & 1 deletion packages/create-vitnode-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-vitnode-app",
"version": "0.0.8-canary.1",
"version": "0.0.8-canary.6",
"description": "Create a new VitNode app in seconds.",
"author": "VitNode Team",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const createPackagesJSON = ({
'config:init': 'turbo config:init',
dev: 'turbo dev',
build: 'turbo build',
start: 'turbo start',
...(eslint ? { lint: 'turbo lint', 'lint:fix': 'turbo lint:fix' } : {}),
...(docker
? {
Expand Down Expand Up @@ -87,10 +88,12 @@ export const createPackagesJSON = ({
dependencies: {
geist: '^1.3.1',
'lucide-react': '^0.414.0',
next: '15.0.0-canary.79',
next: '15.0.0-canary.86',
react: '^19.0.0-rc.0',
'react-dom': '^19.0.0-rc.0',
'next-intl': '^3.17.2',
'react-hook-form': '^7.52.1',
'@hookform/resolvers': '^3.9.0',
'vitnode-frontend': `^${pkg.version}`,
},
devDependencies: {
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-typescript-vitnode/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-typescript-vitnode",
"version": "0.0.8-canary.1",
"version": "0.0.8-canary.6",
"description": "ESLint, TypeScript (TSConfig), Prettier config for VitNode",
"author": "VitNode Team",
"license": "MIT",
Expand Down Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"eslint-config-next": "15.0.0-canary.79",
"eslint-config-next": "15.0.0-canary.86",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jsx-a11y": "^6.9.0",
Expand Down
Loading