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
  • Loading branch information
TueeNguyen committed Apr 7, 2022
1 parent 65c2e36 commit 9ba4e4e
Show file tree
Hide file tree
Showing 105 changed files with 2,567 additions and 9,438 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 @@ -83,7 +78,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
52 changes: 0 additions & 52 deletions Dockerfile

This file was deleted.

16 changes: 0 additions & 16 deletions config/env.development
Original file line number Diff line number Diff line change
Expand Up @@ -187,22 +187,6 @@ DEPENDENCY_DISCOVERY_URL=http://localhost/v1/dependency-discovery
# 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:
Expand Down
5 changes: 0 additions & 5 deletions config/env.production
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,6 @@ DEPENDENCY_DISCOVERY_URL=https://api.telescope.cdot.systems/v1/dependency-discov
# 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
5 changes: 0 additions & 5 deletions config/env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,6 @@ DEPENDENCY_DISCOVERY_URL=https://dev.api.telescope.cdot.systems/v1/dependency-di
# 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
2 changes: 0 additions & 2 deletions docker/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ services:
args:
# Web front-end URL
- WEB_URL=${WEB_URL}
# Telescope 1.0 API URL
- API_URL=${API_URL}
# Telescope 2.0 Microservice URLs
- IMAGE_URL=${IMAGE_URL}
- SSO_URL=${SSO_URL}
Expand Down
4 changes: 1 addition & 3 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 @@ -261,8 +261,6 @@ services:
args:
# Web front-end URL
- WEB_URL=${WEB_URL}
# Telescope 1.0 API URL
- API_URL=${API_URL}
# Telescope 2.0 Microservice URLs
- IMAGE_URL=${IMAGE_URL}
- SSO_URL=${SSO_URL}
Expand Down
64 changes: 1 addition & 63 deletions docker/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,69 +13,7 @@ version: '3'

services:
##############################################################################
# Telescope 1.0: Front-end and Legacy (pre-microservices) Back-end
##############################################################################
telescope:
build:
context: ..
dockerfile: Dockerfile
# next.js needs build-time access to a number of API URL values, forward as ARGs
args:
# Web front-end URL
- WEB_URL=${WEB_URL}
# Telescope 1.0 API URL
- API_URL=${API_URL}
# Telescope 2.0 Microservice URLs
- IMAGE_URL=${IMAGE_URL}
- SSO_URL=${SSO_URL}
- POSTS_URL=${POSTS_URL}
- SEARCH_URL=${SEARCH_URL}
- FEED_DISCOVERY_URL=${FEED_DISCOVERY_URL}
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
51 changes: 4 additions & 47 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"build": "pnpm turbo run build",
"dev": "pnpm dev --prefix src/web/app --",
"develop": "pnpm dev",
"eslint": "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",
"eslint": "TIMING=1 eslint --ignore-path .gitignore",
"eslint-fix": "eslint --ignore-path .gitignore --fix",
"lint": "pnpm turbo run lint && pnpm eslint",
"clean": "pnpm turbo run clean && pnpm -r exec rm -rf node_modules",
"prettier": "prettier --write \"./**/*.{md,jsx,json,html,css,js,yml,ts,tsx}\"",
Expand All @@ -26,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 @@ -48,46 +46,9 @@
},
"homepage": "https://github.com/Seneca-CDOT/telescope#readme",
"dependencies": {
"@bull-board/api": "3.10.2",
"@bull-board/express": "3.10.2",
"@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.8",
Expand All @@ -96,11 +57,9 @@
"@babel/preset-react": "7.16.7",
"@babel/preset-typescript": "7.16.7",
"@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 @@ -109,12 +68,10 @@
"jest-playwright-preset": "1.7.0",
"jest-runner": "27.5.1",
"nock": "13.2.4",
"npm-run-all": "4.1.5",
"playwright": "1.19.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.1.5",
Expand Down
Loading

0 comments on commit 9ba4e4e

Please sign in to comment.