text: import{o as e,c as s,a as n}from"./app.8a3bec25.js";const a='{"title":"Getting started","description":"","frontmatter":{},"headers":[{"level":2,"title":"Very quick start","slug":"very-quick-start"},{"level":2,"title":"Quick start","slug":"quick-start"},{"level":3,"title":"Environment variables","slug":"environment-variables"},{"level":2,"title":"Running the system locally (not in Docker)","slug":"running-the-system-locally-not-in-docker"}],"relativePath":"start.md","lastUpdated":1630583488498}',r={},t=[n('<h1 id="getting-started" tabindex="-1">Getting started <a class="header-anchor" href="#getting-started" aria-hidden="true">#</a></h1><h2 id="very-quick-start" tabindex="-1">Very quick start <a class="header-anchor" href="#very-quick-start" aria-hidden="true">#</a></h2><div class="danger custom-block"><p class="custom-block-title">WARNING</p><p>Use this procedure for testing purposes only, never in production.</p></div><p>Prerequisites: You have <a href="https://docs.docker.com/get-docker/" target="_blank" rel="noopener noreferrer">Docker</a>, <a href="https://docs.docker.com/compose/install/" target="_blank" rel="noopener noreferrer">Docker Compose</a> and <a href="https://nodejs.org/en/download/" target="_blank" rel="noopener noreferrer">Node.js</a> installed. The system has been tested on Windows 10 and Linux (Centos 6).</p><ol><li><p>Clone the GitHub repository and change in the root folder.</p></li><li><p>Create an <code>.env</code> file.</p><p><code>cp server/.env.example server/.env</code></p></li><li><p>Build and launch the system in Docker. Depending on your hardware and the speed of your Internet connection, this step can take a long time.</p><p><code>npm run docker</code></p></li><li><p>Navigate to the address <a href="http://localhost:8080/" target="_blank" rel="noopener noreferrer"><code>http://localhost:8080/</code></a> in your browser.</p></li></ol><h2 id="quick-start" tabindex="-1">Quick start <a class="header-anchor" href="#quick-start" aria-hidden="true">#</a></h2><p>After step 2 from above configure the environment variables. Then proceed as above.</p><h3 id="environment-variables" tabindex="-1">Environment variables <a class="header-anchor" href="#environment-variables" aria-hidden="true">#</a></h3><p>The system can be configured via several environment variables. The value of these environment variables is read from the <code>.env</code> file.</p><p>There is no <code>.env</code> file in the Git repository, only the example file <code>.env.example</code>. Copy this example file to <code>.env</code> and adapt the values of the environment variables to your needs.</p><p>Here is the content of the file <code>.env.example</code>:</p><div class="language-shell line-numbers-mode"><pre><code><span class="token assign-left variable">NODE_ENV</span><span class="token operator">=</span>development\n\n<span class="token comment"># Postgres</span>\n<span class="token assign-left variable">POSTGRES_HOST</span><span class="token operator">=</span>postgres\n<span class="token assign-left variable">POSTGRES_ON_LOCALHOST</span><span class="token operator">=</span>true\n<span class="token assign-left variable">POSTGRES_DB</span><span class="token operator">=</span>postgres\n<span class="token assign-left variable">POSTGRES_USER</span><span class="token operator">=</span>postgres\n<span class="token assign-left variable">POSTGRES_PASSWORD</span><span class="token operator">=</span>postgres\n<span class="token assign-left variable">POSTGRES_PORT</span><span class="token operator">=</span><span class="token number">5432</span>\n\n<span class="token comment"># pgAdmin</span>\n<span class="token assign-left variable">PGADMIN_DEFAULT_EMAIL</span><span class="token operator">=</span>pga@doatask.org\n<span class="token assign-left variable">PGADMIN_DEFAULT_PASSWORD</span><span class="token operator">=</span>pga\n<span class="token assign-left variable">PGADMIN_PORT</span><span class="token operator">=</span><span class="token number">5555</span>\n\n<span class="token comment"># Nest</span>\n<span class="token assign-left variable">NEST_DB_NAME</span><span class="token operator">=</span>doatask\n<span class="token assign-left variable">NEST_DB_USER</span><span class="token operator">=</span>nest\n<span class="token assign-left variable">NEST_DB_PASSWORD</span><span class="token operator">=</span>nest\n<span class="token assign-left variable">NEST_PORT</span><span class="token operator">=</span><span class="token number">8080</span>\n\n<span class="token comment"># App</span>\n<span class="token assign-left variable">APP_ADMIN_USER</span><span class="token operator">=</span>admin\n<span class="token assign-left variable">APP_ADMIN_PASSWORD</span><span class="token operator">=</span>admin\n<span class="token assign-left variable">APP_JWT_SECRET</span><span class="token operator">=</span>jwtsecret\n\n<span class="token comment"># LTI</span>\n<span class="token assign-left variable">LTI_DB_NAME</span><span class="token operator">=</span>lti\n<span class="token assign-left variable">LTI_DB_USER</span><span class="token operator">=</span>lti\n<span class="token assign-left variable">LTI_DB_PASSWORD</span><span class="token operator">=</span>lti\n\n<span class="token assign-left variable">LTI_KEY</span><span class="token operator">=</span>Secret_Key\n<span class="token assign-left variable">LTI_REDIRECT_URL</span><span class="token operator">=</span>http://localhost:3000\n</code></pre><div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br></div></div><p>To make the system secure, be sure to change all passwords and the value of the <code>APP_JWT_SECRET</code> and <code>LTI_KEY</code> variables.</p><p>When you start the system in Docker for the first time, the required databases are automatically created in PostgreSQL. Furthermore, an admin user is created. The name and password of this user are set by the <code>APP_ADMIN_USER</code> and <code>APP_ADMIN_PASSWORD</code> environment variables.</p><h2 id="running-the-system-locally-not-in-docker" tabindex="-1">Running the system locally (not in Docker) <a class="header-anchor" href="#running-the-system-locally-not-in-docker" aria-hidden="true">#</a></h2><p>For your convenience, PostgreSQL is deployed with the required databases via Docker. To start the PostgreSQL instance, use</p><div class="language-"><pre><code>npm run start:pg\n</code></pre><div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>Then install the required node modules with</p><div class="language-"><pre><code>npm run install:client\nnpm run install:server\n</code></pre><div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>or both together with just</p><div class="language-"><pre><code>npm run install\n</code></pre><div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>Now you can start the client and the server in dev mode by</p><div class="language-"><pre><code>npm run start:dev\n</code></pre><div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>To build the system, run</p><div class="language-"><pre><code>npm run build\n</code></pre><div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>This command builds the client and the server and copies the built client files to the client directory of the server.</p><p>Then you can start the system with</p><div class="language-"><pre><code>npm run start:dev\n</code></pre><div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div>',28)];r.render=function(n,a,r,l,p,o){return e(),s("div",null,t)};export{a as __pageData,r as default};
  