Skip to content
Snippets Groups Projects
Commit 504598cd authored by Bastien DUMONT's avatar Bastien DUMONT :angel:
Browse files

chore: update getting started for ecolyo

parent ade1c803
Branches
No related tags found
1 merge request!80chore: update getting started for ecolyo
......@@ -58,12 +58,23 @@ Local database can also be consulted at the following url: [Cozy local DB](http:
Your dev stack should be running to import the mock data
:::
:::info ACH
First install ACH using yarn :
```sh
yarn global add cozy-ach
```
:::note
If you cannot execute `ACH` after this command, it may be because you do not have the directory where yarn stores its symbolic links in your `PATH`. Edit it to append the result of `yarn global bin` by executing the following command:
```sh
export PATH="$PATH:`yarn global bin`"
```
:::
Next create the "config.js" file based on the "config.template.js"
:::info You can change the period of data generated by changing the following lines:
......@@ -81,40 +92,28 @@ const endingDate = DateTime.local()
Just replace -120 by the value needed
:::
Next launch the script `createDayDataFiles.js` available into the `scripts` folder
```sh
cd scripts
node createDayDataFiles.js
```
Json files with data will be created into `scripts/data` folder.
ACH script `importData.bat` will load the content of the file into your CouchDB (database of your dev stack). Launch it using following commands:
On Windows:
Next run the command
```sh
cd scripts
./importData.bat
yarn data:seed
```
On Linux:
This script will run two others scripts :
```sh
cd scripts
./importData.sh
```
1. `yarn data:create` running `createDayDataFiles.ts`. Json files with data will be created into `scripts/data` folder.
2. `yarn data:import` running `importData.sh`. ACH will load the content of the file into your CouchDB (database of your dev stack). Launch it using following commands:
:::note
If you cannot execute `ACH` after this command, it may be because you do not have the directory where yarn stores its symbolic links in your `PATH`. Edit it to append the result of `yarn global bin` by executing the following command:
:::note On Windows:
```sh
export PATH="$PATH:`yarn global bin`"
cd scripts
./importData.bat
```
:::
You'll be prompted for a **cozysessid**, you can get it in the web console : in the `application` tab, look for the cookies and just copy the cozysessid value.
<!-- You'll be prompted for a **cozysessid**, you can get it in the web console : in the `application` tab, look for the cookies and just copy the cozysessid value. -->
A new browser windows will open and asking you approval to import data. Just click on **Approve**
......@@ -127,9 +126,8 @@ Your dev stack should be running to import data needed to simulate konnectors co
:::
When using local environment, konnectors are not able to connect as in production.
To simulate the connection you can use the script **createConnection.js** available in **scripts** folder.
First update the authorization and cookie information from the "config.js" file (if not created just create it from the "config.template.js" file):
First update the authorization and cookie information from the `config.js` file (if not created just create it from the `config.template.js` file):
```js
const authorization = 'Bearer xxxxxxxxxxx';
......@@ -140,10 +138,10 @@ To obtain your own Bearer and cozysessid you need to have the application launch
![Bearer&cozysessid](/img/bearer_cozysessid.png)
Next launch the script :
To simulate the connection you can use the following script which will run `createConnection.ts`.
```sh
node scripts/createConnections.js
yarn data:connections
```
Your data is now loaded and you can refresh the application to see your konnector connected.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment