Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/dotkom/monoweb into feature…
Browse files Browse the repository at this point in the history
…/pro-1-create-profile-info-component
  • Loading branch information
hanlun0804 committed Nov 6, 2024
2 parents 6be7864 + 05245dd commit e66f6e4
Show file tree
Hide file tree
Showing 52 changed files with 2,677 additions and 1,842 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ env:
GTX_AUTH0_CLIENT_ID: ${{ secrets.GTX_AUTH0_CLIENT_ID }}
GTX_AUTH0_CLIENT_SECRET: ${{ secrets.GTX_AUTH0_CLIENT_SECRET }}
GTX_AUTH0_ISSUER: ${{ secrets.GTX_AUTH0_ISSUER }}
RPC_HOST: ${{ secrets.RPC_HOST }}
RPC_ALLOWED_ORIGINS: ${{ secrets.RPC_ALLOWED_ORIGINS }}

jobs:
build:
Expand Down
6 changes: 3 additions & 3 deletions apps/brevduen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@aws-sdk/client-ses": "^3.507.0",
"@aws-sdk/client-ses": "^3.665.0",
"@dotkomonline/emails": "workspace:*",
"zod": "^3.22.4"
},
"devDependencies": {
"@biomejs/biome": "^1.9.2",
"@biomejs/biome": "^1.9.3",
"@dotkomonline/tsconfig": "workspace:*",
"@types/aws-lambda": "^8.10.129",
"@types/node": "^20.12.7",
"@types/node": "^20.16.10",
"tsup": "^7.2.0",
"typescript": "^5.4.5"
}
Expand Down
30 changes: 17 additions & 13 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev -p 3002",
"dev": "next dev -p 3002 --turbo",
"build": "next build",
"start": "next start",
"lint": "biome check . --write",
Expand All @@ -14,42 +14,46 @@
"@dotkomonline/auth": "workspace:*",
"@dotkomonline/env": "workspace:*",
"@dotkomonline/gateway-trpc": "workspace:*",
"@dotkomonline/proxy-nextjs": "workspace:*",
"@dotkomonline/types": "workspace:*",
"@dotkomonline/ui": "workspace:*",
"@dotkomonline/utils": "workspace:*",
"@aws-sdk/client-s3": "^3.665.0",
"@aws-sdk/s3-presigned-post": "^3.665.0",
"@hookform/error-message": "^2.0.1",
"@hookform/resolvers": "^3.3.4",
"@iconify/react": "^4.1.1",
"@mantine/core": "^7.2.2",
"@mantine/dates": "^7.2.2",
"@mantine/hooks": "^7.2.2",
"@mantine/modals": "^7.2.2",
"@mantine/notifications": "^7.2.2",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-dialog": "^1.0.5",
"@mantine/core": "^7.13.2",
"@mantine/dates": "^7.13.2",
"@mantine/hooks": "^7.13.2",
"@mantine/modals": "^7.13.2",
"@mantine/notifications": "^7.13.2",
"@radix-ui/react-alert-dialog": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.2",
"@tanstack/react-query": "^4.36.1",
"@tanstack/react-table": "^8.10.7",
"@trpc/client": "^10.45.0",
"@trpc/react-query": "^10.45.0",
"@trpc/server": "^10.45.0",
"clsx": "^2.0.0",
"dayjs": "^1.11.10",
"next": "^14.0.3",
"next-auth": "^4.24.5",
"next": "^14.2.14",
"next-auth": "^4.24.8",
"pg-native": "file:./stubs/pg-native",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.48.2",
"react-zxing": "^2.0.0",
"superjson": "^2.0.0",
"pg": "^8.11.3",
"zod": "^3.22.4"
},
"devDependencies": {
"@biomejs/biome": "^1.9.2",
"@biomejs/biome": "^1.9.3",
"@dotkomonline/config": "workspace:^",
"@dotkomonline/tsconfig": "workspace:*",
"@types/node": "^20.12.7",
"@types/react": "^18.2.38",
"@types/node": "^20.16.10",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.2.17",
"autoprefixer": "^10.4.16",
"open-color": "^1.9.1",
Expand Down
10 changes: 10 additions & 0 deletions apps/dashboard/src/app/api/trpc/[...path]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { env } from "@dotkomonline/env"
import { createProxyRoute } from "@dotkomonline/proxy-nextjs"

const handler = createProxyRoute({
mountPath: "/api/trpc",
apiEndpoint: env.RPC_HOST,
})

export const GET = handler
export const POST = handler
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export const CreateJobListingModal: FC<ContextModalProps> = ({ context, id }) =>
const create = useCreateJobListingMutation()
const FormComponent = useJobListingWriteForm({
onSubmit: (data) => {
create.mutate(data)
const createdAt = new Date()
create.mutate({ ...data, createdAt })
close()
},
})
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/utils/trpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import superjson from "superjson"

const getBaseUrl = () => {
if (env.NEXT_PUBLIC_NODE_ENV === "production") {
return "https://web.online.ntnu.no"
return "https://rpc.web.online.ntnu.no"
}
return "http://localhost:3000"
return "http://localhost:3002"
}

export const trpcConfig: CreateTRPCClientOptions<AppRouter> = {
Expand Down
8 changes: 4 additions & 4 deletions apps/invoicification/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
"@iconify/react": "^4.1.1",
"@tanstack/react-query": "^4.36.1",
"clsx": "^2.0.0",
"next": "^14.0.3",
"next": "^14.2.14",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.48.2",
"zod": "^3.22.4"
},
"devDependencies": {
"@biomejs/biome": "^1.9.2",
"@biomejs/biome": "^1.9.3",
"@dotkomonline/config": "workspace:^",
"@dotkomonline/tsconfig": "workspace:*",
"@types/node": "^20.12.7",
"@types/react": "^18.2.38",
"@types/node": "^20.16.10",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.2.17",
"autoprefixer": "^10.4.16",
"postcss": "^8.4.31",
Expand Down
12 changes: 6 additions & 6 deletions apps/rif/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@
"@hookform/error-message": "^2.0.1",
"@hookform/resolvers": "^3.3.4",
"@iconify/react": "^4.1.1",
"@radix-ui/react-tooltip": "^1.0.7",
"@radix-ui/react-toast": "^1.1.5",
"@radix-ui/react-toast": "^1.2.2",
"@radix-ui/react-tooltip": "^1.1.3",
"@tanstack/react-query": "^4.36.1",
"clsx": "^2.0.0",
"google-auth-library": "^9.6.3",
"google-spreadsheet": "^4.1.1",
"next": "^14.0.3",
"next": "^14.2.14",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.48.2",
"zod": "^3.22.4"
},
"devDependencies": {
"@biomejs/biome": "^1.9.2",
"@biomejs/biome": "^1.9.3",
"@dotkomonline/config": "workspace:^",
"@types/node": "^20.12.7",
"@types/react": "^18.2.38",
"@types/node": "^20.16.10",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.2.17",
"autoprefixer": "^10.4.16",
"postcss": "^8.4.31",
Expand Down
4 changes: 4 additions & 0 deletions apps/rpc/biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"extends": ["../../biome.json"]
}
30 changes: 30 additions & 0 deletions apps/rpc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "@dotkomonline/rpc",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "tsx src/index.ts",
"build": "tsc",
"lint": "biome check . --write",
"lint-check": "biome check .",
"type-check": "tsc --noEmit"
},
"dependencies": {
"@dotkomonline/env": "workspace:*",
"@dotkomonline/gateway-trpc": "workspace:*",
"@fastify/cors": "^9.0.1",
"@trpc/server": "^10.45.0",
"fastify": "^4.28.0",
"zod": "^3.22.4"
},
"devDependencies": {
"@biomejs/biome": "^1.9.3",
"@dotkomonline/config": "workspace:*",
"@dotkomonline/tsconfig": "workspace:*",
"@types/node": "^20.12.7",
"tslib": "^2.6.2",
"typescript": "^5.4.5",
"tsx": "^4.15.6"
}
}
51 changes: 51 additions & 0 deletions apps/rpc/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { env } from "@dotkomonline/env"
import { type AppRouter, JwtService, appRouter, createContext } from "@dotkomonline/gateway-trpc"
import fastifyCors from "@fastify/cors"
import { type FastifyTRPCPluginOptions, fastifyTRPCPlugin } from "@trpc/server/adapters/fastify"
import type { CreateFastifyContextOptions } from "@trpc/server/dist/adapters/fastify"
import fastify from "fastify"

