Skip to content

Commit bb98712

Browse files
committed
Updated start command to start from dev, added some comments to readme.
1 parent 76e1510 commit bb98712

File tree

16 files changed

+85
-42
lines changed

16 files changed

+85
-42
lines changed

.circleci/config.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -203,20 +203,20 @@ workflows:
203203

204204
jobs:
205205

206-
- build_and_deploy_microservice_collection
207-
# filters:
208-
# branches:
209-
# only: master
210-
211-
- build_and_deploy_microservice_analysis
212-
# filters:
213-
# branches:
214-
# only: master
215-
216-
- build_and_deploy_microservice_gateway
217-
# filters:
218-
# branches:
219-
# only: master
206+
- build_and_deploy_microservice_collection:
207+
filters:
208+
branches:
209+
only: master
210+
211+
- build_and_deploy_microservice_analysis:
212+
filters:
213+
branches:
214+
only: master
215+
216+
- build_and_deploy_microservice_gateway:
217+
filters:
218+
branches:
219+
only: master
220220

221221
- build_ui
222222

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,22 @@ but it also defines how its interface is used by other microservices. This, in t
5757
service in one codebase. One benefit of that would be full-stack development can be done without making changes that collide
5858
with another teams changes. Federation, as well as schema stitching, provide mechanisms for taking a subgraph and connecting
5959
it to a full application supergraph in a seamless way. Federation uses a single gateway that provides access to the remaining
60-
services. This gateway is the publicly accessible end-point for the system of microservices and routes requests to the necessary
60+
services. This gateway is the publicly accessible end-point for the microservices and routes requests to the necessary
6161
microservice needed to gather the response. This application uses that concept because it's intended to introduce additional
6262
microservices that will perform tasks such as data fetching/collection, data cleaning as well as providing data structures for
6363
use in the front-end. Additional benefits include reducing the number of requests that need to go over the wire to gather data when
6464
compared to RESTful APIs, it's backed by facebook and is used by numerous companies and is therefore battle-tested and it's fun.
6565

