Skip to content

Commit

Permalink
Remove backend:
Browse files Browse the repository at this point in the history
- Remove all tests from /test
- Remove src/backend
- Remove API_URL related code in front-end + other files
- Remove 'telescope' container in production.yml
- Remove backend dependencies from package.json
- Change some in config files
  • Loading branch information
TueeNguyen committed Apr 22, 2022
1 parent a7a3dd0 commit 686f723
Show file tree
Hide file tree
Showing 105 changed files with 29 additions and 7,423 deletions.
18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ on:
required: false
default: 'https://dev.telescope.cdot.systems'
type: string
api_url:
description: 'The microservice gateway URL (defaults to staging)'
required: false
default: 'https://dev.telescope.cdot.systems'
type: string
image_url:
description: 'The image microservice URL (defaults to staging)'
required: false
Expand Down Expand Up @@ -88,7 +83,6 @@ jobs:
image: nginx
build-args: |
WEB_URL=${{ inputs.web_url }}
API_URL=${{ inputs.api_url }}
IMAGE_URL=${{ inputs.image_url }}
SSO_URL=${{ inputs.sso_url }}
POSTS_URL=${{ inputs.posts_url }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
with:
deploy_tag: production
web_url: 'https://telescope.cdot.systems'
api_url: 'https://telescope.cdot.systems'
image_url: 'https://api.telescope.cdot.systems/v1/image'
sso_url: 'https://api.telescope.cdot.systems/v1/auth'
posts_url: 'https://api.telescope.cdot.systems/v1/posts'
Expand Down
2 changes: 0 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ tasks:
openMode: split-left
# Copying env.development and replacing 'localhost' with Gitpod urls
before: |
eval $(gp env -e API_URL=$(gp url 3000))
eval $(gp env -e WEB_URL=$(gp url 8000))
eval $(gp env -e API_HOST=$(gp url 8443))
eval $(gp env -e SSO_LOGIN_URL=$(gp url 8081))
Expand All @@ -15,7 +14,6 @@ tasks:
sed -r \
-e "s@(.+=)http://localhost:8000(/[^ ]*)*@\1$WEB_URL\2@g" \
-e "s@(.+=)http://localhost:3000(/[^ ]*)*@\1$API_URL\2@g" \
-e "s@(.+=)http://localhost:8081(/[^ ]*)*@\1$SSO_LOGIN_URL\2@g" \
-e "s@(.+=)http://kong:8000(/[^ ]*)*@\1$SUPABASE_API\2@g" \
-e "s@(.+=)http://localhost([^:]*)@\1$API_HOST\2@g" \
Expand Down
8 changes: 0 additions & 8 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Telescope",
"program": "${workspaceFolder}/src/backend/index.js",
"envFile": "${workspaceRoot}/.env",
"skipFiles": ["<node_internals>/**"]
},
{
"type": "node",
"request": "launch",
Expand Down
53 changes: 0 additions & 53 deletions Dockerfile

This file was deleted.

28 changes: 1 addition & 27 deletions config/env.development
Original file line number Diff line number Diff line change
Expand Up @@ -188,38 +188,12 @@ DEPENDENCY_DISCOVERY_URL=http://localhost/v1/dependency-discovery
RSS_BRIDGE_URL=http://localhost/v1/rss-bridge

################################################################################
# Telescope 1.0 Legacy Environment
# Environment
################################################################################

# NODE_ENV should be one of "development" or "production"
NODE_ENV=development

# PORT is the port used by the web server
PORT=3000

# API_URL is the URL of the Telescope Web API server. Change this to
# pick which backend server our frontend uses. If you are developing
# locally, this will be localhost:{PORT}, probably http://localhost:3000.
# Other possible values include:
#
# (local development)
# API_URL=http://localhost:3000
# (our staging server)
# API_URL=https://dev.telescope.cdot.systems
# (our production server)
# API_URL=https://telescope.cdot.systems
API_URL=http://localhost:3000

# PROXY_FRONTEND=1 will allow proxying the Next dev server (http://localhost:8000)
# through our node server (http://localhost:3000). Useful for testing locally.
# To run:
#
# 1. set PROXY_FRONTEND=1 in the .env
# 2. run the web server: `pnpm start`
# 3. run the Next dev server: `pnpm develop`
# 4. open http://localhost:3000/ and you'll get content from http://localhost:8000
PROXY_FRONTEND=

# LOG_LEVEL is used to set the level of debugging for the logs.
# info, error and debug are commonly used levels. See http://getpino.io/#/docs/api?id=level for more info on levels.
# to completely disable all logs, use silent.
Expand Down
5 changes: 0 additions & 5 deletions config/env.production
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@ RSS_BRIDGE_URL=https://api.telescope.cdot.systems/v1/rss-bridge
# NODE_ENV should be one of "development" or "production"
NODE_ENV=production

# PORT is the port used by the web server
PORT=3000

API_URL=https://telescope.cdot.systems

# LOG_LEVEL is used to set the level of debugging for the logs.
# info, error and debug are commonly used levels. See http://getpino.io/#/docs/api?id=level for more info on levels.
# to completely disable all logs, use silent.
Expand Down
7 changes: 1 addition & 6 deletions config/env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,12 @@ DEPENDENCY_DISCOVERY_URL=https://dev.api.telescope.cdot.systems/v1/dependency-di
RSS_BRIDGE_URL=https://dev.api.telescope.cdot.systems/v1/rss-bridge

################################################################################
# Telescope 1.0 Legacy Environment
# Environment
################################################################################

# NODE_ENV should be one of "development" or "production"
NODE_ENV=production

# PORT is the port used by the web server
PORT=3000

API_URL=https://dev.telescope.cdot.systems

# LOG_LEVEL is used to set the level of debugging for the logs.
# info, error and debug are commonly used levels. See http://getpino.io/#/docs/api?id=level for more info on levels.
# to completely disable all logs, use silent.
Expand Down
3 changes: 1 addition & 2 deletions docker/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ services:
cache_from:
- docker.cdot.systems/parser:buildcache
environment:
# In development and testing, the SSO service needs to contact the Supabase
# In development and testing, the Parser service needs to contact the Supabase
# service directly via Docker vs through the http://localhost/v1/supabase domain.
# Using staging database
- SUPABASE_URL=http://kong:8000
depends_on:
- elasticsearch
Expand Down
6 changes: 2 additions & 4 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: '3'

services:
##############################################################################
# Telescope 2.0 Microservices
# Telescope Microservices
##############################################################################

# status service
Expand Down Expand Up @@ -265,9 +265,7 @@ services:
# next.js needs build-time access to a number of API URL values, forward as ARGs
args:
# Web front-end URL
- WEB_URL
# Telescope 1.0 API URL
- API_URL
- WEB_URL=${WEB_URL}
# Telescope 2.0 Microservice URLs
- IMAGE_URL
- SSO_URL
Expand Down
52 changes: 1 addition & 51 deletions docker/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,57 +13,7 @@ version: '3'

services:
##############################################################################
# Telescope 1.0: Front-end and Legacy (pre-microservices) Back-end
##############################################################################
telescope:
build:
context: ..
dockerfile: Dockerfile
container_name: 'telescope'
restart: unless-stopped
environment:
# a place-holder for the variable passed by CLI with a default value
# the passed or default value is a command to run `telescope`
- script=${script:-start}
# override the .env variable for `REDIS_URL`
- REDIS_URL=redis://redis:6379
# variables for elasticsearch
- ES_HOST=elasticsearch
- ELASTIC_PORT=9200
- ELASTIC_URL=http://elasticsearch
# Environment values we expect from our legacy .env file
- NODE_ENV=production
- PORT
- POSTS_URL
- API_URL
- SSO_URL
- WEB_URL
- SEARCH_URL
- FEED_DISCOVERY_URL
- LOG_LEVEL
- FEED_URL
- FEED_URL_INTERVAL_MS
- ELASTIC_MAX_RESULTS_PER_PAGE
- ELASTIC_DELAY_MS
- SSO_LOGIN_URL
- SSO_LOGIN_CALLBACK_URL
- SLO_LOGOUT_URL
- SLO_LOGOUT_CALLBACK_URL
- SSO_IDP_PUBLIC_KEY_CERT
- SAML_ENTITY_ID
- ADMINISTRATORS
- FEED_PROCESSING_DELAY_SEC
- FEED_QUEUE_ATTEMPTS
- FEED_QUEUE_DELAY_MS
- FEED_QUEUE_PARALLEL_WORKERS
- MAX_POSTS_PER_PAGE
- GIT_COMMIT
depends_on:
- redis
- elasticsearch

##############################################################################
# Telescope 2.0 Microservices
# Telescope Microservices
##############################################################################

# status service
Expand Down
2 changes: 0 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ module.exports = {
projects: [
// Our front-end
'<rootDir>/src/web/app/jest.config.js',
// Our legacy backend tests, slowly being migrated to microservices
'<rootDir>/test/jest.config.js',
// Satellite
'<rootDir>/src/satellite/jest.config.js',
// Our current microservices, we're missing a few that needs tests still
Expand Down
50 changes: 2 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
"build": "pnpm turbo run build",
"dev": "pnpm dev --prefix src/web/app --",
"develop": "pnpm dev",
"eslint": "eslint --config .eslintrc.js --ignore-path .gitignore \"./src/backend/**/*.js\" \"./test/**/*.js\"",
"eslint-time": "TIMING=1 eslint --config .eslintrc.js --ignore-path .gitignore \"./src/backend/**/*.js\" \"./test/**/*.js\"",
"eslint-fix": "eslint --config .eslintrc.js --ignore-path .gitignore \"./src/backend/**/*.js\" \"./test/**/*.js\" --fix",
"lint": "pnpm turbo run lint && pnpm eslint",
"lint-time": "pnpm turbo run lint-time && pnpm eslint-time",
"clean": "pnpm turbo run clean && pnpm -r exec rm -rf node_modules",
Expand All @@ -29,8 +26,6 @@
"jest-watch": "jest -c jest.config.js --watch --",
"jest-update": "jest -c jest.config.js --updateSnapshot --",
"jest:e2e-watch": "jest -c jest.config.e2e.js --watch --",
"start": "node src/backend",
"server": "node src/backend/web/server",
"test-ci": "run-s prettier-check test",
"pre-commit": "pretty-quick --staged",
"preversion": "node tools/collect-dependencies.js -- -o src/api/dependency-discovery/deps.txt && git add src/api/dependency-discovery/deps.txt",
Expand All @@ -51,46 +46,9 @@
},
"homepage": "https://github.com/Seneca-CDOT/telescope#readme",
"dependencies": {
"@bull-board/api": "3.10.4",
"@bull-board/express": "3.10.4",
"@elastic/elasticsearch": "7.16.0",
"@elastic/elasticsearch-mock": "0.3.1",
"@wordpress/wordcount": "2.15.2",
"babel-jest": "27.5.1",
"bull": "3.29.3",
"clean-whitespace": "0.1.2",
"connect-redis": "6.1.3",
"cors": "2.8.5",
"date-fns": "2.28.0",
"docker-compose": "0.23.17",
"dotenv": "10.0.0",
"entities": "3.0.1",
"express": "4.17.3",
"express-healthcheck": "0.1.0",
"express-session": "1.17.2",
"express-validator": "6.14.0",
"feed": "4.2.2",
"helmet": "4.6.0",
"highlight.js": "11.4.0",
"http-proxy-middleware": "2.0.4",
"ioredis": "4.28.5",
"ioredis-mock": "5.9.1",
"jsdom": "18.1.1",
"linkify-html": "3.0.5",
"linkifyjs": "3.0.5",
"node-fetch": "2.6.7",
"normalize-url": "6.1.0",
"opml-generator": "1.1.1",
"passport": "0.5.2",
"passport-saml": "3.2.1",
"pino": "7.8.0",
"pino-elasticsearch": "6.2.0",
"pino-http": "6.6.0",
"pino-pretty": "7.5.3",
"rss-parser": "3.12.0",
"sanitize-html": "2.6.1",
"set-interval-async": "2.0.3",
"stoppable": "1.1.0"
"dotenv": "10.0.0"
},
"devDependencies": {
"@babel/core": "7.17.9",
Expand All @@ -100,11 +58,9 @@
"@babel/preset-typescript": "7.16.7",
"@parcel/packager-ts": "2.4.1",
"@senecacdot/eslint-config-telescope": "1.1.0",
"@types/jest": "27.4.1",
"@vercel/node": "1.13.0",
"babel-preset-next": "1.4.0",
"@types/jest": "27.4.1",
"eslint": "7.32.0",
"fast-xml-parser": "3.21.1",
"husky": "7.0.4",
"jest": "27.5.1",
"jest-circus": "27.5.1",
Expand All @@ -113,12 +69,10 @@
"jest-playwright-preset": "1.7.0",
"jest-runner": "27.5.1",
"nock": "13.2.4",
"npm-run-all": "4.1.5",
"playwright": "1.20.2",
"prettier": "2.5.1",
"pretty-quick": "3.1.3",
"redis-commands": "1.7.0",
"run.env": "1.1.0",
"supertest": "6.1.6",
"ts-jest": "27.1.3",
"turbo": "1.2.2",
Expand Down
Loading

0 comments on commit 686f723

Please sign in to comment.