Skip to content

Commit 75d2106

Browse files
committed
Merge branch 'main' into role-based-authorization-spa
2 parents d5c4faa + 374d8da commit 75d2106

File tree

71 files changed

+7023
-54
lines changed

Some content is hidden

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

71 files changed

+7023
-54
lines changed

.env.sample

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ USER_DB_LOCAL_URI=mongodb://user-db:27017/user
1313
USER_DB_USERNAME=user
1414
USER_DB_PASSWORD=password
1515

16+
# Match Service
17+
MATCH_DB_CLOUD_URI=<FILL-THIS-IN>
18+
MATCH_DB_LOCAL_URI=mongodb://match-db:27017/match
19+
MATCH_DB_USERNAME=user
20+
MATCH_DB_PASSWORD=password
21+
1622
# Secret for creating JWT signature
1723
JWT_SECRET=you-can-replace-this-with-your-own-secret
1824

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
service: [frontend, services/question, services/user]
26+
service: [frontend, services/question, services/user, services/match]
2727
steps:
2828
- uses: actions/checkout@v4
2929
- name: Use Node.js

compose.dev.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,20 @@ services:
2626

2727
user-db:
2828
ports:
29-
- 27018:27017
29+
- 27018:27017
30+
31+
match:
32+
command: npm run dev
33+
ports:
34+
- 8083:8083
35+
volumes:
36+
- /app/node_modules
37+
- ./services/match:/app
38+
39+
match-db:
40+
ports:
41+
- 27019:27017
42+
43+
match-broker:
44+
ports:
45+
- 5672:5672

compose.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ services:
1616
- 8080:8080
1717
volumes:
1818
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
19+
depends_on:
20+
- question
21+
- user
22+
- match
1923
networks:
2024
- gateway-network
2125

@@ -78,10 +82,56 @@ services:
7882
- user-db-network
7983
command: --quiet
8084
restart: always
85+
86+
match:
87+
container_name: match
88+
image: match
89+
build:
90+
context: services/match
91+
dockerfile: Dockerfile
92+
environment:
93+
DB_CLOUD_URI: ${MATCH_DB_CLOUD_URI}
94+
DB_LOCAL_URI: ${MATCH_DB_LOCAL_URI}
95+
DB_USERNAME: ${MATCH_DB_USERNAME}
96+
DB_PASSWORD: ${MATCH_DB_PASSWORD}
97+
depends_on:
98+
match-broker:
99+
condition: service_healthy
100+
networks:
101+
- gateway-network
102+
- match-db-network
103+
restart: always
104+
105+
match-db:
106+
container_name: match-db
107+
image: mongo:7.0.14
108+
environment:
109+
MONGO_INITDB_ROOT_USERNAME: ${MATCH_DB_USERNAME}
110+
MONGO_INITDB_ROOT_PASSWORD: ${MATCH_DB_PASSWORD}
111+
volumes:
112+
- match-db:/data/db
113+
networks:
114+
- match-db-network
115+
restart: always
116+
117+
match-broker:
118+
container_name: match-broker
119+
hostname: match-broker
120+
image: rabbitmq:4.0.2
121+
user: rabbitmq
122+
networks:
123+
- match-db-network
124+
healthcheck:
125+
test: rabbitmq-diagnostics check_port_connectivity
126+
interval: 30s
127+
timeout: 30s
128+
retries: 10
129+
start_period: 30s
81130

82131
volumes:
83132
question-db:
84133
user-db:
134+
match-db:
85135

86136
networks:
87137
gateway-network:
@@ -90,3 +140,5 @@ networks:
90140
driver: bridge
91141
user-db-network:
92142
driver: bridge
143+
match-db-network:
144+
driver: bridge

frontend/angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
}
2828
],
2929
"styles": [
30-
"src/styles.css"
30+
"src/styles.css",
31+
"node_modules/typeface-poppins/index.css"
3132
],
3233
"scripts": []
3334
},

frontend/package-lock.json

Lines changed: 130 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"primeng": "^17.18.11",
2626
"rxjs": "~7.8.0",
2727
"tslib": "^2.3.0",
28+
"typeface-poppins": "^1.1.13",
2829
"zone.js": "~0.14.10"
2930
},
3031
"devDependencies": {

frontend/public/logo.png

125 KB
Loading

frontend/src/_services/authentication.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,20 @@ export class AuthenticationService extends ApiService {
2121
) {
2222
super();
2323
const userData = localStorage.getItem('user');
24-
this.userSubject = new BehaviorSubject(userData ? JSON.parse(userData) : null);
24+
const user: User | null = userData ? JSON.parse(userData) : null;
25+
this.userSubject = new BehaviorSubject(user);
2526
this.user$ = this.userSubject.asObservable();
2627
}
2728

2829
public get userValue() {
2930
return this.userSubject.value;
3031
}
3132

33+
public get isLoggedIn(): boolean {
34+
return !!this.userSubject.value;
35+
}
36+
3237
login(username: string, password: string) {
33-
console.log('login', `${this.apiUrl}/auth/login`);
3438
return this.http
3539
.post<UServRes>(
3640
`${this.apiUrl}/auth/login`,

0 commit comments

Comments
 (0)