const jwtService = new JwtService(env.WEB_AUTH0_ISSUER, [
env.WEB_AUTH0_CLIENT_ID,
env.DASHBOARD_AUTH0_CLIENT_ID,
env.GTX_AUTH0_CLIENT_ID,
])

const allowedOrigins = env.RPC_ALLOWED_ORIGINS.split(",")

export async function createFastifyContext({ req }: CreateFastifyContextOptions) {
const bearer = req.headers.authorization
if (bearer !== undefined) {
const token = bearer.substring("Bearer ".length)
const principal = await jwtService.verify(token)
return createContext({ principal: principal.payload.sub ?? null })
}

return createContext({
principal: null,
})
}

const server = fastify({
maxParamLength: 5000,
})
server.register(fastifyCors, {
origin: allowedOrigins,
methods: ["GET", "POST", "PUT", "DELETE"],
allowedHeaders: ["Content-Type", "Authorization"],
credentials: true,
})

server.register(fastifyTRPCPlugin, {
prefix: "/api/trpc",
trpcOptions: {
router: appRouter,
createContext: createFastifyContext,
onError: ({ path, error }) => {
// report to error monitoring
console.error(`Error in tRPC handler on path '${path}':`, error)
},
} satisfies FastifyTRPCPluginOptions<AppRouter>["trpcOptions"],
})

