From f72a9cc6dea1106abfc51408b8549580782b73f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Sun, 24 Jun 2018 14:10:53 +0200 Subject: [PATCH] Rename comments to twitch-logs --- Dockerfile | 22 +++++++++--------- .../.angular-cli.json | 2 +- apps/{comments => twitch-logs}/.editorconfig | 0 apps/{comments => twitch-logs}/.gitignore | 0 apps/{comments => twitch-logs}/README.md | 0 .../e2e/app.e2e-spec.ts | 0 apps/{comments => twitch-logs}/e2e/app.po.ts | 0 .../e2e/tsconfig.e2e.json | 0 apps/{comments => twitch-logs}/karma.conf.js | 0 .../package-lock.json | 0 apps/{comments => twitch-logs}/package.json | 0 .../protractor.conf.js | 0 .../src/app/app.component.css | 0 .../src/app/app.component.html | 0 .../src/app/app.component.spec.ts | 0 .../src/app/app.component.ts | 0 .../src/app/app.module.ts | 0 .../src/app/comments/comments.component.css | 0 .../src/app/comments/comments.component.html | 0 .../src/app/comments/comments.component.ts | 0 .../src/app/models/comment.ts | 0 .../src/app/models/video.ts | 0 .../src/app/pipes/splitbadges.pipe.ts | 0 .../src/app/pipes/splitmessage.pipe.ts | 0 .../src/app/pipes/tohms.pipe.ts | 0 .../src/app/services/comments.datasource.ts | 0 .../src/app/services/comments.service.ts | 4 ++-- .../src/app/services/images.service.ts | 2 +- .../src/app/services/videos.datasource.ts | 0 .../src/app/videos/videos.component.css | 0 .../src/app/videos/videos.component.html | 0 .../src/app/videos/videos.component.ts | 0 .../src/assets/.gitkeep | 0 .../src/environments/environment.prod.ts | 0 .../src/environments/environment.ts | 0 .../{comments => twitch-logs}/src/favicon.ico | Bin apps/{comments => twitch-logs}/src/index.html | 4 ++-- apps/{comments => twitch-logs}/src/main.ts | 0 .../src/polyfills.ts | 0 apps/{comments => twitch-logs}/src/styles.css | 0 apps/{comments => twitch-logs}/src/test.ts | 0 apps/{comments => twitch-logs}/src/theme.scss | 0 .../src/tsconfig.app.json | 0 .../src/tsconfig.spec.json | 0 .../src/typings.d.ts | 0 apps/{comments => twitch-logs}/tsconfig.json | 0 apps/{comments => twitch-logs}/tslint.json | 0 docker-compose.yaml.example | 12 +++++----- nginx/nginx.conf | 14 +++++------ {comments-api => twitch-logs-api}/.gitignore | 0 {comments-api => twitch-logs-api}/Dockerfile | 0 {comments-api => twitch-logs-api}/app.py | 0 {comments-api => twitch-logs-api}/db.py | 0 .../requirements.txt | 0 {comments-api => twitch-logs-api}/sync.py | 0 {comments-api => twitch-logs-api}/twitch.py | 0 56 files changed, 30 insertions(+), 30 deletions(-) rename apps/{comments => twitch-logs}/.angular-cli.json (97%) rename apps/{comments => twitch-logs}/.editorconfig (100%) rename apps/{comments => twitch-logs}/.gitignore (100%) rename apps/{comments => twitch-logs}/README.md (100%) rename apps/{comments => twitch-logs}/e2e/app.e2e-spec.ts (100%) rename apps/{comments => twitch-logs}/e2e/app.po.ts (100%) rename apps/{comments => twitch-logs}/e2e/tsconfig.e2e.json (100%) rename apps/{comments => twitch-logs}/karma.conf.js (100%) rename apps/{comments => twitch-logs}/package-lock.json (100%) rename apps/{comments => twitch-logs}/package.json (100%) rename apps/{comments => twitch-logs}/protractor.conf.js (100%) rename apps/{comments => twitch-logs}/src/app/app.component.css (100%) rename apps/{comments => twitch-logs}/src/app/app.component.html (100%) rename apps/{comments => twitch-logs}/src/app/app.component.spec.ts (100%) rename apps/{comments => twitch-logs}/src/app/app.component.ts (100%) rename apps/{comments => twitch-logs}/src/app/app.module.ts (100%) rename apps/{comments => twitch-logs}/src/app/comments/comments.component.css (100%) rename apps/{comments => twitch-logs}/src/app/comments/comments.component.html (100%) rename apps/{comments => twitch-logs}/src/app/comments/comments.component.ts (100%) rename apps/{comments => twitch-logs}/src/app/models/comment.ts (100%) rename apps/{comments => twitch-logs}/src/app/models/video.ts (100%) rename apps/{comments => twitch-logs}/src/app/pipes/splitbadges.pipe.ts (100%) rename apps/{comments => twitch-logs}/src/app/pipes/splitmessage.pipe.ts (100%) rename apps/{comments => twitch-logs}/src/app/pipes/tohms.pipe.ts (100%) rename apps/{comments => twitch-logs}/src/app/services/comments.datasource.ts (100%) rename apps/{comments => twitch-logs}/src/app/services/comments.service.ts (92%) rename apps/{comments => twitch-logs}/src/app/services/images.service.ts (96%) rename apps/{comments => twitch-logs}/src/app/services/videos.datasource.ts (100%) rename apps/{comments => twitch-logs}/src/app/videos/videos.component.css (100%) rename apps/{comments => twitch-logs}/src/app/videos/videos.component.html (100%) rename apps/{comments => twitch-logs}/src/app/videos/videos.component.ts (100%) rename apps/{comments => twitch-logs}/src/assets/.gitkeep (100%) rename apps/{comments => twitch-logs}/src/environments/environment.prod.ts (100%) rename apps/{comments => twitch-logs}/src/environments/environment.ts (100%) rename apps/{comments => twitch-logs}/src/favicon.ico (100%) rename apps/{comments => twitch-logs}/src/index.html (89%) rename apps/{comments => twitch-logs}/src/main.ts (100%) rename apps/{comments => twitch-logs}/src/polyfills.ts (100%) rename apps/{comments => twitch-logs}/src/styles.css (100%) rename apps/{comments => twitch-logs}/src/test.ts (100%) rename apps/{comments => twitch-logs}/src/theme.scss (100%) rename apps/{comments => twitch-logs}/src/tsconfig.app.json (100%) rename apps/{comments => twitch-logs}/src/tsconfig.spec.json (100%) rename apps/{comments => twitch-logs}/src/typings.d.ts (100%) rename apps/{comments => twitch-logs}/tsconfig.json (100%) rename apps/{comments => twitch-logs}/tslint.json (100%) rename {comments-api => twitch-logs-api}/.gitignore (100%) rename {comments-api => twitch-logs-api}/Dockerfile (100%) rename {comments-api => twitch-logs-api}/app.py (100%) rename {comments-api => twitch-logs-api}/db.py (100%) rename {comments-api => twitch-logs-api}/requirements.txt (100%) rename {comments-api => twitch-logs-api}/sync.py (100%) rename {comments-api => twitch-logs-api}/twitch.py (100%) 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