diff --git a/Dockerfile b/Dockerfile index 008c13a..f61d8bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,16 +10,6 @@ COPY apps/quotes . RUN $(npm bin)/ng build --prod --build-optimizer --output-hashing=none -WORKDIR /build-comments -COPY apps/comments/package.json apps/comments/package-lock.json ./ - -RUN npm install && mkdir /comments && cp -r node_modules/ /comments - -WORKDIR /comments -COPY apps/comments . - -RUN $(npm bin)/ng build --prod --build-optimizer --output-hashing=none - WORKDIR /build-schedule COPY apps/schedule/package.json apps/schedule/package-lock.json ./ @@ -30,13 +20,23 @@ COPY apps/schedule . RUN $(npm bin)/ng build --prod --build-optimizer --output-hashing=none +WORKDIR /build-twitch-logs +COPY apps/twitch-logs/package.json apps/twitch-logs/package-lock.json ./ + +RUN npm install && mkdir /twitch-logs && cp -r node_modules/ /twitch-logs + +WORKDIR /twitch-logs +COPY apps/twitch-logs . + +RUN $(npm bin)/ng build --prod --build-optimizer --output-hashing=none + FROM nginx:alpine COPY nginx/nginx.conf /etc/nginx/nginx.conf COPY --from=builder /quotes/dist /quotes/quotes/assets -COPY --from=builder /comments/dist /comments/comments/assets COPY --from=builder /schedule/dist /schedule/schedule/assets +COPY --from=builder /twitch-logs/dist /twitch-logs/twitch-logs/assets RUN addgroup -g 9999 lilia diff --git a/apps/comments/.angular-cli.json b/apps/twitch-logs/.angular-cli.json similarity index 97% rename from apps/comments/.angular-cli.json rename to apps/twitch-logs/.angular-cli.json index 8242ad1..e656c2b 100644 --- a/apps/comments/.angular-cli.json +++ b/apps/twitch-logs/.angular-cli.json @@ -1,7 +1,7 @@ { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "project": { - "name": "comments" + "name": "twitch-logs" }, "apps": [ { diff --git a/apps/comments/.editorconfig b/apps/twitch-logs/.editorconfig similarity index 100% rename from apps/comments/.editorconfig rename to apps/twitch-logs/.editorconfig diff --git a/apps/comments/.gitignore b/apps/twitch-logs/.gitignore similarity index 100% rename from apps/comments/.gitignore rename to apps/twitch-logs/.gitignore diff --git a/apps/comments/README.md b/apps/twitch-logs/README.md similarity index 100% rename from apps/comments/README.md rename to apps/twitch-logs/README.md diff --git a/apps/comments/e2e/app.e2e-spec.ts b/apps/twitch-logs/e2e/app.e2e-spec.ts similarity index 100% rename from apps/comments/e2e/app.e2e-spec.ts rename to apps/twitch-logs/e2e/app.e2e-spec.ts diff --git a/apps/comments/e2e/app.po.ts b/apps/twitch-logs/e2e/app.po.ts similarity index 100% rename from apps/comments/e2e/app.po.ts rename to apps/twitch-logs/e2e/app.po.ts diff --git a/apps/comments/e2e/tsconfig.e2e.json b/apps/twitch-logs/e2e/tsconfig.e2e.json similarity index 100% rename from apps/comments/e2e/tsconfig.e2e.json rename to apps/twitch-logs/e2e/tsconfig.e2e.json diff --git a/apps/comments/karma.conf.js b/apps/twitch-logs/karma.conf.js similarity index 100% rename from apps/comments/karma.conf.js rename to apps/twitch-logs/karma.conf.js diff --git a/apps/comments/package-lock.json b/apps/twitch-logs/package-lock.json similarity index 100% rename from apps/comments/package-lock.json rename to apps/twitch-logs/package-lock.json diff --git a/apps/comments/package.json b/apps/twitch-logs/package.json similarity index 100% rename from apps/comments/package.json rename to apps/twitch-logs/package.json diff --git a/apps/comments/protractor.conf.js b/apps/twitch-logs/protractor.conf.js similarity index 100% rename from apps/comments/protractor.conf.js rename to apps/twitch-logs/protractor.conf.js diff --git a/apps/comments/src/app/app.component.css b/apps/twitch-logs/src/app/app.component.css similarity index 100% rename from apps/comments/src/app/app.component.css rename to apps/twitch-logs/src/app/app.component.css diff --git a/apps/comments/src/app/app.component.html b/apps/twitch-logs/src/app/app.component.html similarity index 100% rename from apps/comments/src/app/app.component.html rename to apps/twitch-logs/src/app/app.component.html diff --git a/apps/comments/src/app/app.component.spec.ts b/apps/twitch-logs/src/app/app.component.spec.ts similarity index 100% rename from apps/comments/src/app/app.component.spec.ts rename to apps/twitch-logs/src/app/app.component.spec.ts diff --git a/apps/comments/src/app/app.component.ts b/apps/twitch-logs/src/app/app.component.ts similarity index 100% rename from apps/comments/src/app/app.component.ts rename to apps/twitch-logs/src/app/app.component.ts diff --git a/apps/comments/src/app/app.module.ts b/apps/twitch-logs/src/app/app.module.ts similarity index 100% rename from apps/comments/src/app/app.module.ts rename to apps/twitch-logs/src/app/app.module.ts diff --git a/apps/comments/src/app/comments/comments.component.css b/apps/twitch-logs/src/app/comments/comments.component.css similarity index 100% rename from apps/comments/src/app/comments/comments.component.css rename to apps/twitch-logs/src/app/comments/comments.component.css diff --git a/apps/comments/src/app/comments/comments.component.html b/apps/twitch-logs/src/app/comments/comments.component.html similarity index 100% rename from apps/comments/src/app/comments/comments.component.html rename to apps/twitch-logs/src/app/comments/comments.component.html diff --git a/apps/comments/src/app/comments/comments.component.ts b/apps/twitch-logs/src/app/comments/comments.component.ts similarity index 100% rename from apps/comments/src/app/comments/comments.component.ts rename to apps/twitch-logs/src/app/comments/comments.component.ts diff --git a/apps/comments/src/app/models/comment.ts b/apps/twitch-logs/src/app/models/comment.ts similarity index 100% rename from apps/comments/src/app/models/comment.ts rename to apps/twitch-logs/src/app/models/comment.ts diff --git a/apps/comments/src/app/models/video.ts b/apps/twitch-logs/src/app/models/video.ts similarity index 100% rename from apps/comments/src/app/models/video.ts rename to apps/twitch-logs/src/app/models/video.ts diff --git a/apps/comments/src/app/pipes/splitbadges.pipe.ts b/apps/twitch-logs/src/app/pipes/splitbadges.pipe.ts similarity index 100% rename from apps/comments/src/app/pipes/splitbadges.pipe.ts rename to apps/twitch-logs/src/app/pipes/splitbadges.pipe.ts diff --git a/apps/comments/src/app/pipes/splitmessage.pipe.ts b/apps/twitch-logs/src/app/pipes/splitmessage.pipe.ts similarity index 100% rename from apps/comments/src/app/pipes/splitmessage.pipe.ts rename to apps/twitch-logs/src/app/pipes/splitmessage.pipe.ts diff --git a/apps/comments/src/app/pipes/tohms.pipe.ts b/apps/twitch-logs/src/app/pipes/tohms.pipe.ts similarity index 100% rename from apps/comments/src/app/pipes/tohms.pipe.ts rename to apps/twitch-logs/src/app/pipes/tohms.pipe.ts diff --git a/apps/comments/src/app/services/comments.datasource.ts b/apps/twitch-logs/src/app/services/comments.datasource.ts similarity index 100% rename from apps/comments/src/app/services/comments.datasource.ts rename to apps/twitch-logs/src/app/services/comments.datasource.ts diff --git a/apps/comments/src/app/services/comments.service.ts b/apps/twitch-logs/src/app/services/comments.service.ts similarity index 92% rename from apps/comments/src/app/services/comments.service.ts rename to apps/twitch-logs/src/app/services/comments.service.ts index fff1bff..00e7203 100644 --- a/apps/comments/src/app/services/comments.service.ts +++ b/apps/twitch-logs/src/app/services/comments.service.ts @@ -21,7 +21,7 @@ export class CommentsService { filter = '', sortBy = 'recorded_at', sortOrder = 'desc', pageNumber = 0, pageSize = 20): Observable { - return this.http.get('/comments/api/videos', { + return this.http.get('/twitch-logs/api/videos', { observe: 'response', params: new HttpParams() .set('filter', filter) @@ -41,7 +41,7 @@ export class CommentsService { filter = '', sortBy = 'offset', sortOrder = 'asc', pageNumber = 0, pageSize = 20): Observable { - return this.http.get('/comments/api/videos/' + videoID + '/comments', { + return this.http.get('/twitch-logs/api/videos/' + videoID + '/comments', { observe: 'response', params: new HttpParams() .set('filter', filter) diff --git a/apps/comments/src/app/services/images.service.ts b/apps/twitch-logs/src/app/services/images.service.ts similarity index 96% rename from apps/comments/src/app/services/images.service.ts rename to apps/twitch-logs/src/app/services/images.service.ts index bfbe985..ba15d89 100644 --- a/apps/comments/src/app/services/images.service.ts +++ b/apps/twitch-logs/src/app/services/images.service.ts @@ -43,7 +43,7 @@ export class ImagesService { } getEmotes(): Observable { - return this.http.get('/comments/api/emotes').pipe( + return this.http.get('/twitch-logs/api/emotes').pipe( map((res: any[]) => { return res.map((emote: any) => ({ id: emote.id, diff --git a/apps/comments/src/app/services/videos.datasource.ts b/apps/twitch-logs/src/app/services/videos.datasource.ts similarity index 100% rename from apps/comments/src/app/services/videos.datasource.ts rename to apps/twitch-logs/src/app/services/videos.datasource.ts diff --git a/apps/comments/src/app/videos/videos.component.css b/apps/twitch-logs/src/app/videos/videos.component.css similarity index 100% rename from apps/comments/src/app/videos/videos.component.css rename to apps/twitch-logs/src/app/videos/videos.component.css diff --git a/apps/comments/src/app/videos/videos.component.html b/apps/twitch-logs/src/app/videos/videos.component.html similarity index 100% rename from apps/comments/src/app/videos/videos.component.html rename to apps/twitch-logs/src/app/videos/videos.component.html diff --git a/apps/comments/src/app/videos/videos.component.ts b/apps/twitch-logs/src/app/videos/videos.component.ts similarity index 100% rename from apps/comments/src/app/videos/videos.component.ts rename to apps/twitch-logs/src/app/videos/videos.component.ts diff --git a/apps/comments/src/assets/.gitkeep b/apps/twitch-logs/src/assets/.gitkeep similarity index 100% rename from apps/comments/src/assets/.gitkeep rename to apps/twitch-logs/src/assets/.gitkeep diff --git a/apps/comments/src/environments/environment.prod.ts b/apps/twitch-logs/src/environments/environment.prod.ts similarity index 100% rename from apps/comments/src/environments/environment.prod.ts rename to apps/twitch-logs/src/environments/environment.prod.ts diff --git a/apps/comments/src/environments/environment.ts b/apps/twitch-logs/src/environments/environment.ts similarity index 100% rename from apps/comments/src/environments/environment.ts rename to apps/twitch-logs/src/environments/environment.ts diff --git a/apps/comments/src/favicon.ico b/apps/twitch-logs/src/favicon.ico similarity index 100% rename from apps/comments/src/favicon.ico rename to apps/twitch-logs/src/favicon.ico diff --git a/apps/comments/src/index.html b/apps/twitch-logs/src/index.html similarity index 89% rename from apps/comments/src/index.html rename to apps/twitch-logs/src/index.html index f3fd8ec..7c90905 100644 --- a/apps/comments/src/index.html +++ b/apps/twitch-logs/src/index.html @@ -2,8 +2,8 @@ - Comments - + Twitch Logs + diff --git a/apps/comments/src/main.ts b/apps/twitch-logs/src/main.ts similarity index 100% rename from apps/comments/src/main.ts rename to apps/twitch-logs/src/main.ts diff --git a/apps/comments/src/polyfills.ts b/apps/twitch-logs/src/polyfills.ts similarity index 100% rename from apps/comments/src/polyfills.ts rename to apps/twitch-logs/src/polyfills.ts diff --git a/apps/comments/src/styles.css b/apps/twitch-logs/src/styles.css similarity index 100% rename from apps/comments/src/styles.css rename to apps/twitch-logs/src/styles.css diff --git a/apps/comments/src/test.ts b/apps/twitch-logs/src/test.ts similarity index 100% rename from apps/comments/src/test.ts rename to apps/twitch-logs/src/test.ts diff --git a/apps/comments/src/theme.scss b/apps/twitch-logs/src/theme.scss similarity index 100% rename from apps/comments/src/theme.scss rename to apps/twitch-logs/src/theme.scss diff --git a/apps/comments/src/tsconfig.app.json b/apps/twitch-logs/src/tsconfig.app.json similarity index 100% rename from apps/comments/src/tsconfig.app.json rename to apps/twitch-logs/src/tsconfig.app.json diff --git a/apps/comments/src/tsconfig.spec.json b/apps/twitch-logs/src/tsconfig.spec.json similarity index 100% rename from apps/comments/src/tsconfig.spec.json rename to apps/twitch-logs/src/tsconfig.spec.json diff --git a/apps/comments/src/typings.d.ts b/apps/twitch-logs/src/typings.d.ts similarity index 100% rename from apps/comments/src/typings.d.ts rename to apps/twitch-logs/src/typings.d.ts diff --git a/apps/comments/tsconfig.json b/apps/twitch-logs/tsconfig.json similarity index 100% rename from apps/comments/tsconfig.json rename to apps/twitch-logs/tsconfig.json diff --git a/apps/comments/tslint.json b/apps/twitch-logs/tslint.json similarity index 100% rename from apps/comments/tslint.json rename to apps/twitch-logs/tslint.json diff --git a/docker-compose.yaml.example b/docker-compose.yaml.example index 91d25fc..3a0e074 100644 --- a/docker-compose.yaml.example +++ b/docker-compose.yaml.example @@ -11,7 +11,7 @@ services: - 127.0.0.1:8080:80 depends_on: - quotes-api - - comments-api + - twitch-logs-api - cms # Quotes API service with /data/quotes mounted as database storage @@ -27,16 +27,16 @@ services: expose: - 5000 - # Twitch comments API service with /data/comments mounted as database storage + # Twitch logs API service with /data/twitch-logs mounted as database storage # TWITCH_CLIENT_ID, TWITCH_OAUTH_TOKEN and TWITCH_CHANNEL_ID are needed for # Twitch API access and synchronization - comments-api: + twitch-logs-api: build: - context: ./comments-api + context: ./twitch-logs-api volumes: - - /data/comments:/comments + - /data/twitch-logs:/twitch-logs environment: - - SQLALCHEMY_DATABASE_URI=sqlite:////comments/comments.db + - SQLALCHEMY_DATABASE_URI=sqlite:////twitch-logs/twitch-logs.db - TWITCH_CLIENT_ID=__TWITCH_CLIENT_ID__ - TWITCH_OAUTH_TOKEN=__TWITCH_OAUTH_TOKEN__ - TWITCH_CHANNEL_ID=__TWITCH_CHANNEL_ID__ diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 86770ea..a72bc1b 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -52,14 +52,14 @@ http { root /quotes; } - location ^~ /comments/assets/ { - root /comments; - } - location ^~ /schedule/assets/ { root /schedule; } + location ^~ /twitch-logs/assets/ { + root /twitch-logs; + } + location ^~ /quotes/api/ { rewrite ^/quotes/api(/.*)$ $1 break; proxy_set_header Host $host; @@ -69,13 +69,13 @@ http { proxy_pass http://quotes-api:5000/; } - location ^~ /comments/api/ { - rewrite ^/comments/api(/.*)$ $1 break; + location ^~ /twitch-logs/api/ { + rewrite ^/twitch-logs/api(/.*)$ $1 break; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_http_version 1.1; tcp_nodelay on; - proxy_pass http://comments-api:5000/; + proxy_pass http://twitch-logs-api:5000/; } location ~ /\.ht { diff --git a/comments-api/.gitignore b/twitch-logs-api/.gitignore similarity index 100% rename from comments-api/.gitignore rename to twitch-logs-api/.gitignore diff --git a/comments-api/Dockerfile b/twitch-logs-api/Dockerfile similarity index 100% rename from comments-api/Dockerfile rename to twitch-logs-api/Dockerfile diff --git a/comments-api/app.py b/twitch-logs-api/app.py similarity index 100% rename from comments-api/app.py rename to twitch-logs-api/app.py diff --git a/comments-api/db.py b/twitch-logs-api/db.py similarity index 100% rename from comments-api/db.py rename to twitch-logs-api/db.py diff --git a/comments-api/requirements.txt b/twitch-logs-api/requirements.txt similarity index 100% rename from comments-api/requirements.txt rename to twitch-logs-api/requirements.txt diff --git a/comments-api/sync.py b/twitch-logs-api/sync.py similarity index 100% rename from comments-api/sync.py rename to twitch-logs-api/sync.py diff --git a/comments-api/twitch.py b/twitch-logs-api/twitch.py similarity index 100% rename from comments-api/twitch.py rename to twitch-logs-api/twitch.py