|
1 | 1 | # app
|
2 |
| -- This is a component that connects to different git-platforms and push-pull repositories. |
3 |
| -- This also uses Cassandra or SQLite (based on configuration) databases to persist projects, git platforms, and users related details. |
| 2 | + |
| 3 | +- This is a component that connects to different git-platforms and push-pull repositories. |
| 4 | +- This also uses Cassandra or SQLite (based on configuration) databases to persist projects, git platforms, and users |
| 5 | + related details. |
4 | 6 | - It's an Express.js based REST server and gRPC client to a core component.
|
5 |
| -- The sqlite is used as a database for development. To use cassandra, you need to set the following environment variables in your terminal along with a `environment DB_TYPE='cassandra'`. |
| 7 | +- The sqlite is used as a database for development. To use cassandra, you need to set the following environment |
| 8 | + variables in your terminal along with a `environment DB_TYPE='cassandra'`. |
| 9 | + |
| 10 | +#### Use cassandra as a database |
| 11 | + |
6 | 12 | ```bash
|
7 |
| - export CASSANDRA_CONTACT_POINTS = 'localhost'; |
8 |
| - export CASSANDRA_LOCAL_DATA_CENTER = 'datacenter1'; |
9 |
| - export CASSANDRA_KEYSPACE = 'compage'; |
10 |
| - export CASSANDRA_USERNAME = 'cassandra'; |
11 |
| - export CASSANDRA_PASSWORD = 'cassandra'; |
| 13 | +export DB_TYPE='cassandra'; |
| 14 | +export CASSANDRA_CONTACT_POINTS = 'localhost'; |
| 15 | +export CASSANDRA_LOCAL_DATA_CENTER = 'datacenter1'; |
| 16 | +export CASSANDRA_KEYSPACE = 'compage'; |
| 17 | +export CASSANDRA_USERNAME = 'cassandra'; |
| 18 | +export CASSANDRA_PASSWORD = 'cassandra'; |
| 19 | +``` |
| 20 | + |
| 21 | +- To start the cassandra server on local, you can fire command `docker-compose up -d` from the setup directory of |
| 22 | + compage/app. |
| 23 | + |
| 24 | +#### Use SQLite as a database |
| 25 | + |
| 26 | +```shell |
| 27 | +export DB_TYPE='sqlite' |
12 | 28 | ```
|
13 |
| -- To start the cassandra server on local, you can fire command `docker-compose up -d` from the setup directory of compage/app. |
14 | 29 |
|
15 | 30 | #### How to run this component?
|
| 31 | + |
16 | 32 | - Navigate to app directory [`cd app`] from root directory of compage
|
17 | 33 | - Fire `npm install` to install the dependencies
|
18 |
| -- Run `npm run dev` command to start the express-server. This command will auto-reload the changes you make to app directory. |
| 34 | +- Run `npm run dev` command to start the express-server. This command will auto-reload the changes you make to app |
| 35 | + directory. |
19 | 36 | - If something goes wrong, you want to kill the process on port 5000, run the following command
|
20 |
| -```sudo kill -9 `sudo lsof -t -i:5000``` |
| 37 | + ```sudo kill -9 `sudo lsof -t -i:5000``` |
0 commit comments