await server.listen({ port: 4444 })
11 changes: 11 additions & 0 deletions apps/rpc/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../packages/tsconfig/tsconfig.json",
"include": ["./**/*.ts", "./**/*.tsx"],
"exclude": [],
"compilerOptions": {
"baseUrl": ".",
"jsx": "preserve",
"incremental": true,
"strictNullChecks": true
}
}
33 changes: 17 additions & 16 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "module",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "next dev --turbo",
"build:prod": "next build",
"start": "next start",
"storybook": "start-storybook -p 6007",
Expand All @@ -19,32 +19,34 @@
"@dotkomonline/env": "workspace:*",
"@dotkomonline/gateway-edge-nextjs": "workspace:*",
"@dotkomonline/gateway-trpc": "workspace:*",
"@dotkomonline/proxy-nextjs": "workspace:*",
"@dotkomonline/types": "workspace:*",
"@dotkomonline/ui": "workspace:*",
"@dotkomonline/utils": "workspace:*",
"@aws-sdk/client-s3": "^3.665.0",
"@aws-sdk/s3-presigned-post": "^3.665.0",
"@fadi-ui/react-country-flag": "^1.0.7",
"@next/env": "^14.0.3",
"@next/env": "^14.2.14",
"@portabletext/react": "^3.0.11",
"@radix-ui/colors": "^3.0.0",
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/react-popover": "^1.0.7",
"@sanity/client": "^6.8.6",
"@radix-ui/react-navigation-menu": "^1.2.1",
"@radix-ui/react-popover": "^1.1.2",
"@sanity/client": "^6.22.1",
"@tailwindcss/typography": "^0.5.10",
"@tanstack/react-query": "^4.36.1",
"@trpc/client": "^10.45.0",
"@trpc/next": "^10.45.0",
"@trpc/react-query": "^10.45.0",
"@trpc/server": "^10.45.0",
"axios": "1.7.7",
"clsx": "^2.0.0",
"cors": "^2.8.5",
"date-fns": "^3.0.0",
"next": "^14.0.3",
"next-auth": "^4.24.5",
"date-fns": "^4.1.0",
"next": "^14.2.14",
"next-auth": "^4.24.8",
"next-superjson-plugin": "^0.6.0",
"next-themes": "^0.3.0",
"pg": "^8.11.3",
Expand All @@ -57,21 +59,20 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@biomejs/biome": "^1.9.2",
"@biomejs/biome": "^1.9.3",
"@dotkomonline/config": "workspace:*",
"@dotkomonline/logger": "workspace:*",
"@dotkomonline/tsconfig": "workspace:*",
"@types/cors": "^2.8.17",
"@types/jsdom": "^21.1.6",
"@types/node": "^20.12.7",
"@types/react": "^18.2.38",
"@types/node": "^20.16.10",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.2.17",
"autoprefixer": "^10.4.16",
"cva": "npm:class-variance-authority@^0.7.0",
"jsdom": "^22.1.0",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.5",
"trpc-playground": "^1.0.4",
"tslib": "^2.6.2",
"typescript": "^5.4.5"
}
Expand Down
10 changes: 10 additions & 0 deletions apps/web/src/app/api/trpc/[...path]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { env } from "@dotkomonline/env"
import { createProxyRoute } from "@dotkomonline/proxy-nextjs"

const handler = createProxyRoute({
mountPath: "/api/trpc",
apiEndpoint: env.RPC_HOST,
})

export const GET = handler
export const POST = handler
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const CompanyInterestProcess: FC<CompanyInterestProcessProps> = ({ steps }) => {
{steps.map((step, index) => (
<>
<div key={step} className="mb-1 w-36 flex flex-col items-center z-10 py-3">
<Circle size={700 / 15} color="bg-brand">
<p className="font-bold text-background">{index + 1}</p>
<Circle size={700 / 15} color="bg-brand-lighter">
<p className="text-white font-bold text-background">{index + 1}</p>
</Circle>
<p className="text-brand text-center text-xl font-semibold mt-9 md:mt-14">{step}</p>
<p className="text-brand-lighter text-center text-xl font-semibold mt-9 md:mt-14">{step}</p>
</div>
{index !== steps.length - 1 && (
<svg
Expand Down
Loading

0 comments on commit e66f6e4

Please sign in to comment.