Skip to content

Commit

Permalink
feat: final touches
Browse files Browse the repository at this point in the history
  • Loading branch information
ixahmedxi committed Feb 7, 2024
1 parent e4bfd07 commit 35ece14
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 75 deletions.
4 changes: 3 additions & 1 deletion apps/web/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { redirect } from 'next/navigation';
import { getSession } from '@orbitkit/auth';
import { Avatar, AvatarFallback, AvatarImage } from '@orbitkit/ui/avatar';

import { ThemeSwitcher } from '@/components/ThemeSwitcher';
import { trpc } from '@/lib/trpc/server';

export default async function Home() {
Expand All @@ -11,12 +12,13 @@ export default async function Home() {
return redirect('/login');
}

const hello = await trpc.greeting.hello.query({ name: 'John' });
const hello = await trpc.greeting.protectedHello.query();

return (
<main className="container mx-auto py-6 px-6">
<h1>Next.js app</h1>
<h1>{hello.greeting}</h1>
<ThemeSwitcher />
<Avatar>
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { type FC, type PropsWithChildren } from 'react';
import { ThemeProvider as NextThemesProvider } from 'next-themes';

import { TRPCReactProvider } from '@/lib/trpc/react';
import { TRPCReactProvider } from '@/lib/trpc/client';

export const Providers: FC<PropsWithChildren> = ({ children }) => {
return (
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions apps/web/src/lib/trpc/shared.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { type inferRouterInputs, type inferRouterOutputs } from '@trpc/server';

import { type AppRouter } from '@orbitkit/trpc';

import { env } from '@/env';

function getBaseUrl() {
Expand All @@ -9,3 +13,6 @@ function getBaseUrl() {
export function getUrl() {
return getBaseUrl() + '/api/trpc';
}

export type RouterInputs = inferRouterInputs<AppRouter>;
export type RouterOutputs = inferRouterOutputs<AppRouter>;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"prettier-plugin-packagejson": "^2.4.10",
"prettier-plugin-tailwindcss": "^0.5.11",
"rimraf": "^5.0.5",
"turbo": "^1.12.2",
"turbo": "^1.12.3",
"typescript": "^5.3.3"
},
"packageManager": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"arctic": "^1.1.4",
"lucia": "^3.0.1",
"next": "14.1.0",
"oslo": "^1.0.4",
"oslo": "^1.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"zod": "^3.22.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"typecheck": "tsc --noEmit --tsBuildInfoFile .tsbuildinfo"
},
"dependencies": {
"@neondatabase/serverless": "^0.7.2",
"@neondatabase/serverless": "^0.8.1",
"@t3-oss/env-core": "^0.8.0",
"drizzle-orm": "^0.29.3",
"pg": "^8.11.3",
Expand Down
10 changes: 7 additions & 3 deletions packages/trpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
"exports": {
".": "./src/index.ts"
},
"scripts": {
"lint": "eslint . --cache --max-warnings 0",
"typecheck": "tsc --noEmit --tsBuildInfoFile .tsbuildinfo"
},
"dependencies": {
"@orbitkit/auth": "workspace:^",
"@orbitkit/db": "workspace:^",
"@trpc/client": "^10.45.1",
"@trpc/next": "^10.45.1",
"@trpc/react-query": "^10.45.1",
"@trpc/server": "^10.45.1",
"superjson": "^2.2.1",
"zod": "^3.22.4"
Expand All @@ -23,5 +24,8 @@
"@orbitkit/tsconfig": "workspace:^",
"@types/node": "^20.11.16",
"eslint-config-orbitkit": "workspace:^"
},
"volta": {
"extends": "../../package.json"
}
}
4 changes: 0 additions & 4 deletions packages/trpc/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { type inferRouterInputs, type inferRouterOutputs } from '@trpc/server';

import { greetingRouter } from './routers/greeting';
import { router } from './trpc';

Expand All @@ -8,7 +6,5 @@ export const appRouter = router({
});

export type AppRouter = typeof appRouter;
export type RouterInputs = inferRouterInputs<AppRouter>;
export type RouterOutputs = inferRouterOutputs<AppRouter>;

export { createTRPCContext } from './trpc';
97 changes: 34 additions & 63 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 35ece14

Please sign in to comment.