Skip to content

Commit 2b21ae7

Browse files
committed
Resolve merge conflict
2 parents 61e1ec7 + 2e58b03 commit 2b21ae7

Some content is hidden

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

48 files changed

+1837
-711
lines changed

.env.sample

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Common variables
2+
COMPOSE_PATH_SEPARATOR=:
3+
# Replace string between '...compose.' and '.yml' with 'dev' or 'prod'
4+
COMPOSE_FILE=docker-compose.yml:docker-compose.dev.yml
5+
6+
## Frontend variables
7+
FRONTEND_PORT=3000
8+
9+
## Question service variables
10+
QUESTION_SVC_PORT=
11+
QUESTION_SVC_DB_URI=
12+
13+
## User service variables
14+
USER_SVC_PORT=
15+
USER_SVC_DB_URI=
16+
JWT_SECRET=
17+
EMAIL_ADDRESS=
18+
EMAIL_PASSWORD=

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

docker-compose.dev.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Base file is docker-compose.yml
2+
services:
3+
frontend:
4+
build:
5+
target: dev
6+
volumes:
7+
- ./frontend/app:/app/app
8+
- ./frontend/components:/app/components
9+
10+
question-service:
11+
environment:
12+
- BUILD_ENV=dev
13+
volumes:
14+
- ./question-service/app:/app/app
15+
16+
user-service:
17+
build:
18+
target: dev
19+
volumes:
20+
- ./user-service/app:/app/app

docker-compose.prod.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Base file is docker-compose.yml
2+
services:
3+
frontend:
4+
build:
5+
target: prod
6+
7+
question-service:
8+
environment:
9+
- BUILD_ENV=prod
10+
11+
user-service:
12+
build:
13+
target: prod

docker-compose.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
services:
2+
frontend:
3+
build:
4+
context: ./frontend
5+
ports:
6+
- $FRONTEND_PORT:$FRONTEND_PORT
7+
depends_on:
8+
- question-service
9+
- user-service
10+
11+
question-service:
12+
build:
13+
context: ./question-service
14+
ports:
15+
- $QUESTION_SVC_PORT:$QUESTION_SVC_PORT
16+
environment:
17+
- PORT=$QUESTION_SVC_PORT
18+
- DB_URI=$QUESTION_SVC_DB_URI
19+
20+
user-service:
21+
build:
22+
context: ./user-service
23+
ports:
24+
- $USER_SVC_PORT:$USER_SVC_PORT
25+
environment:
26+
- PORT=$USER_SVC_PORT
27+
- DB_URI=$USER_SVC_DB_URI
28+
- JWT_SECRET=$JWT_SECRET
29+
- EMAIL_ADDRESS=$EMAIL_ADDRESS
30+
- EMAIL_PASSWORD=$EMAIL_PASSWORD

frontend/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
.next

frontend/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Base stage
2+
FROM node:20-alpine AS base
3+
WORKDIR /app
4+
COPY package.json .
5+
COPY yarn.lock .
6+
RUN yarn install --frozen-lockfile
7+
8+
# Production build stage
9+
FROM base AS build
10+
COPY . .
11+
RUN yarn build
12+
13+
# Development stage
14+
FROM base AS dev
15+
COPY . .
16+
CMD ["yarn", "dev"]
17+
18+
# Production runtime stage
19+
FROM build AS prod
20+
CMD ["yarn", "start"]

frontend/app/app/layout.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

frontend/app/layout.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
"use client";
2+
13
import type { Metadata } from "next";
24
import localFont from "next/font/local";
35
import "./globals.css";
46
import { ThemeProvider } from "@/components/theme-provider";
57
import { Toaster } from "@/components/ui/toaster";
68
import AuthProvider from "@/app/auth/auth-context";
9+
import AuthPageWrapper from "@/components/auth/auth-page-wrapper";
10+
import { Navbar } from "@/components/navbar";
711

812
const geistSans = localFont({
913
src: "./fonts/GeistVF.woff",
@@ -37,7 +41,12 @@ export default function RootLayout({
3741
enableSystem
3842
disableTransitionOnChange
3943
>
40-
<AuthProvider>{children}</AuthProvider>
44+
<AuthProvider>
45+
<AuthPageWrapper>
46+
<Navbar />
47+
{children}
48+
</AuthPageWrapper>
49+
</AuthProvider>
4150
<Toaster />
4251
</ThemeProvider>
4352
</body>

frontend/components/navbar.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { useAuth } from "@/app/auth/auth-context";
24
import { usePathname } from "next/navigation";
35

0 commit comments

Comments
 (0)