mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 20:51:25 +03:00
1 line
No EOL
26 KiB
JSON
1 line
No EOL
26 KiB
JSON
{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":""},{"location":"#what-is-kekkai","title":"What is Kekkai?","text":"<p>Kekkai \u2014 The first free Open-Source Tool for Saving Historical Currency data</p> <p>It is a simple tool for collecting historical currency data from open sources, with the ability to create currency exchange rate charts.</p>"},{"location":"#why-kekkai","title":"Why Kekkai?","text":"<ul> <li>Free & Open-Source</li> <li>The ability to create graphs</li> <li>Plausible support. Anonymous data collection with the ability to disable it. Available only to server owners</li> </ul>"},{"location":"config/conf-nginx/","title":"Configure nginx.conf","text":"<p>Kekkai is used by <code>Nginx</code> to redirect to the correct microservice.</p>"},{"location":"config/conf-nginx/#change-domain","title":"Change domain","text":"<p>Change localhost to your <code>domain</code> or <code>ipv4</code> based on your needs. If you need to use Kekkai locally, you don't need to change anything,</p> Note <pre><code>...\nserver_name localhost; # Your domain\n...\n</code></pre>"},{"location":"config/conf-nginx/#change-name-for-ssl","title":"Change name for SSL","text":"<p>This is where the name of the SSL files changes. This needs to be edited if you have a different one</p> <p>Change <code>privkey.pem</code> and <code>fullchain.pem</code> to the names of the files you have.</p> Note <pre><code>...\nssl_certificate /etc/nginx/ssl/fullchain.pem;\nssl_certificate_key /etc/nginx/ssl/privkey.pem;\n...\n</code></pre>"},{"location":"config/config-env/","title":"Configure .env","text":"<p>Kekkai can be configured using the <code>.env</code> file in the working directory. <code>.env.example</code>.</p> <p><code>.env</code> config is used to configure PosgreSQL running in Docker Compose.</p> <p>Info</p> <p>If you are not using Docker Compose, you do not need to edit this config</p> Example file <code>.env.example</code> <pre><code># Connection secret for postgres. You should change it to a random password\n# Please use only the characters `A-Za-z0-9`, without special characters or spaces\n\nPOSTGRES_PASSWORD=my_password\n\n# If you do not know what you are doing, then you should not edit the values below\n###################################################################################\nPOSTGRES_DB=kekkai\nDB_HOST=postgres\nPOSTGRES_USER=postgres\n</code></pre> <p>This config only edits the password for PosgreSQL.</p> <p>Please use only the characters <code>A-Za-z0-9</code>, without special characters or spaces</p>"},{"location":"config/config-yaml/","title":"Configure config.yaml","text":"<p>Kekkai can be configured using the <code>config.yaml</code> file in the working directory. <code>config.example.yaml</code>.</p> Example file <code>config.example.yaml</code> <pre><code># For more information, see the documentation\n# https://kekkai-docs.redume.su/\n\ndatabase:\n user: 'DATABASE_USERNAME'\n password: 'DATABASE_PASSWORD'\n host: 'DATABASE_HOST'\n name: 'DATABASE_NAME'\n port: 5432\nserver:\n host: '0.0.0.0'\n ssl:\n private_key: '/CertSSL/privkey.pem'\n cert: '/CertSSL/fullchain.pem'\n work: true\n log:\n print: true\n level: 'info'\nanalytics:\n plausible_api: 'https://plausible.io/api/event/'\n plausible_domain: 'PLAUSIBLE_DOMAIN'\n plausible_token: 'PLAUSIBLE_TOKEN'\n work: true\ncurrency:\n chart:\n save: false\n collecting:\n fiat: true\n schedule: '30 8 * * *'\n fiat:\n - USD\n - RUB\n - EUR\n - UAH\n - TRY\n - KZT\n</code></pre>"},{"location":"config/config-yaml/#database","title":"Database","text":"<p>Kekkai is used as a <code>PostgreSQL</code> database.</p> <p>Info</p> <p>If you installed Kekkai via Docker Compose, then install it in the <code>database.host</code> value of <code>postgres</code>. The rest of the data does not have to be filled in. They need to be filled in <code>.env</code>.</p> <p>What should it look like: <pre><code>database:\n ...\n host: 'postgres'\n ...\n...\n</code></pre></p>"},{"location":"config/config-yaml/#server","title":"Server","text":"<p>Info</p> <p>If you installed Kekkai via Docker Compose, then changing <code>server.host</code>, <code>server.ssl</code> is not recommended.</p>"},{"location":"config/config-yaml/#ssl","title":"SSL","text":"<p>Create a folder CertSSL to store your certificates <pre><code>mkdir CertSSL\n</code></pre></p> <p>Copy your certificates to the CertSSL folder. </p> <p>It is recommended to rename the certificates to <code>privkey.pem</code> and <code>fullchain.pem</code>. If this is not possible, you need to change the SSL name in <code>nginx.conf</code> (if using Docker Compose)</p>"},{"location":"config/config-yaml/#analytics","title":"Analytics","text":"<p>Kekkai uses <code>Plausbile</code> as an analyst. Minimal data is transferred for anilithics. Such as: browser, OS, status code, url, where the user came from. Most of the data is built on User Agent. It is possible to disable analytics in Kekkai.</p> Note <pre><code>...\nanalytics:\n plausible_api: 'https://plausible.io/api/event/'\n plausible_domain: 'PLAUSIBLE_DOMAIN'\n plausible_token: 'PLAUSIBLE_TOKEN'\n work: true\n...\n</code></pre> <ul> <li><code>plausible_api</code>: This is where the Plausible instance is specified. The official instance is specified by default.</li> <li><code>plausible_domain</code>: Kekkai Instance Domain. It should be added to Plausible first, and then to the config. You can add the domain here.</li> <li><code>plausible_token</code>: Api token for authorization and sending requests. You can create it here.</li> <li><code>work</code>: Enable or disable analytics. </li> </ul>"},{"location":"config/config-yaml/#currency","title":"Currency","text":"<p><code>DuckDuckGo</code> (fiat currency collection) and <code>CoinMarketCap</code> (cryptocurrency collection) are used to collect currency rates.</p> Note <pre><code>...\ncurrency:\n chart:\n save: false # Enable or disable saving graphs to an image (Boolean)\n collecting:\n fiat: true # Turn off or turn on the collection of the fiat currency rate [Boolean]\n crypto: false\n schedule: '30 8 * * *' # Currency collection schedule in crontab format [String]\n crypto_apikey: 'APIKEY'\n fiat: # List of fiat currency to save the exchange rate [Array]\n - USD\n - RUB\n - EUR\n - UAH\n - TRY\n - KZT\n crypto:\n - ETH\n - TON\n - USDT\n</code></pre> <ul> <li><code>currency.chart.save</code>: Enable or disable saving graphs.</li> <li><code>currency.collecting</code>: Enable or disable cryptocurrency or fiat currency exchange rate collection.</li> <li><code>currency.schedule</code>: Currency collection interval (Configurable via cron. It is recommended to use crontab.guru, not supported in <code>Non-standard format</code>, like <code>@daily</code>).</li> <li><code>crypto.crypto_apiKey</code>: API-key from CoinMarketCap service</li> <li><code>currency.fiat</code>: A list of fiat currencies that will be saved to the database.</li> <li><code>currency.crypto</code>: A list of crypto currencies that will be saved to the database.</li> </ul>"},{"location":"endpoints/create-chart/","title":"Create Charts - /api/getChart","text":"<p>Creating a currency rate chart.</p>"},{"location":"endpoints/create-chart/#creating-a-graph-for-a-certain-period","title":"Creating a graph for a certain period","text":""},{"location":"endpoints/create-chart/#request","title":"Request","text":"ShellPythonNode.JS Curl <pre><code>curl --request GET \\\n--url https://kekkai-api.redume.su/api/getChart/week?from_currency=RUB&conv_currency=USD\n</code></pre> Request <pre><code>import requests\n\nres = requests.get('https://kekkai-api.redume.su/api/getChart/week', {\n 'from_currency': 'USD',\n 'conv_currency': 'RUB',\n}, timeout=3)\n\nprint(res.json())\n</code></pre> Axios <pre><code>const axios = require('axios');\n\naxios.get('https://kekkai-api.redume.su/api/getChart/week', {\n timeout: 3000,\n 'from_currency': 'USD',\n 'conv_currency': 'RUB', \n})\n .then((res) => {\n console.log(res['data']);\n })\n .catch((err) => {\n console.error(err);\n });\n</code></pre>"},{"location":"endpoints/create-chart/#query-params","title":"Query params","text":"Parameter Description <code>from_currency</code>* <code>ISO 4217</code> code of the currency from which the conversion takes place <code>conv_currency</code>* <code>ISO 4217</code> code of the currency to which the conversion is performed"},{"location":"endpoints/create-chart/#url-params","title":"URL params","text":"Parameter Description <code>period</code> Available parameters: <code>week</code>, <code>month</code>, <code>quarter</code>, <code>year</code> <p><code>*</code> - Required arguments</p>"},{"location":"endpoints/create-chart/#response","title":"Response","text":"<p>Output</p> <pre><code>{\n \"status\": 201,\n \"message\": \"http://kekkai-api.redume.su/static/charts/RUB_USD_20241108_DQVDN7.png\"\n}\n</code></pre>"},{"location":"endpoints/create-chart/#creating-a-schedule-for-specific-days","title":"Creating a schedule for specific days","text":""},{"location":"endpoints/create-chart/#request_1","title":"Request","text":"ShellPythonNode.JS Curl <pre><code>curl --request GET \\\n--url https://kekkai-api.redume.su/api/getChart/?\nfrom_currency=RUB&\nconv_currency=USD&\nstart_date=2024-10-31&\nend_date=2024-11-08\n</code></pre> Request <pre><code>import requests\n\nres = requests.get('https://kekkai-api.redume.su/api/getChart/', {\n 'from_currency': 'USD',\n 'conv_currency': 'RUB',\n 'start_date': '2024-10-31',\n 'end_date': '2024-11-08'\n}, timeout=3)\n\nprint(res.json())\n</code></pre> Axios <pre><code>const axios = require('axios');\n\naxios.get('https://kekkai-api.redume.su/api/getChart/', {\n timeout: 3000,\n 'from_currency': 'USD',\n 'conv_currency': 'RUB', \n 'start_date': '2024-10-31',\n 'end_date': '2024-11-08'\n})\n .then((res) => {\n console.log(res['data']);\n })\n .catch((err) => {\n console.error(err);\n });\n</code></pre>"},{"location":"endpoints/create-chart/#query-params_1","title":"Query params","text":"Parameter Description <code>from_currency</code>* <code>ISO 4217</code> code of the currency from which the conversion takes place <code>conv_currency</code>* <code>ISO 4217</code> code of the currency to which the conversion is performed <code>start_date</code>* Start date of the period in the format <code>YYYYY-DD-MM</code> <code>end_date</code>* Period end date in the format <code>YYYYY-DD-MM</code> <p><code>*</code> - Required arguments</p>"},{"location":"endpoints/create-chart/#response_1","title":"Response","text":"<p>Output</p> <pre><code>{\n \"status\": 400,\n \"message\": \"http://kekkai-api.redume.su/static/charts/RUB_USD_20241108_1T2RI3.png\"\n}\n</code></pre>"},{"location":"endpoints/create-chart/#what-the-name-of-the-chart-file-consists-of","title":"What the name of the chart file consists of","text":"<p>Example: <code>.../RUB_USD_20241108_DQVDN7.png</code></p> <ul> <li><code>RUB_USD</code> - Name of currencies.</li> <li><code>20241108</code> - Schedule request date in <code>YYYMMDD</code> format.</li> <li><code>DQVDN7</code> - Random file character identifier.</li> </ul> <p>All charts are in the charts folder, which is in the root directory (<code>./kekkai/chart</code>)</p>"},{"location":"endpoints/get-rate/","title":"Get currency rate - /api/getRate","text":"<p>Currencies are identified by standard three-letter <code>ISO 4217</code> currency codes.</p>"},{"location":"endpoints/get-rate/#getting-the-currency-rate-for-a-certain-day","title":"Getting the currency rate for a certain day.","text":""},{"location":"endpoints/get-rate/#request","title":"Request","text":"ShellPythonNode.JS Curl <pre><code>curl --request GET \\\n--url https://kekkai-api.redume.su/api/getRate/?from_currency=RUB&conv_currency=USD&date=2024-10-16\n</code></pre> Requests <pre><code>import requests\n\nres = requests.get('https://kekkai-api.redume.su/api/getRate/', {\n 'from_currency': 'RUB',\n 'conv_currency': 'USD',\n 'date': '2024-10-16',\n}, timeout=3)\n\nprint(res.json())\n</code></pre> Axios <pre><code>const axios = require('axios');\n\naxios.get('https://kekkai-api.redume.su/api/getRate/', {\n timeout: 3000,\n 'from_currency': 'RUB',\n 'conv_currency': 'USD',\n 'date': '2024-10-16',\n }\n)\n .then((res) => {\n console.log(JSON.stringify(res.json()));\n })\n .catch((err) => {\n console.error(err);\n });\n</code></pre>"},{"location":"endpoints/get-rate/#query-parameters","title":"Query Parameters","text":"Parameter Description <code>from_currency</code>* <code>ISO 4217</code> code of the currency from which the conversion takes place <code>conv_currency</code>* <code>ISO 4217</code> code of the currency to which the conversion is performed <code>date</code>* Currency rate date in the format <code>YYYYY-DD-MM</code> <code>conv_amount</code> Multiplier for number conversion (Optional) <p><code>*</code> - Required arguments</p>"},{"location":"endpoints/get-rate/#response","title":"Response","text":"<p>Output</p> <pre><code>[\n {\n \"from_currency\": \"RUB\",\n \"conv_currency\": \"USD\",\n \"rate\": 0.01,\n \"date\": \"2024-10-17T00:00:00.000Z\"\n }\n]\n</code></pre>"},{"location":"endpoints/get-rate/#get-currency-exchange-rate-for-a-certain-period","title":"Get currency exchange rate for a certain period","text":"<p>Getting the list of the array with currency rate for a certain period of time.</p>"},{"location":"endpoints/get-rate/#request_1","title":"Request","text":"ShellPythonNode.JS Curl <pre><code>curl --request GET \\\n--url https://kekkai-api.redume.su/api/getRate/?from_currency=RUB&conv_currency=USD&start_date=2024-10-16&end_date=2024-10-20\n</code></pre> Requests <pre><code>import requests\n\nres = requests.get('https://kekkai-api.redume.su/api/getRate/', {\n 'from_currency': 'RUB',\n 'conv_currency': 'USD',\n 'start_date': '2024-10-16',\n 'end_date': '2024-10-20',\n}, timeout=3)\n\nprint(res.json())\n</code></pre> Axios <pre><code>const axios = require('axios');\n\naxios.get('https://kekkai-api.redume.su/api/getRate/', {\n timeout: 3000,\n 'from_currency': 'RUB',\n 'conv_currency': 'USD',\n 'start_date': '2024-10-16',\n 'end_date': '2024-10-20',\n }\n)\n .then((res) => {\n console.log(res['data']);\n })\n .catch((err) => {\n console.error(err);\n });\n</code></pre>"},{"location":"endpoints/get-rate/#query-params","title":"Query params","text":"Parameter Description <code>from_currency</code>* <code>ISO 4217</code> code of the currency from which the conversion takes place <code>conv_currency</code>* <code>ISO 4217</code> code of the currency to which the conversion is performed <code>start_date</code>* Start date of the period in the format <code>YYYYY-DD-MM</code> <code>end_date</code>* Period end date in the format <code>YYYYY-DD-MM</code> <p><code>*</code> - Required arguments</p>"},{"location":"endpoints/get-rate/#response_1","title":"Response","text":"<p>Output</p> <pre><code>[\n {\n \"from_currency\": \"RUB\",\n \"conv_currency\": \"USD\",\n \"rate\": 0.01,\n \"date\": \"2024-10-17T00:00:00.000Z\"\n },\n {\n \"from_currency\": \"RUB\",\n \"conv_currency\": \"USD\",\n \"rate\": 0.01,\n \"date\": \"2024-10-18T00:00:00.000Z\"\n },\n {\n \"from_currency\": \"RUB\",\n \"conv_currency\": \"USD\",\n \"rate\": 0.01,\n \"date\": \"2024-10-19T00:00:00.000Z\"\n },\n {\n \"from_currency\": \"RUB\",\n \"conv_currency\": \"USD\",\n \"rate\": 0.01,\n \"date\": \"2024-10-20T00:00:00.000Z\"\n },\n {\n \"from_currency\": \"RUB\",\n \"conv_currency\": \"USD\",\n \"rate\": 0.01,\n \"date\": \"2024-10-21T00:00:00.000Z\"\n }\n]\n</code></pre>"},{"location":"endpoints/list-endpoints/","title":"Endpoints list","text":""},{"location":"endpoints/list-endpoints/#api-base-url","title":"API Base URL","text":"<p>All requests to our API should be directed to the URL below:</p> <pre><code>https://kekkai-api.redume.su/api/\n</code></pre>"},{"location":"endpoints/list-endpoints/#api-endpoints","title":"API Endpoints","text":"<p>Kekkai has 3 API endpoints: <code>getRate</code>, <code>getChart</code> and <code>metadata</code>. Below you will find a list of parameters that each endpoint requires and a description of what the API does.</p> Service API Endpoint Description Get Rate <code>https://kekkai-api.redume.su/api/getRate/</code> Get currency exchange rate for a specific day or period Create Chart <code>https://kekkai-api.redume.su/api/getChart/</code> Creating a chart with exchange rate Metadata <code>https://kekkai-api.redume.su/api/metadata/</code> Shows the last and first dates of currency rate collection, as well as available currencies"},{"location":"endpoints/metadata/","title":"Get Metadata - /api/metadata","text":"<p>Currencies are identified by standard three-letter <code>ISO 4217</code> currency codes.</p>"},{"location":"endpoints/metadata/#get-data-on-available-dates-and-currencies","title":"Get data on available dates and currencies.","text":""},{"location":"endpoints/metadata/#request","title":"Request","text":"ShellPythonNode.JS Curl <pre><code>curl --request GET \\\n--url https://kekkai-api.redume.su/api/metadata/\n</code></pre> Requests <pre><code>import requests\n\nres = requests.get('https://kekkai-api.redume.su/api/metadata/', timeout=3)\n\nprint(res.json())\n</code></pre> Axios <pre><code>const axios = require('axios');\n\naxios.get('https://kekkai-api.redume.su/api/metadata/')\n .then((res) => {\n console.log(JSON.stringify(res.json()));\n })\n .catch((err) => {\n console.error(err);\n });\n</code></pre>"},{"location":"endpoints/metadata/#response","title":"Response","text":"<p>Output</p> <pre><code>{\n \"first_date\": \"2024-11-26T21:00:00.000Z\",\n \"last_date\": \"2025-01-01T21:00:00.000Z\",\n \"currencies\": {\n \"crypto\": [\n \"USDT\",\n \"TON\",\n \"BTC\",\n \"ETH\"\n ],\n \"fiat\": [\n \"USD\",\n \"RUB\",\n \"EUR\",\n \"UAH\",\n \"TRY\",\n \"KZT\"\n ]\n }\n}\n</code></pre>"},{"location":"getting-started/contributing/","title":"Contributing","text":"<p>If you have any questions, you can write to the mail or Telegram</p>"},{"location":"getting-started/contributing/#fork-and-clone-your-repository","title":"Fork and clone your repository","text":"<ol> <li>Fork the repository (click here to fork now)</li> <li>Clone your forked code <pre><code>git clone https://github.com/<nickname>/Kekkai.git\n</code></pre></li> <li>Create new branch <pre><code>git branch <name_new_branch>\n</code></pre></li> <li>Switch to new branch <pre><code>git checkout <name_new_branch>\n</code></pre></li> <li>Push your commits</li> <li>Submit a new Pull Request</li> </ol>"},{"location":"getting-started/contributing/#testing","title":"Testing","text":"<p>Before sending a Pull Request, test the functionality. Everything should work both in Docker Compose and without it.</p> <p>It is recommended to use Debugger and Debug log for testing. The logging level is changed in <code>config.yaml</code></p>"},{"location":"getting-started/contributing/#code-style","title":"Code Style","text":"<p><code>Pylint</code>, <code>mypy</code>, <code>eslint</code> and <code>prettier</code> are used as code syntax checks</p>"},{"location":"getting-started/contributing/#checking-the-nodejs-code","title":"Checking the Node.JS code","text":"<p>To check the code, you must first download the necessary libraries, which are located at the root of the project <pre><code>npm install\n</code></pre></p> <p><code>eslint</code> and <code>prettier</code> is used to check and automatically correct the Node.JS code <pre><code>npx eslint .\n</code></pre> Or add the <code>--fix</code> flag to automatically fix the code</p>"},{"location":"getting-started/contributing/#checking-the-python-code","title":"Checking the Python code","text":"<p>To check code, you need to install libraries <code>mypy</code> and <code>pylint</code></p> <pre><code>python3 -m pip install -U mypy\n</code></pre> <p>and install <code>pylint</code> <pre><code>pip install pylint\n</code></pre> Start check the code</p> <p>for <code>pylint</code>: <pre><code>pylint /chart/\n</code></pre></p> <p>and for <code>mypy</code>: <pre><code>mypy /chart/ \n</code></pre></p>"},{"location":"getting-started/docker/","title":"Docker [Recommended]","text":"<p>Docker Compose is the recommended method to run Kekkai in production. Below are the steps to deploy Kekkai with Docker Compose.</p> <p>Kekkai requires Docker Compose version 2.x.</p>"},{"location":"getting-started/docker/#steps-1-preparing-files","title":"Steps 1 - Preparing files","text":"<pre><code>git clone https://github.com/Redume/Kekkai.git\n</code></pre> <pre><code>cd Kekkai\n</code></pre>"},{"location":"getting-started/docker/#steps-2-change-config-files","title":"Steps 2 - Change config files","text":"Nginx Configuration <p>In <code>nginx.conf</code>, you need to specify your domain or ipv4 address <pre><code>...\n listen 443 ssl;\n server_name localhost; # Your domain\n...\n</code></pre></p> <p>To set up SSL <pre><code>mkdir CertSLL\n</code></pre></p> <p>After that, copy the SSL certificates to the <code>CertSSL</code> folder, if the names are different, then change either the name of the certificates or in <code>nginx.conf</code></p> <pre><code>ssl_certificate /etc/nginx/ssl/fullchain.pem;\nssl_certificate_key /etc/nginx/ssl/privkey.pem;\n</code></pre> The main config is <code>config.sample.yaml</code> for Kekkai <pre><code>database: \n user: 'DATABASE_USERNAME'\n password: 'DATABASE_PASSWORD'\n host: 'DATABASE_HOST'\n name: 'DATABASE_NAME'\n port: 5432\n...\n</code></pre> <p>Fill in the data in the <code>database</code> item, as well as in the <code>.env</code> config</p> <code>.env.sample</code> config for PostgreSQL <pre><code># Connection secret for postgres. You should change it to a random password\n# Please use only the characters `A-Za-z0-9`, without special characters or spaces\n\nPOSTGRES_PASSWORD=my_password\n\n# If you do not know what you are doing, then you should not edit the values below\n###################################################################################\nPOSTGRES_DB=kekkai\nDB_HOST=postgres\nPOSTGRES_USER=postgres\n</code></pre> <ul> <li>Populate custom database information if necessary.</li> <li>Consider changing <code>DB_PASSWORD</code> to a custom value. Postgres is not publically exposed, so this password is only used for - local authentication. To avoid issues with Docker parsing this value, it is best to use only the characters <code>A-Za-z0-9</code>.</li> </ul> <p>Note</p> <p>After editing, rename the config files by removing <code>.sample</code> in the name</p>"},{"location":"getting-started/docker/#steps-3-start-the-containers","title":"Steps 3 - Start the containers","text":"Start the containers using docker compose command<pre><code>docker compose -f \"docker-compose.yaml\" up -d --build\n</code></pre>"},{"location":"getting-started/manual/","title":"Manual","text":"<p>For full use, you need to install <code>Node.JS v20</code>, <code>PostgreSQL v15</code>, <code>Python v13.3</code>, <code>Nginx</code></p>"},{"location":"getting-started/manual/#steps-1-preparing-files","title":"Steps 1 - Preparing files","text":"<pre><code>git clone https://github.com/Redume/Kekkai.git\n</code></pre> <pre><code>cd Kekkai\n</code></pre>"},{"location":"getting-started/manual/#steps-2-change-config-files","title":"Steps 2 - Change config files","text":"Nginx Configuration <p>In <code>nginx.conf</code>, you need to specify your domain or ipv4 address <pre><code> ...\n listen 443 ssl;\n server_name localhost; # Your domain\n ...\n</code></pre></p> The main config is <code>config.sample.yaml</code> for Kekkai <pre><code>database: \n user: 'DATABASE_USERNAME'\n password: 'DATABASE_PASSWORD'\n host: 'DATABASE_HOST'\n name: 'DATABASE_NAME'\n port: 5432\n...\n</code></pre> <p>Fill in the data in the <code>database</code> item, as well as in the <code>.env</code> config</p>"},{"location":"getting-started/manual/#steps-3-install-libs","title":"Steps 3 - Install libs","text":"<p>Install library. In <code>/shared/logger</code>, <code>/shared/config</code>, <code>/shared/database</code>, <code>/collect-currency</code>,<code>/server</code>, the required node.JS libraries In each of the directories, you need to write this command</p> <pre><code>npm install\n</code></pre> <p>and install python libs <pre><code>pip install -r requirements.txt\n</code></pre></p> <p>Start the nginx service <pre><code>sudo systemctl start nginx.service\n</code></pre></p>"},{"location":"getting-started/manual/#steps-4-launch-services","title":"Steps 4 - Launch Services","text":"<p>Launch each of the services There are all three services <code>MainService</code>, <code>Collect-currency</code>, <code>Chart</code></p> <ul> <li><code>MainService</code> is an API for getting the exchange rate <pre><code>cd server & node .\n</code></pre></li> <li><code>Collect-Currency</code> is a service for collecting and save the rate in a database <pre><code>cd collect-currency/src/ && node .\n</code></pre></li> <li><code>ChartService</code> is a service for creating currency rate charts <pre><code>python3 main.py\n</code></pre></li> </ul>"}]} |