<h1>Installation<aclass="headerlink"href="#installation"title="Permalink to this headline">¶</a></h1>
<p>This application is written in Python (API) and Javascript (client):</p>
<ulclass="simple">
<li><dlclass="simple">
<dt>API:</dt><dd><ul>
<li><p>Flask</p></li>
<li><p><aclass="reference external"href="https://github.com/tkrajina/gpxpy">gpxpy</a> to parse gpx files</p></li>
<li><p><aclass="reference external"href="https://github.com/komoot/staticmap">staticmap</a> to generate a static map image from gpx coordinates</p></li>
<li><p><aclass="reference external"href="https://github.com/ZeevG/python-forecast.io">python-forecast.io</a> to fetch weather data from <aclass="reference external"href="https://darksky.net">Dark Sky</a> (former forecast.io)</p></li>
</ul>
</dd>
</dl>
</li>
<li><dlclass="simple">
<dt>Client:</dt><dd><ul>
<li><p>React/Redux</p></li>
<li><p><aclass="reference external"href="https://leafletjs.com/">Leaflet</a> to display map</p></li>
<li><p><aclass="reference external"href="https://github.com/recharts/recharts">Recharts</a> to display charts with elevation and speed</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
<p>Sports and weather icons are made by <aclass="reference external"href="https://www.freepik.com/">Freepik</a> from <aclass="reference external"href="https://www.flaticon.com/">www.flaticon.com</a>.</p>
<divclass="section"id="prerequisites">
<h2>Prerequisites<aclass="headerlink"href="#prerequisites"title="Permalink to this headline">¶</a></h2>
<li><p>Update <strong>Makefile.config</strong> file if needed and copy/paste the
<strong>ThunderForest</strong> and <strong>Dark Sky</strong> API keys value in
<strong>Makefile.custom.config</strong> file (see <aclass="reference external"href="installation.html#environment-variables">Environment variables</a>).</p></li>
<li><p>Install Python virtualenv, React and all related packages and
initialize the database:</p></li>
</ul>
<divclass="highlight-bash notranslate"><divclass="highlight"><pre><span></span>$ make install-dev
$ make install-db
</pre></div>
</div>
<ulclass="simple">
<li><p>Start the server and the client:</p></li>
</ul>
<divclass="highlight-bash notranslate"><divclass="highlight"><pre><span></span>$ make serve
</pre></div>
</div>
<p>Open <aclass="reference external"href="http://localhost:3000">http://localhost:3000</a> and login (the email is <codeclass="docutils literal notranslate"><spanclass="pre">admin@example.com</span></code>
and the password <codeclass="docutils literal notranslate"><spanclass="pre">mpwoadmin</span></code>) or register</p>
</div>
<divclass="section"id="prod-environment">
<h3>Prod environment<aclass="headerlink"href="#prod-environment"title="Permalink to this headline">¶</a></h3>
<divclass="admonition warning">
<pclass="admonition-title">Warning</p>
<p>Note that FitTrackee is not production-ready yet</p>
</div>
<ulclass="simple">
<li><p>Download the last release (for now, it is the beta release v0.2.5):</p></li>
<li><p>Update <strong>Makefile.config</strong> file if needed and copy/paste the
<strong>ThunderForest</strong> and <strong>Dark Sky</strong> API keys value in
<strong>Makefile.custom.config</strong> file (see <aclass="reference external"href="installation.html#environment-variables">Environment variables</a>).</p></li>
<li><p>Install Python virtualenv, React and all related packages and
initialize the database:</p></li>
</ul>
<divclass="highlight-bash notranslate"><divclass="highlight"><pre><span></span>$ make install
$ make install-db
</pre></div>
</div>
<ulclass="simple">
<li><p>Build the client:</p></li>
</ul>
<divclass="highlight-bash notranslate"><divclass="highlight"><pre><span></span>$ make build-client
</pre></div>
</div>
<ulclass="simple">
<li><p>Start the server and the client:</p></li>
</ul>
<divclass="highlight-bash notranslate"><divclass="highlight"><pre><span></span>$ make run
</pre></div>
</div>
<p>Open <aclass="reference external"href="http://localhost:3000">http://localhost:3000</a>, log in as admin (the email is
<codeclass="docutils literal notranslate"><spanclass="pre">admin@example.com</span></code> and the password <codeclass="docutils literal notranslate"><spanclass="pre">mpwoadmin</span></code>) and change the
password</p>
</div>
</div>
<divclass="section"id="upgrade">
<h2>Upgrade<aclass="headerlink"href="#upgrade"title="Permalink to this headline">¶</a></h2>
<divclass="admonition warning">
<pclass="admonition-title">Warning</p>
<divclass="line-block">
<divclass="line">Before upgrading, make a backup of all data:</div>
<divclass="line">- database (with <aclass="reference external"href="https://www.postgresql.org/docs/11/app-pgdump.html">pg_dump</a> for instance)</div>