This commit is contained in:
Sam
2019-07-14 19:42:40 +02:00
parent 4a06feb399
commit a3613617a4
128 changed files with 36907 additions and 3 deletions

20
docsrc/Makefile Normal file
View File

@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

35
docsrc/make.bat Normal file
View File

@ -0,0 +1,35 @@
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end
:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:end
popd

View File

View File

@ -0,0 +1,14 @@
Activities
##########
.. autoflask:: fittrackee_api:create_app()
:endpoints:
activities.get_activities,
activities.get_activity,
activities.post_activity,
activities.post_activity_no_gpx,
activities.update_activity,
activities.delete_activity,
activities.get_map,
activities.get_activity_gpx,
activities.get_activity_chart_data

View File

@ -0,0 +1,12 @@
Authentication
##############
.. autoflask:: fittrackee_api:create_app()
:endpoints:
auth.register_user,
auth.login_user,
auth.logout_user,
auth.get_user_status,
auth.edit_user,
auth.edit_picture,
auth.del_picture

View File

@ -0,0 +1,13 @@
API documentation
#################
.. toctree::
:maxdepth: 2
:caption: Endpoints:
activities
auth
records
sports
stats
users

View File

@ -0,0 +1,6 @@
Records
#######
.. autoflask:: fittrackee_api:create_app()
:endpoints:
records.get_records

View File

@ -0,0 +1,10 @@
Sports
######
.. autoflask:: fittrackee_api:create_app()
:endpoints:
sports.get_sports,
sports.get_sport,
sports.post_sport,
sports.update_sport,
sports.delete_sport

View File

@ -0,0 +1,7 @@
Statistics
##########
.. autoflask:: fittrackee_api:create_app()
:endpoints:
stats.get_activities_by_sport,
stats.get_activities_by_time

View File

@ -0,0 +1,9 @@
Users
#####
.. autoflask:: fittrackee_api:create_app()
:endpoints:
users.get_users,
users.get_single_user,
users.get_picture,
users.ping_pong

View File

