Skip to content

Commit 6ab0bb2

Browse files
authored
Merge branch 'dev' into david/user-middleware
2 parents db8283d + 3c3a0aa commit 6ab0bb2

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

+4020
-55
lines changed

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Feature
3+
about: Suggest an idea for this project
4+
title: "[Feature] <FEATURE_NAME>"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
Description
11+
*A clear and concise description of what you want to happen.*
12+
13+
Related backlog codes
14+
- *M1FR1*
15+
16+
Other Notes:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Commit workflow
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
os: [ubuntu-latest, macos-latest, windows-latest]
10+
node-version: [20.x]
11+
runs-on: ${{ matrix.os }}
12+
defaults:
13+
run:
14+
working-directory: ./frontend/peerprep
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- run: npm ci
21+
- run: npm run lint
22+
- run: npm run build

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
services/**/serviceAccountKey.json
88

99
# Ignore node modules
10-
**/node_modules/
10+
**/node_modules/
11+
.vscode/

frontend/peerprep/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM node:20-alpine AS development-dependencies-env
2-
COPY . /app
32
WORKDIR /app
3+
COPY package*.json ./
44
RUN npm ci
55

66
FROM node:20-alpine AS production-dependencies-env
@@ -20,4 +20,4 @@ COPY --from=production-dependencies-env /app/node_modules /app/node_modules
2020
COPY --from=build-env /app/build /app/build
2121
WORKDIR /app
2222
EXPOSE 3000
23-
CMD ["npm", "run", "start"]
23+
CMD ["npm", "start"]