66+
#### Kubernetes
67+
[Kubernetes](https://kubernetes.io/) is a container orchestration system with many powerful characteristics. It's used in this
68+
project to take advantage of self-healing, monitoring, replication and load-balancing.
69+
70+
#### Docker
71+
Docker provides containerization and is used for a couple of reasons. It allows developers to reproduce bugs that are seen in different
72+
environments such as production. It encapsulates application dependencies and configuration such that each application will run
73+
without worry about conflicting dependencies in a different application. It allows for easy backup and it takes up a much smaller
74+
footprint than virtual machines. It's also moving toward greater adoption on multiple platforms including windows and linux.
75+
6676
#### Postgres
6777
Postgres was chosen simply because I've heard good things about it and it's heavily used.
6878

@@ -96,6 +106,4 @@ with security-related development I opted to use one that was already available.
96106

97107
## Environment Variables
98108
- NODE_ENV : The environment in which the application is running (i.e, development, production)
99-
- DIGITALOCEAN_ACCESS_TOKEN : Access token for digital ocean
100-
101-
TODO: UPDATE
109+
- DIGITALOCEAN_ACCESS_TOKEN : Access token for digital ocean

packages/deep-auth-service/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"url": "git+https://github.com/ThinkDeepTech/thinkdeep.git"
1414
},
1515
"scripts": {
16-
"dev": "web-dev-server --config ./web-dev-server.config.mjs --esbuild-target auto",
17-
"dev:watch": "web-dev-server --config ./web-dev-server.config.mjs --watch --esbuild-target auto",
16+
"start": "web-dev-server --config ./web-dev-server.config.mjs --esbuild-target auto",
17+
"start:watch": "web-dev-server --config ./web-dev-server.config.mjs --watch --esbuild-target auto",
1818
"tests": "web-test-runner --config ./web-test-runner.config.mjs",
1919
"tests:watch": "web-test-runner --config ./web-test-runner.config.mjs --watch",
2020
"build": "rimraf build && rollup -c rollup.config.mjs"

packages/deep-button/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"url": "git+https://github.com/ThinkDeepTech/thinkdeep.git"
1414
},
1515
"scripts": {
16-
"dev": "web-dev-server --config ./web-dev-server.config.mjs --esbuild-target auto",
17-
"dev:watch": "web-dev-server --config ./web-dev-server.config.mjs --watch --esbuild-target auto",
16+
"start": "web-dev-server --config ./web-dev-server.config.mjs --esbuild-target auto",
17+
"start:watch": "web-dev-server --config ./web-dev-server.config.mjs --watch --esbuild-target auto",
1818
"tests": "web-test-runner --config ./web-test-runner.config.mjs",
1919
"tests:watch": "web-test-runner --config ./web-test-runner.config.mjs --watch",
2020
"build": "rimraf build && rollup -c rollup.config.mjs"

packages/deep-card/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"url": "git+https://github.com/ThinkDeepTech/thinkdeep.git"
1313
},
1414
"scripts": {
15-
"dev": "web-dev-server --config ./web-dev-server.config.mjs --esbuild-target auto",
16-
"dev:watch": "web-dev-server --config ./web-dev-server.config.mjs --watch --esbuild-target auto",
15+
"start": "web-dev-server --config ./web-dev-server.config.mjs --esbuild-target auto",
16+
"start:watch": "web-dev-server --config ./web-dev-server.config.mjs --watch --esbuild-target auto",
1717
"tests": "web-test-runner --config ./web-test-runner.config.mjs",
1818
"tests:watch": "web-test-runner --config ./web-test-runner.config.mjs --watch",
1919
"build": "rimraf build && rollup -c rollup.config.mjs"

packages/deep-footer/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"url": "git+https://github.com/ThinkDeepTech/thinkdeep.git"
1515
},
1616
"scripts": {
17-
"dev": "web-dev-server --config ./web-dev-server.config.mjs --esbuild-target auto",
18-
"dev:watch": "web-dev-server --config ./web-dev-server.config.mjs --watch --esbuild-target auto",
17+
"start": "web-dev-server --config ./web-dev-server.config.mjs --esbuild-target auto",
18+
"start:watch": "web-dev-server --config ./web-dev-server.config.mjs --watch --esbuild-target auto",
1919
"tests": "web-test-runner --config ./web-test-runner.config.mjs",
2020
"tests:watch": "web-test-runner --config ./web-test-runner.config.mjs --watch",
2121
"build": "rimraf build && rollup -c rollup.config.mjs"

packages/deep-microservice-analysis/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
1. PREDECOS_PG_CONNECTION_STRING : Ensure this is equal to the postgres connection string associated with the database.
1313
1. PREDECOS_MICROSERVICE_COLLECTION_URL
1414
1. POSTGRES_PASSWORD
15+
1. NODE_ENV
1516

1617
## Notes
1718

18-
- Running postgres on kubernetes requires passing values into envsubstr to avoid storing sensitive info in git:
19+
- Running postgres on kubernetes requires passing values into envsubstr to avoid storing sensitive info in git.
20+
Use the following command to achieve that.
1921
```console
2022

2123
envsubst < deployment.yaml | kubectl apply -f -

packages/deep-microservice-analysis/test/analysis-service.test.mjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,36 @@ describe('analysis-service', () => {
156156
expect(sentimentLib.analyze).to.have.been.called;
157157
})
158158

159+
it('should skip over entries that include a null value for tweets ', async () => {
160+
const economicEntityName = "SomeBusinessName";
161+
const economicEntityType = "BUSINESS";
162+
const user = { scope: "profile email read:all" };
163+
const tweets = [{
164+
timestamp: 1,
165+
tweets: null
166+
}];
167+
collectionBinding.query.tweets.returns(tweets);
168+
169+
const response = await subject.sentiments(economicEntityName, economicEntityType, user);
170+
171+
expect(sentimentLib.analyze).not.to.have.been.called;
172+
})
173+
174+
it('should skip over entries that include an empty tweets array ', async () => {
175+
const economicEntityName = "SomeBusinessName";
176+
const economicEntityType = "BUSINESS";
177+
const user = { scope: "profile email read:all" };
178+
const tweets = [{
179+
timestamp: 1,
180+
tweets: []
181+
}];
182+
collectionBinding.query.tweets.returns(tweets);
183+
184+
const response = await subject.sentiments(economicEntityName, economicEntityType, user);
185+
186+
expect(sentimentLib.analyze).not.to.have.been.called;
187+
})
188+
159189
});
160190

161191
describe('_averageSentiment', () => {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# `@thinkdeep/deep-microservice-collection`
22

33
## Environment Variables
4-
- PREDECOS_MONGODB_CONNECTION_STRING
4+
1. PREDECOS_MONGODB_CONNECTION_STRING
5+
1. NODE_ENV

packages/deep-microservice-collection/src/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {buildSubgraphSchema} from '@apollo/subgraph';
22
import {ApolloServer} from 'apollo-server-express';
33
import {CollectionService} from './collection-service.mjs';
4-
import {TweetStore} from './datasource/tweet-store.mjs'
4+
import {TweetStore} from './datasource/tweet-store.mjs';
55
import {TwitterAPI} from './datasource/twitter-api.mjs';
66
import express from 'express';
7-
import {getLogger} from './get-logger.mjs'
7+
import {getLogger} from './get-logger.mjs';
88
import {getPublicIP} from './get-public-ip.mjs';
99
import {loggingPlugin} from './logging-plugin.mjs';
1010
import {MongoClient} from 'mongodb';

0 commit comments

Comments
 (0)