Skip to content

Commit 2b905e3

Browse files
evanyan13jmsandiegooJajaredrickkohshavonneg
authored
Milestone 2 (#23)
* BE - Enable hot reload in dev env (#20) * Jmsandiegoo/frontend ms2 (#21) * Fix typescript lint issues * Enable frontend hot reload with docker * Finish basic static navbar * Add grid and flex layout to dashboard page content * Add questions endpoints * Add google auth (#24) * Add google auth * Add questions endpoints * Add questions endpoints * Add google auth * Add questions endpoints * Add google auth * Get on auth service * Implementing login and signup in auth-service * Update naming convention of services * Implemented signup and login missing error handling * Add new questions endpoints and response handling * Add update question endpoint * Enable CORS for FE * Create Swagger API docs for BE * Add create user * Completed signup and login endpoint * Commit Dockerfile * Commit package-lock files * Commit package-lock files * Add github login * Change response payload for get questions and add question categories endpoint (#41) * Ms2 rick/frontend (#43) * Fix typescript lint issues * Enable frontend hot reload with docker * Finish basic static navbar * Add grid and flex layout to dashboard page content * Update basic grid structure and modularize dashboard page * Update avatar with hovercard and modify calendar and avaar shadcn ui * Finish static profile card and hover variant * Adjust shadcn calendar sizing * Add find match button * Fix navbar z-index issue * Add tailwind colors * Add chart shadcn ui * Improve button to include soft variant * Add title case string utility function * Rename streak calendar component * Update user avatar component to support custom class names * Fix lint errors * Improve questions stats card component * Add shadcn sheet ui component * Add Zod * Define Question type * Add Pagination component * Add async function to fetch questions from the server * Create useAdvancedSearchParams hook for advanced search params * Add dashboard main content components * Example env file * Fix nested button next error * Enable CORS in main.ts for backend gateway service * Refactor styling for MainContent and SideContents * Update Navbar height to 10px in container * Fix fetch question to handle new response structure * Add UI components: Badge, Command, DropdownMenu, Popover, Separator * Add new Radix UI components and external library * Update MainContent and SideContents components styling * Use TanStack table: Implement filtering and sorting * Fix grid responsive layout for larger screens * Add textinput component * Add text area input field * Fix lint error in text area input component * Add radio group input field * Add relevant shadcn components for the new fields * Add multibadgeselect input field * Add create question modal form * Implement api integration for create question modal * Remove empty FormMessage components * Add Radix UI toast component and toaster feature * Add response schema creation function and update question types * Add Alert Dialog component for UI * Add Toaster component to DashboardLayout * Rename CreateQuestionModal to Forms/CreateQuestionModal * Add functions to get, create, edit, and delete questions * Add DeleteQuestionDialog component * Add EditQuestionModal component for question editing * QuestionTable simple error handling * Add CreateQuestionModal for creating new questions * Add delete and edit functionality to QuestionTable ActionsColumn * Separate Category from Question * Add function to fetch question categories data * Update getQuestions to getQuestionCategories --------- Co-authored-by: jmsandiegoo <[email protected]> Co-authored-by: Jm San Diego <[email protected]> * Refactor auth implementation (#42) * Refactor get user by email method * Refactor create user method * Refactor sign up method by adding refresh token * Refactor sign in by adding refresh token * Propagate rpcexception * Hide create user endpoint * Update README.md * Patch repeated post call issue (#44) * Fix typescript lint issues * Enable frontend hot reload with docker * Finish basic static navbar * Add grid and flex layout to dashboard page content * Update basic grid structure and modularize dashboard page * Update avatar with hovercard and modify calendar and avaar shadcn ui * Finish static profile card and hover variant * Adjust shadcn calendar sizing * Add find match button * Fix navbar z-index issue * Add tailwind colors * Add chart shadcn ui * Improve button to include soft variant * Add title case string utility function * Rename streak calendar component * Update user avatar component to support custom class names * Fix lint errors * Improve questions stats card component * Add shadcn sheet ui component * Add Zod * Define Question type * Add Pagination component * Add async function to fetch questions from the server * Create useAdvancedSearchParams hook for advanced search params * Add dashboard main content components * Example env file * Fix nested button next error * Enable CORS in main.ts for backend gateway service * Refactor styling for MainContent and SideContents * Update Navbar height to 10px in container * Fix fetch question to handle new response structure * Add UI components: Badge, Command, DropdownMenu, Popover, Separator * Add new Radix UI components and external library * Update MainContent and SideContents components styling * Use TanStack table: Implement filtering and sorting * Fix grid responsive layout for larger screens * Add textinput component * Add text area input field * Fix lint error in text area input component * Add radio group input field * Add relevant shadcn components for the new fields * Add multibadgeselect input field * Add create question modal form * Implement api integration for create question modal * Remove empty FormMessage components * Add Radix UI toast component and toaster feature * Add response schema creation function and update question types * Add Alert Dialog component for UI * Add Toaster component to DashboardLayout * Rename CreateQuestionModal to Forms/CreateQuestionModal * Add functions to get, create, edit, and delete questions * Add DeleteQuestionDialog component * Add EditQuestionModal component for question editing * QuestionTable simple error handling * Add CreateQuestionModal for creating new questions * Add delete and edit functionality to QuestionTable ActionsColumn * Separate Category from Question * Add function to fetch question categories data * Update getQuestions to getQuestionCategories * Refactor getQuestionCategories to use cache function * Add QuestionTableContext for managing question categories * Update question forms to use QuestionTableContext * Add QuestionTableContext to DataTableToolbar component * Add QuestionTableProvider to DataTable component * Fix eslint errors --------- Co-authored-by: jmsandiegoo <[email protected]> Co-authored-by: Jm San Diego <[email protected]> * Implement Logout, Refresh Token and Auth Guard (#45) * Refactor get user by email method * Refactor create user method * Refactor sign up method by adding refresh token * Refactor sign in by adding refresh token * Propagate rpcexception * Hide create user endpoint * Migrate some service to controller in gateway * Implement logout function * Implement token refresh * Implement AUTH_GUARD globally * Implemented auth guards * Fix merge conflict duplicate * Update social auth to handle user checking * Merge MS2-FE to MS2 (#50) * Fix typescript lint issues * Enable frontend hot reload with docker * Finish basic static navbar * Add grid and flex layout to dashboard page content * Update basic grid structure and modularize dashboard page * Update avatar with hovercard and modify calendar and avaar shadcn ui * Finish static profile card and hover variant * Adjust shadcn calendar sizing * Add find match button * Fix navbar z-index issue * Add tailwind colors * Add chart shadcn ui * Improve button to include soft variant * Add title case string utility function * Rename streak calendar component * Update user avatar component to support custom class names * Fix lint errors * Improve questions stats card component * Add shadcn sheet ui component * Add Zod * Define Question type * Add Pagination component * Add async function to fetch questions from the server * Create useAdvancedSearchParams hook for advanced search params * Add dashboard main content components * Example env file * Fix nested button next error * Enable CORS in main.ts for backend gateway service * Refactor styling for MainContent and SideContents * Update Navbar height to 10px in container * Fix fetch question to handle new response structure * Add UI components: Badge, Command, DropdownMenu, Popover, Separator * Add new Radix UI components and external library * Update MainContent and SideContents components styling * Use TanStack table: Implement filtering and sorting * Fix grid responsive layout for larger screens * Add textinput component * Add text area input field * Fix lint error in text area input component * Add radio group input field * Add relevant shadcn components for the new fields * Add multibadgeselect input field * Add create question modal form * Implement api integration for create question modal * Remove empty FormMessage components * Add Radix UI toast component and toaster feature * Add response schema creation function and update question types * Add Alert Dialog component for UI * Add Toaster component to DashboardLayout * Rename CreateQuestionModal to Forms/CreateQuestionModal * Add functions to get, create, edit, and delete questions * Add DeleteQuestionDialog component * Add EditQuestionModal component for question editing * QuestionTable simple error handling * Add CreateQuestionModal for creating new questions * Add delete and edit functionality to QuestionTable ActionsColumn * Separate Category from Question * Add function to fetch question categories data * Update getQuestions to getQuestionCategories * Refactor getQuestionCategories to use cache function * Add QuestionTableContext for managing question categories * Update question forms to use QuestionTableContext * Add QuestionTableContext to DataTableToolbar component * Add QuestionTableProvider to DataTable component * Fix eslint errors * Auth Service FE (#48) * Add signin page * Add OAuth logins to signin page * Add signup page * Add email verification code page * Update useState for form handling * Add error handling for form inputs * Update links to login page * Merge branch 'ms2' of https://github.com/CS3219-AY2425S1/cs3219-ay2425s1-project-g33 into ms2-shavonne/auth * Update signin and signup page to use react-hook-forms --------- Co-authored-by: shavonneg <> Co-authored-by: Jajabonks <[email protected]> --------- Co-authored-by: jmsandiegoo <[email protected]> Co-authored-by: Rick <[email protected]> Co-authored-by: Jm San Diego <[email protected]> Co-authored-by: shavonneg <[email protected]> --------- Co-authored-by: Jm San Diego <[email protected]> Co-authored-by: Jajared <[email protected]> Co-authored-by: Jajabonks <[email protected]> Co-authored-by: Rick Koh <[email protected]> Co-authored-by: jmsandiegoo <[email protected]> Co-authored-by: shavonneg <[email protected]>
1 parent f255f9e commit 2b905e3

File tree

212 files changed

+9233
-530
lines changed

Some content is hidden

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

212 files changed

+9233
-530
lines changed

README.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,35 @@
11
[![Review Assignment Due Date](https://classroom.github.com/assets/deadline-readme-button-22041afd0340ce965d47ae6ef1cefeee28c7c493a6346c4f15d667ab976d596c.svg)](https://classroom.github.com/a/bzPrOe11)
2+
23
# CS3219 Project (PeerPrep) - AY2425S1
3-
## Group: Gxx
44

5-
### Note:
6-
- You can choose to develop individual microservices within separate folders within this repository **OR** use individual repositories (all public) for each microservice.
7-
- In the latter scenario, you should enable sub-modules on this GitHub classroom repository to manage the development/deployment **AND** add your mentor to the individual repositories as a collaborator.
8-
- The teaching team should be given access to the repositories as we may require viewing the history of the repository in case of any disputes or disagreements.
5+
## Group: G33
6+
7+
### Note:
8+
9+
- You can choose to develop individual microservices within separate folders within this repository **OR** use individual repositories (all public) for each microservice.
10+
- In the latter scenario, you should enable sub-modules on this GitHub classroom repository to manage the development/deployment **AND** add your mentor to the individual repositories as a collaborator.
11+
- The teaching team should be given access to the repositories as we may require viewing the history of the repository in case of any disputes or disagreements.
12+
13+
## For Development:
14+
15+
### Backend:
16+
17+
To launch the development environment using Docker Compose, follow these steps:
18+
19+
1. Enter backend directory
20+
21+
```
22+
cd backend
23+
```
24+
25+
2. Run docker-compose using `-f` flag to specify the file to build from and `-d` flag to run the containers in detached mode (in the background)
26+
27+
```
28+
docker-compose -f docker-compose.yml up -d
29+
```
30+
31+
3. To stop the running services
32+
33+
```
34+
docker-compose down
35+
```

backend/.dockerignore

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

backend/.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
pnpm-debug.log*
7+
8+
# Dependency directories
9+
node_modules/
10+
.bower_components/
11+
12+
# Environment variables
13+
.env
14+
.env.local
15+
.env.*.local
16+
17+
# Typescript cache and build
18+
*.tsbuildinfo
19+
dist/
20+
build/
21+
22+
# Static file build outputs
23+
public/static
24+
25+
# Testing
26+
coverage/
27+
**/coverage/
28+
.nyc_output/
29+
jest-test-results.json
30+
.cache/
31+
32+
# OS generated files
33+
.DS_Store
34+
Thumbs.db
35+
36+
# Editor-specific
37+
.vscode/
38+
.idea/
39+
*.suo
40+
*.ntvs*
41+
*.njsproj
42+
*.sln
43+
44+
# MacOS files
45+
*.DS_Store

backend/auth-service/.env.example

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Authentication
2+
JWT_SECRET=JWT_SECRET
3+
JWT_REFRESH_SECRET=JWT_REFRESH_SECRET
4+
5+
# Google Auth
6+
GOOGLE_CLIENT_ID=GOOGLE_CLIENT_ID
7+
GOOGLE_CLIENT_SECRET=GOOGLE_CLIENT_SECRET
8+
GOOGLE_CALLBACK_URL=http://localhost:4000/api/auth/google/callback
9+
# Github Auth
10+
GITHUB_CLIENT_ID=GITHUB_CLIENT_ID
11+
GITHUB_CLIENT_SECRET=GITHUB_CLIENT_SECRET
12+
GITHUB_CALLBACK_URL=http://localhost:4000/api/auth/github/callback
13+
14+
# Database
15+
MONGO_CONNECTION_STRING=MONGO_CONNECTION_STRING

backend/auth-service/Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#################
2+
## DEVELOPMENT ##
3+
#################
4+
FROM node:18-alpine AS development
5+
6+
# Set the working directory in the container
7+
WORKDIR /app
8+
9+
# Copy the package.json and package-lock.json files
10+
COPY package*.json ./
11+
12+
# Install dependencies
13+
RUN npm install
14+
15+
# Copy the rest of the application code
16+
COPY . .
17+
18+
# Built the app to /dist folder
19+
RUN npm run build
20+
21+
# Expose the port the app runs on
22+
EXPOSE 4000
23+
24+
################
25+
## PRODUCTION ##
26+
################
27+
FROM node:18-alpine AS production
28+
29+
# Set node environment to production
30+
ARG NODE_ENV=production
31+
ENV NODE_ENV=${NODE_ENV}
32+
33+
# Set the working directory in the container
34+
WORKDIR /app
35+
36+
# Copy only the necessary files from the previous build stage
37+
COPY --from=development /peerprep/app/dist ./dist
38+
COPY package*.json ./
39+
40+
# Install production dependencies only
41+
RUN npm ci --only=production
42+
43+
# Expose the port the app runs on
44+
EXPOSE 4000
45+
46+
# Run the main file
47+
CMD ["node", "dist/main"]

0 commit comments

Comments
 (0)