frontend/peerprep/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ Make sure to deploy the output of `npm run build`
7878
│ └── server/ # Server-side code
7979
```
8080

81+
### Lint check
82+
To run the lint check:
83+
84+
```bash
85+
npm run lint
86+
```
87+
8188
## Styling
8289

8390
This template comes with [Tailwind CSS](https://tailwindcss.com/) already configured for a simple default starting experience. You can use whatever CSS framework you prefer.

frontend/peerprep/app/assets/images/logo.svg

Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import { Grid, TextInput, Button, PasswordInput, Divider, Text, Image } from "@mantine/core";
2+
import { useForm } from "@mantine/form";
3+
import { Link } from "react-router";
4+
import logo from "../assets/images/logo.svg";
5+
6+
export function meta() {
7+
return [
8+
{ title: "PeerPrep - Login" },
9+
{ name: "description", content: "Welcome to PeerPrep!" },
10+
];
11+
}
12+
13+
export default function Login() {
14+
const form = useForm({
15+
initialValues: {
16+
email: "",
17+
password: "",
18+
},
19+
20+
validate: {
21+
email: (value) => (/^\S+@\S+$/.test(value) ? null : "Invalid email"),
22+
password: (value) =>
23+
value.length < 6 ? "Password must be at least 6 characters" : null,
24+
},
25+
});
26+
27+
return (
28+
<Grid>
29+
<Grid.Col span={12}>
30+
<Grid justify="center" gutter={"xs"} mt={{ base: 20, md: 200 }}>
31+
<Grid.Col span={{ base: 12, md: 4 }}>
32+
<Image src={logo} alt="PeerPrep Logo" />
33+
<form onSubmit={form.onSubmit((values) => console.log(values))}>
34+
<Grid.Col span={12}>
35+
<TextInput
36+
label="Email"
37+
placeholder="Enter your email"
38+
type="email"
39+
key={form.key("email")}
40+
{...form.getInputProps('email')}
41+
error={undefined}
42+
/>
43+
</Grid.Col>
44+
<Grid.Col span={12}>
45+
<PasswordInput
46+
label="Password"
47+
placeholder="Enter your password"
48+
type="password"
49+
key={form.key("password")}
50+
{...form.getInputProps('password')}
51+
/>
52+
</Grid.Col>
53+
<Grid.Col span={12} mt="md">
54+
<Button type="submit" fullWidth autoContrast>
55+
Login
56+
</Button>
57+
</Grid.Col>
58+
</form>
59+
<Grid.Col span={12} mt="md">
60+
<Divider my="xs" />
61+
</Grid.Col>
62+
<Grid.Col span={12} mt="md" className="text-center">
63+
<Text span>Don't have an account? </Text><Link to="/signup"><Text span td="underline" c="blue" className="cursor-pointer">Sign up!</Text></Link>
64+
</Grid.Col>
65+
</Grid.Col>
66+
</Grid>
67+
</Grid.Col>
68+
</Grid>
69+
);
70+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import { Grid, TextInput, Button, PasswordInput, Divider, Text, Image } from "@mantine/core";
2+
import { useForm } from "@mantine/form";
3+
import { Link } from "react-router";
4+
import logo from "../assets/images/logo.svg";
5+
6+
export function meta() {
7+
return [
8+
{ title: "PeerPrep - Signup" },
9+
{ name: "description", content: "Welcome to PeerPrep!" },
10+
];
11+
}
12+
13+
export default function Signup() {
14+
const form = useForm({
15+
initialValues: {
16+
email: "",
17+
username: "",
18+
password: "",
19+
},
20+
21+
validate: {
22+
email: (value) => (/^\S+@\S+$/.test(value) ? null : "Invalid email"),
23+
password: (value) =>
24+
value.length < 6 ? "Password must be at least 6 characters" : null,
25+
},
26+
});
27+
28+
return (
29+
<Grid>
30+
<Grid.Col span={12}>
31+
<Grid justify="center" gutter={"xs"} mt={{ base: 20, md: 200 }}>
32+
<Grid.Col span={{ base: 12, md: 4 }}>
33+
<Image src={logo} alt="PeerPrep Logo" />
34+
<form onSubmit={form.onSubmit((values) => console.log(values))}>
35+
<Grid.Col span={12}>
36+
<TextInput
37+
label="Email"
38+
placeholder="Enter your email"
39+
type="email"
40+
key={form.key("email")}
41+
{...form.getInputProps('email')}
42+
error={undefined}
43+
/>
44+
</Grid.Col>
45+
<Grid.Col span={12}>
46+
<TextInput
47+
label="Username"
48+
placeholder="Enter your Username"
49+
type="text"
50+
key={form.key("username")}
51+
{...form.getInputProps('username')}
52+
error={undefined}
53+
/>
54+
</Grid.Col>
55+
<Grid.Col span={12}>
56+
<PasswordInput
57+
label="Password"
58+
placeholder="Enter your password"
59+
type="password"
60+
key={form.key("password")}
61+
{...form.getInputProps('password')}
62+
/>
63+
</Grid.Col>
64+
<Grid.Col span={12} mt="md">
65+
<Button type="submit" fullWidth autoContrast>
66+
Login
67+
</Button>
68+
</Grid.Col>
69+
</form>
70+
<Grid.Col span={12} mt="md">
71+
<Divider my="xs" />
72+
</Grid.Col>
73+
<Grid.Col span={12} mt="md" className="text-center">
74+
<Text span>Already have an account? </Text><Link to="/login"><Text span td="underline" c="blue" className="cursor-pointer">Log in!</Text></Link>
75+
</Grid.Col>
76+
</Grid.Col>
77+
</Grid>
78+
</Grid.Col>
79+
</Grid>
80+
);
81+
}

frontend/peerprep/app/routes/home.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import type { Route } from "./+types/home";
21
import { Welcome } from "../welcome/welcome";
32

4-
export function meta({}: Route.MetaArgs) {
3+
export function meta() {
54
return [
65
{ title: "New React Router App" },
76
{ name: "description", content: "Welcome to React Router!" },

frontend/peerprep/eslint.config.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Setup guide from : https://eslint-react.xyz/docs/getting-started/typescript
2+
3+
// @ts-check
4+
import eslintJs from "@eslint/js";
5+
import eslintReact from "@eslint-react/eslint-plugin";
6+
import tseslint from "typescript-eslint";
7+
export default tseslint.config({
8+
files: ["**/*.ts", "**/*.tsx"],
9+
// Extend recommended rule sets from:
10+
// 1. ESLint JS's recommended rules
11+
// 2. TypeScript ESLint recommended rules
12+
// 3. ESLint React's recommended-typescript rules
13+
extends: [
14+
eslintJs.configs.recommended,
15+
tseslint.configs.recommended,
16+
eslintReact.configs["recommended-typescript"],
17+
],
18+
// Configure language/parsing options
19+
languageOptions: {
20+
// Use TypeScript ESLint parser for TypeScript files
21+
parser: tseslint.parser,
22+
parserOptions: {
23+
// Enable project service for better TypeScript integration
24+
projectService: true,
25+
tsconfigRootDir: import.meta.dirname,
26+
},
27+
},
28+
// Custom rule overrides (modify rule levels or disable rules)
29+
rules: {
30+
"@eslint-react/no-missing-key": "warn",
31+
},
32+
});

0 commit comments

Comments
 (0)