@ -0,0 +1,52 @@
# Change log
## Version 0.2.0 - Statistics (2019/07/07)
### Issues Closed
#### New Features
* [#13](https://github.com/SamR1/Fittrackee/issues/13) - Detailed statistics
#### Misc
* Update dependencies
In this release 1 issue was closed.
## Version 0.1.1 - Fix and improvements (2019/02/07)
### Issues Closed
#### New Features
* [#25](https://github.com/SamR1/FitTrackee/issues/25) - Display records on calendar
* [#22](https://github.com/SamR1/FitTrackee/issues/22) - Add a total on current month statistics
#### Bugs Fixed
* [#31](https://github.com/SamR1/FitTrackee/issues/31) - Use moving duration for stats
* [#29](https://github.com/SamR1/FitTrackee/issues/29) - Pause duration calculation with segments
* [#28](https://github.com/SamR1/FitTrackee/issues/28) - Error on uploading gpx file
* [#26](https://github.com/SamR1/FitTrackee/issues/26) - Total is incorrect in tooltip when duration is displayed
* [#24](https://github.com/SamR1/FitTrackee/issues/24) - Some distances are not displayed correctly on current month statistics
In this release 7 issues were closed.
## Version 0.1 - Minimal version (2018-07-04)
### Issues Closed
#### New Features
* [#11](https://github.com/SamR1/FitTrackee/issues/11) - Timezone support
* [#10](https://github.com/SamR1/FitTrackee/issues/10) - Add a note to an activity
* [#9](https://github.com/SamR1/FitTrackee/issues/9) - User statistics on dashboard
* [#8](https://github.com/SamR1/FitTrackee/issues/8) - Add weather to activities
* [#3](https://github.com/SamR1/FitTrackee/issues/3) - Search filter for activities
* [#2](https://github.com/SamR1/FitTrackee/issues/2) - Calendar to view activities
In this release 6 issues were closed.

73
docsrc/source/conf.py Normal file
View File

@ -0,0 +1,73 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
import sphinx_bootstrap_theme
sys.path.insert(0, os.path.abspath('../../fittrackee_api'))
# -- Project information -----------------------------------------------------
project = 'FitTrackee'
copyright = '2019, SamR1'
author = 'SamR1'
# The full version, including alpha/beta/rc tags
release = '0.2.1-beta'
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'recommonmark',
'sphinxcontrib.autohttp.flask'
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'bootstrap'
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_theme_options = {
'bootswatch_theme': 'flatly',
}
# -- Sources configuration ---------------------------------------------------
source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'markdown',
'.md': 'markdown',
}

View File

@ -0,0 +1,53 @@
Features
########
Features list
~~~~~~~~~~~~~
- Account creation (only standard user, not admin)
- 6 sports supported:
- Cycling (Sport)
- Cycling (Transport)
- Hiking
- Montain Biking
- Running
- Walking
- Activity creation by uploading a gpx file. An activity can even be created without gpx (the user must enter date, time, duration and distance)
- An activity can be displayed with map (if with gpx), weather (if the DarkSky API key is provided) and charts (speed and elevation)
- Activity edition and deletion. User can add a note
- Dashboard with month calendar displaying activities and record
- User statistics
- User records by sports:
- average speed
- farest distance
- longest duration
- maximum speed
- Activities list and filter
**Notes:**
- only activity owner can see his activity
- no administration for now
Dashboard
~~~~~~~~~
.. figure:: ../../misc/images/fittrackee_screenshot-01.png
:alt: FitTrackee Dashboard
Activity/workout detail
~~~~~~~~~~~~~~~~~~~~~~~
.. figure:: ../../misc/images/fittrackee_screenshot-02.png
:alt: FitTrackee Activity
Activities/workouts list
~~~~~~~~~~~~~~~~~~~~~~~~
.. figure:: ../../misc/images/fittrackee_screenshot-03.png
:alt: FitTrackee Activities
Statistics
~~~~~~~~~~
.. figure:: ../../misc/images/fittrackee_screenshot-04.png
:alt: FitTrackee Statistics

57
docsrc/source/index.rst Normal file
View File

@ -0,0 +1,57 @@
.. FitTrackee documentation master file, created by
sphinx-quickstart on Sun Jul 14 14:43:43 2019.
FitTrackee
==========
| |Python Version| |Flask Version| |React Version|
| |Codacy Badge| |Codacy Coverage Badge|\ 1 |Build Status|
| This web application allows you to track your outdoor activities from
gpx files and keep your data on your own server.
| No mobile app is developed yet, but several existing mobile apps can
store workouts data locally and export them into a gpx file.
| Examples (for Android):
| \* `Runner Up <https://github.com/jonasoreland/runnerup>`__ (GPL v3)
| \* `ForRunners <https://gitlab.com/brvier/ForRunners>`__ (GPL v3)
| \* `AlpineQuest <https://www.alpinequest.net/>`__ (Proprietary, no
trackers according to `exodus privay
report <https://reports.exodus-privacy.eu.org/reports/2975/>`__)
| Maps are displayed using `Open Street
Map <https://www.openstreetmap.org>`__.
| It is also possible to add a workout without a gpx file.
| **Still under development (not ready for production).**
| (see `issues <https://github.com/SamR1/FitTrackee/issues>`__ for more information)
.. figure:: ../../misc/images/fittrackee_screenshot-01.png
:alt: FitTrackee Dashboard
Table of contents
=================
.. toctree::
:maxdepth: 2
installation
features
api/index
changelog
.. |Python Version| image:: https://img.shields.io/badge/python-3.7-brightgreen.svg
:target: https://python.org
.. |Flask Version| image:: https://img.shields.io/badge/flask-1.1-brightgreen.svg
:target: http://flask.pocoo.org/
.. |React Version| image:: https://img.shields.io/badge/react-16.8-brightgreen.svg
:target: https://reactjs.org/
.. |Codacy Badge| image:: https://api.codacy.com/project/badge/Grade/290a285f22e94132904dc13b4dd19d1d
:target: https://www.codacy.com/app/SamR1/FitTrackee
.. |Codacy Coverage Badge| image:: https://api.codacy.com/project/badge/Coverage/290a285f22e94132904dc13b4dd19d1d
:target: https://www.codacy.com/app/SamR1/FitTrackee
.. |Build Status| image:: https://travis-ci.org/SamR1/FitTrackee.svg?branch=master
:target: https://travis-ci.org/SamR1/FitTrackee

View File

@ -0,0 +1,112 @@
Installation
############
This application is written in Python (API) and Javascript (client):
- API:
- Flask
- `gpxpy <https://github.com/tkrajina/gpxpy>`__ to parse gpx files
- `staticmap <https://github.com/komoot/staticmap>`__ to generate a static map image from gpx coordinates
- `python-forecast.io <https://github.com/ZeevG/python-forecast.io>`__ to fetch weather data from `Dark Sky <https://darksky.net>`__ (former forecast.io)
- Client:
- React/Redux
- `Leaflet <https://leafletjs.com/>`__ to display map
- `Recharts <https://github.com/recharts/recharts>`__ to display charts with elevation and speed
Sports and weather icons are made by Freepik from www.flaticon.com.
Prerequisites
~~~~~~~~~~~~~
- PostgreSQL database (10+)
- Python 3.7+
- `Yarn <https://yarnpkg.com>`__ and
`serve <https://github.com/zeit/serve>`__
- API key from `ThunderForest <http://thunderforest.com>`__
- API key from `Dark Sky <https://darksky.net/dev>`__ [not mandatory]
Installation
~~~~~~~~~~~~
| The following steps describe an installation on Linux systems (tested
on Debian and Arch).
| On other OS, some issues can be encountered and adaptations may be
necessary.
Dev environment
^^^^^^^^^^^^^^^
- Clone this repo:
.. code:: bash
$ git clone https://github.com/SamR1/FitTrackee.git
$ cd FitTrackee
- Update **Makefile.config** file if needed and copy/paste the
**ThunderForest** and **Dark Sky** API keys value in
**Makefile.custom.config** file (see example)
- Install Python virtualenv, React and all related packages and
initialize the database:
.. code:: bash
$ make install-dev
$ make install-db
- Start the server and the client:
.. code:: bash
$ make serve
Open http://localhost:3000 and login (the email is ``admin@example.com``
and the password ``mpwoadmin``) or register
Prod environment
^^^^^^^^^^^^^^^^
- Download the last release (for now it is the beta release v0.2.1):
.. code:: bash
$ wget https://github.com/SamR1/FitTrackee/archive/v0.2.1-beta.tar.gz
$ tar -xzf v0.1.1-beta.tar.gz
$ mv FitTrackee-0.1.1-beta FitTrackee
$ cd FitTrackee
- Update **Makefile.config** file if needed and copy/paste the
**ThunderForest** and **Dark Sky** API keys value in
**Makefile.custom.config** file (see example)
- Install Python virtualenv, React and all related packages and
initialize the database:
.. code:: bash
$ make install
$ make install-db
- Build the client:
.. code:: bash
$ make build-client
- Start the server and the client:
.. code:: bash
$ make run
Open http://localhost:3000, log in as admin (the email is
``admin@example.com`` and the password ``mpwoadmin``) and change the
password
Upgrade
~~~~~~~
``TODO``