Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove src/backend #3413

Merged
merged 3 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
TueeNguyen marked this conversation as resolved.
Show resolved Hide resolved
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing we lose by doing this is the ability to work on the front-end locally, but use the staging server as your back-end. Probably that's OK, and we should migrate to using GitPod or EC2 cloud instances instead, so you can run everything at once.

# 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}
TueeNguyen marked this conversation as resolved.
Show resolved Hide resolved
# 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:
TueeNguyen marked this conversation as resolved.
Show resolved Hide resolved
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
47 changes: 1 addition & 46 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",
TueeNguyen marked this conversation as resolved.
Show resolved Hide resolved
"lint-time": "pnpm turbo run lint-time && pnpm eslint-time",
"clean": "pnpm turbo run clean && pnpm -r exec rm -rf node_modules",
Expand All @@ -31,8 +28,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 @@ -53,46 +48,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 @@ -104,9 +62,7 @@
"@senecacdot/eslint-config-telescope": "1.1.0",
"@types/jest": "27.4.1",
"@vercel/node": "1.13.0",
"babel-preset-next": "1.4.0",
"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 @@ -121,7 +77,6 @@
"pretty-quick": "3.1.3",
"prisma": "3.12.0",
"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