-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove course favorites, add program favs
- Loading branch information
Showing
21 changed files
with
91 additions
and
249 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
backend/migrations/00020_remove_course_favorites_create_program_favorites.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- +goose Up | ||
-- +goose StatementBegin | ||
DROP TABLE IF EXISTS favorites CASCADE; | ||
CREATE TABLE public.program_favorites ( | ||
id SERIAL PRIMARY KEY, | ||
program_id INT NOT NULL, | ||
user_id INT NOT NULL, | ||
FOREIGN KEY (program_id) REFERENCES programs(id), | ||
FOREIGN KEY (user_id) REFERENCES users(id) | ||
); | ||
CREATE INDEX program_favorites_program_id_index ON program_favorites USING btree (program_id); | ||
CREATE INDEX program_favorites_user_id_index ON program_favorites USING btree (user_id); | ||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
-- +goose StatementBegin | ||
CREATE TABLE public.favorites ( | ||
id SERIAL NOT NULL PRIMARY KEY, | ||
user_id integer, | ||
course_id integer, | ||
FOREIGN KEY (user_id) REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE CASCADE, | ||
FOREIGN KEY (course_id) REFERENCES public.courses(id) ON UPDATE CASCADE ON DELETE CASCADE | ||
); | ||
DROP TABLE IF EXISTS program_favorites CASCADE; | ||
-- +goose StatementEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,25 @@ | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
server_name replace-me-with-host.com; | ||
gzip on; | ||
http2 on; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
} | ||
|
||
location /videos/ { | ||
proxy_pass http://server:8080; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location /api { | ||
proxy_pass http://server:8080; | ||
proxy_buffering on; | ||
proxy_cache_methods GET HEAD; | ||
proxy_http_version 1.1; | ||
proxy_set_header Real-IP $remote_addr; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
# API gateway is handled with traefik in production, so only statics are served | ||
|
||
location /oauth2 { | ||
proxy_pass http://hydra:4444; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
location ~* \.(?:ico|css|js|gif|jpe?g|png|svg|woff|woff2|ttf|eot|otf|webp)$ { | ||
expires 1d; | ||
add_header Cache-Control "public, max-age=86400"; | ||
} | ||
|
||
location /sessions/ { | ||
proxy_pass http://kratos:4433; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header X-Forwarded-Host $host; | ||
location ~* \.(?:html)$ { | ||
expires -1; | ||
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate"; | ||
} | ||
|
||
location /self-service { | ||
proxy_pass http://kratos:4433; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header X-Forwarded-Host $host; | ||
} | ||
|
||
location /.well-known/jwks.json { | ||
proxy_pass http://hydra:4444; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
|
||
location /userinfo { | ||
proxy_pass http://hydra:4444; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
} | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
add_header Cache-Control "no-store"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.