Skip to content

Commit 89a31d4

Browse files
committed
Merge branch 'main' into feat/collab/ai-chat-enhancements
2 parents 42f0cc3 + 2b5a251 commit 89a31d4

File tree

87 files changed

+1216
-212
lines changed

Some content is hidden

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

87 files changed

+1216
-212
lines changed

.env.sample

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
11
## Common variables
22
COMPOSE_PATH_SEPARATOR=:
33
# Replace string between '...compose.' and '.yml' with 'dev' or 'prod'
4-
COMPOSE_FILE=docker-compose.yml:docker-compose.dev.yml
4+
COMPOSE_FILE=docker-compose.yml:docker-compose.prod.yml
55

66
## Frontend variables
7-
FRONTEND_PORT=3000
7+
FRONTEND_SERVICE_PORT=3000
88
# BASE_URI only needs to be provided if hosting outside of cluster
99
BASE_URI=
1010

1111
## Question service variables
12-
QUESTION_SVC_PORT=
12+
QUESTION_SERVICE_SERVICE_PORT=8000
1313
QUESTION_SVC_DB_URI=
1414

1515
## User service variables
16-
USER_SVC_PORT=
16+
USER_SERVICE_SERVICE_PORT=3001
1717
USER_SVC_DB_URI=
1818
JWT_SECRET=
1919
EMAIL_ADDRESS=
2020
EMAIL_PASSWORD=
2121

2222
## Matching service variables
23-
MATCHING_SVC_PORT=6969
23+
MATCHING_SERVICE_SERVICE_PORT=6969
2424

2525
## Collab service variables
26-
COLLAB_SVC_PORT=3002
26+
COLLAB_SERVICE_SERVICE_PORT=3002
2727
COLLAB_SVC_DB_URI=
2828
OPENAI_API_KEY=
2929

3030
## Redis variables
31-
REDIS_PORT=6379
31+
REDIS_SERVICE_PORT=6379
3232

3333
## Redisinsight variables
34-
REDIS_INSIGHT_PORT=5540
34+
REDIS_INSIGHT_PORT=5540
35+
36+
## API Gateway variables
37+
API_GATEWAY_SERVICE_PORT=

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.env
2+
kubernetes/secrets.yaml

api-gateway/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM nginx:1.26
2+
COPY nginx.conf /etc/nginx/nginx.conf
3+
COPY templates /etc/nginx/templates

api-gateway/nginx.conf

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
user nginx;
2+
worker_processes auto;
3+
4+
error_log /var/log/nginx/error.log notice;
5+
pid /var/run/nginx.pid;
6+
7+
8+
events {
9+
worker_connections 1024;
10+
}
11+
12+
13+
http {
14+
include /etc/nginx/mime.types;
15+
default_type application/octet-stream;
16+
17+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
18+
'$status $body_bytes_sent "$http_referer" '
19+
'"$http_user_agent" "$http_x_forwarded_for"';
20+
21+
access_log /var/log/nginx/access.log main;
22+
23+
sendfile on;
24+
#tcp_nopush on;
25+
26+
keepalive_timeout 65;
27+
28+
#gzip on;
29+
30+
add_header 'Access-Control-Allow-Origin' '*' always;
31+
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
32+
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept' always;
33+
34+
map $http_upgrade $connection_upgrade {
35+
default upgrade;
36+
'' close;
37+
}
38+
39+
include /etc/nginx/conf.d/*.conf;
40+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
location /admin/matching-service/ {
2+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
location /admin/question-service/ {
2+
location /admin/question-service/questions {
3+
proxy_pass http://question-service/questions;
4+
}
5+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
upstream user-service {
2+
server $USER_SERVICE_SERVICE_HOST:$USER_SERVICE_SERVICE_PORT;
3+
}
4+
5+
upstream question-service {
6+
server $QUESTION_SERVICE_SERVICE_HOST:$QUESTION_SERVICE_SERVICE_PORT;
7+
}
8+
9+
upstream matching-service {
10+
server $MATCHING_SERVICE_SERVICE_HOST:$MATCHING_SERVICE_SERVICE_PORT;
11+
}
12+
13+
upstream collab-service {
14+
server $COLLAB_SERVICE_SERVICE_HOST:$COLLAB_SERVICE_SERVICE_PORT;
15+
}
16+
17+
upstream frontend {
18+
server $FRONTEND_SERVICE_HOST:$FRONTEND_SERVICE_PORT;
19+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
location /verify-token {
2+
internal;
3+
4+
proxy_pass_request_body off;
5+
proxy_set_header Content-Length "";
6+
proxy_pass http://user-service/auth/verify-token;
7+
}
8+
9+
location /verify-owner {
10+
internal;
11+
12+
proxy_pass_request_body off;
13+
proxy_set_header Content-Length "";
14+
proxy_pass http://user-service/auth/verify-owner;
15+
}
16+
17+
location /verify-admin {
18+
internal;
19+
20+
proxy_pass_request_body off;
21+
proxy_set_header Content-Length "";
22+
proxy_pass http://user-service/auth/verify-admin;
23+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
location / {
2+
proxy_pass http://frontend;
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
location /owner/matching-service/ {
2+
}

0 commit comments

Comments
 (0)