|
2 | 2 |
|
3 | 3 | On the backend (aka. the server-side), CodeStream runs a number of services to |
4 | 4 | provide all the functionality needed for the clients. The default development |
5 | | -environment will use the codestream broadcaster and rabbitMQ with outbound mail |
| 5 | +environment will use the codestream broadcaster with outbound mail |
6 | 6 | disabled. |
7 | 7 |
|
8 | | -## Development Setup with the devtools Framework |
| 8 | +## Development Setup with docker-compose |
9 | 9 |
|
10 | | -_Note: CodeStream employees should use the dev_tools sandbox as it will provide |
11 | | -most of the ancillary resources you'll need, most notably our development |
12 | | -configuration which includes secrets for pubnub, integration providers, etc... |
13 | | -Details [here](docs/codestream-sandbox-setup.md). Supplemental documentation is |
14 | | -[here](docs/README.md)._ |
| 10 | +## Development Setup |
15 | 11 |
|
16 | | -For everyone else, read on... |
17 | | - |
18 | | -## Development Setup without the devtools Framework |
19 | 12 | ### Prerequisites |
20 | 13 |
|
21 | 14 | 1. Mac or Linux computer using zsh or bash. |
22 | 15 |
|
23 | | -1. Official CodeStream builds (CI) use Nodejs 16.13.2 with npm 8.1.2 |
24 | | - |
25 | 16 | 1. [Docker Desktop](https://www.docker.com/products/docker-desktop) which we'll |
26 | | - use to provide MongoDB and a pre-configured RabbitMQ. |
27 | | - |
28 | | -If you do not wish to use docker, you'll need to provide both of these services: |
| 17 | + use to provide MongoDB. |
29 | 18 |
|
30 | | -1. MongoDB 3.4.9 with `mongodb://localhost/codestream` providing full access to |
31 | | - create collections and indexes in the `codestream` database. If you're |
32 | | - willing to run docker, the instructions below will show you how to install a |
33 | | - MongoDB docker container. |
| 19 | +### Installation |
34 | 20 |
|
35 | | -1. RabbitMQ 3.7.x with the delayed message exchange plugin. You'll also need to |
36 | | - create a codestream user with access. [Notes here](api_server/docs/rabbitmq.md). |
| 21 | +For local development we use docker compose to only run mongodb. You will need to run the |
| 22 | +api-server locally via your IDE or command line. |
37 | 23 |
|
38 | | -### Installation |
| 24 | +1. Clone and setup [faker-service-gateway](https://source.datanerd.us/codestream/faker-service-gateway). Faker service gateway will handle SSL and proxy requests to the api-server. |
39 | 25 |
|
40 | | -1. Fork the |
41 | | - [codestream-server](https://github.com/teamcodestream/codestream-server) repo |
42 | | - and clone it. |
| 26 | +1. Clone the [codestream-server](https://github.com/teamcodestream/codestream-server) repo. |
43 | 27 |
|
44 | | -1. Setup your shell's environment |
| 28 | +1. Start up the docker container for MongoDB via docker compose. |
45 | 29 | ``` |
46 | | - cd codestream-server |
47 | | - source dev-env.sh # custom settings go in .sandbox-config.sh |
| 30 | + docker compose up mongodb -d |
48 | 31 | ``` |
49 | | - |
50 | | -1. Install all the node modules |
| 32 | +1. Install dependencies |
51 | 33 | ``` |
52 | 34 | npm run install:all |
53 | 35 | ``` |
54 | 36 |
|
55 | | -1. Install the rabbitmq docker container pre-configured for codestream (the |
56 | | - container name will be csrabbitmq) |
57 | | - ``` |
58 | | - npm run run:docker:csrabbitmq |
59 | | - ``` |
| 37 | +1. Make sure you are authenticated with vault!, i.e. |
| 38 | + |
| 39 | + `newrelic-vault us login -method=okta username=<username> totp=<otp>` |
60 | 40 |
|
61 | | -1. Create a docker volume for mongo and launch the mongodb docker container. |
62 | | - The docker volume will ensure the data persists beyond the lifespan of the |
63 | | - container. |
64 | | - ``` |
65 | | - npm run run:docker:csmongo |
66 | | - ``` |
| 41 | +### Method 1 - launch from shell |
67 | 42 |
|
68 | | -1. In a separate shell, source in the `dev-env.sh` environment and start up the |
69 | | - api service. It will repeatedly try to connect to the broadcaster. That's ok. |
70 | | - Move on once you've started it. |
| 43 | +1. Source the secrets into your current shell |
71 | 44 | ``` |
72 | | - source dev-env.sh |
73 | | - npm run start:api |
| 45 | + . ./devSecrets.sh |
74 | 46 | ``` |
75 | 47 |
|
76 | | -1. In a another separate shell, source in the `dev-env.sh` environment and start |
77 | | - up the broadcaster service. |
| 48 | +1. Setup and start up the api-server without docker |
78 | 49 | ``` |
79 | | - source dev-env.sh |
80 | | - npm run start:broadcaster |
| 50 | + ./start-api-server.sh |
81 | 51 | ``` |
82 | 52 |
|
83 | | -1. In yet another shell, source in the `dev-env.sh` environment and start the |
84 | | - onprem admin UI. This will first run webpack to build **public/bundle.js** |
85 | | - (which contains the client-side code). |
86 | | - ``` |
87 | | - source dev-env.sh |
88 | | - npm run start:opadm |
89 | | - ``` |
90 | | - If your intention is to work on the admin_server, you'll want another shell |
91 | | - to run `npm run dev` which will run webpack in watch mode to keep bundle.js |
92 | | - updated WRT client-side code which is stored in **src/**. |
| 53 | +### Method 2 - launch from IDE |
93 | 54 |
|
94 | | -1. The inbound email service is disabled in the default config. |
| 55 | +1. Run the `api_server.js local` run config from vscode or jetbrains |
| 56 | + |
| 57 | +Point your CodeStream extension to https://localhost.newrelic.com:12079. You should be |
| 58 | +able to login and see o11y. |
| 59 | + |
| 60 | +Develop to your heart's content!!!! We _love_ pull-requests. |
| 61 | + |
| 62 | +## Run everything in docker |
| 63 | + |
| 64 | +If you want to just run the api_server locally with fewer commands. |
| 65 | + |
| 66 | +1. Make sure you are logged into vault |
| 67 | + |
| 68 | +1. Source the secrets into your current shell |
95 | 69 | ``` |
96 | | - source dev-env.sh |
97 | | - npm run start:mailin |
| 70 | + . ./devSecrets.sh |
98 | 71 | ``` |
99 | | - |
100 | | -1. The outbound email service is also disabled in the default config. |
| 72 | +1. Start docker compose |
101 | 73 | ``` |
102 | | - source dev-env.sh |
103 | | - npm run start:mailout |
| 74 | + docker compose up |
104 | 75 | ``` |
105 | | - |
106 | | -Point your CodeStream extension to http://localhost:12000. You should be able to |
107 | | -register and create codemarks. The onprem admin console is at http://localhost:12002 |
108 | | - |
109 | | -Develop to your heart's content!!!! We _love_ pull-requests. |
0 commit comments