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
45 changes: 45 additions & 0 deletions .github/workflows/firebasedeploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy MainWeb to Firebase Hosting

on:
push:
branches:
- main
pull_request:

permissions:
contents: read
pull-requests: write
checks: write

jobs:
build_and_deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: sites/mainweb

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Deploy to Firebase Hosting
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_DSGT }}
projectId: dsgt-website
channelId: ${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || 'live' }}
entryPoint: sites/mainweb
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
}
},
"dependencies": {
"@tanstack/react-router": "^1.141.2",
"autoprefixer": "^10.4.22",
"chart.js": "^4.5.1",
"postcss": "^8.5.6"
Expand Down
2 changes: 0 additions & 2 deletions packages/api/src/client.ts

This file was deleted.

35 changes: 4 additions & 31 deletions packages/api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
import { z } from 'zod';

import { createTRPCRouter, publicProcedure } from './trpc-server';

const portalRouter = createTRPCRouter({
getDashboard: publicProcedure.query(() => ({
title: 'Demo Dashboard',
widgets: [],
stats: {
users: 1234,
revenue: 9876,
growth: 12,
},
})),

updateProfile: publicProcedure
.input(z.object({ name: z.string(), email: z.string() }))
.mutation(({ input }) => {
// No-op mutation for demo purposes
return { success: true, input };
}),
});

export const appRouter = createTRPCRouter({
health: publicProcedure.query(() => ({ ok: true })),
portal: portalRouter,
});

export type AppRouter = typeof appRouter;

export default appRouter;
// packages/api/src/index.ts
export { appRouter, createContext } from './root';
export type { AppRouter, Context } from './root';
export { trpc, createTRPCRouter, publicProcedure } from './trpc';
15 changes: 0 additions & 15 deletions packages/api/src/middleware.ts

This file was deleted.

18 changes: 18 additions & 0 deletions packages/api/src/root.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { createTRPCRouter } from './trpc';
import { helloRouter } from './routers/hello';

// Context type
export type Context = {};

// Context creator
export const createContext = async (): Promise<Context> => {
return {};
};

// Root app router
export const appRouter = createTRPCRouter({
hello: helloRouter,
});

// Export API type
export type AppRouter = typeof appRouter;
7 changes: 7 additions & 0 deletions packages/api/src/routers/hello.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createTRPCRouter, publicProcedure } from '../trpc';

export const helloRouter = createTRPCRouter()({
sayHello: publicProcedure.query(() => {
return { message: 'Hello, world!' };
}),
});
20 changes: 6 additions & 14 deletions packages/api/src/trpc.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
import { createTRPCReact } from '@trpc/react-query';
import type { AppRouter } from './index';
import { httpBatchLink } from '@trpc/client';
// packages/api/src/trpc.ts
import { initTRPC } from '@trpc/server';
import { Context } from './root';

export const trpc = createTRPCReact<AppRouter>();
export const t = initTRPC.context<Context>().create();

export function createTrpcClient(baseUrl = '') {
return trpc.createClient({
links: [
httpBatchLink({
url: `${baseUrl || ''}/api/trpc`,
}),
],
});
}
export const createTRPCRouter = t.router;

export type Trpc = typeof trpc;
export const publicProcedure = t.procedure;
11 changes: 0 additions & 11 deletions packages/auth/src/hooks.ts

This file was deleted.

Loading
Loading