API - move health route

This commit is contained in:
Sam
2020-05-01 18:10:34 +02:00
parent d6615795ba
commit abca323936
96 changed files with 29 additions and 32169 deletions

View File

@ -1,16 +0,0 @@
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,
activities.get_segment_gpx,
activities.get_segment_chart_data

View File

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

View File

@ -1,7 +0,0 @@
Configuration
#############
.. autoflask:: fittrackee_api:create_app()
:endpoints:
config.get_application_config,
config.update_application_config

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,156 +0,0 @@
# Change log
## Version 0.2.5 - Fix and improvements (2020/01/31)
### Misc
This version contains minor fix and improvements on client side:
* [4c3fc34](https://github.com/SamR1/FitTrackee/commit/4c3fc343d51b9c27d3ebab71df648bcf7d7bae59) - empty user data on logout
* [34614d5](https://github.com/SamR1/FitTrackee/commit/34614d5a6c29f4911d92db33d36fe95721b39f33) - add spinner on loading activities
* [b862a77](https://github.com/SamR1/FitTrackee/commit/b862a77344abbb07d98fe3ce8b157b5cef0e8d1c),
[2e1ee2c](https://github.com/SamR1/FitTrackee/commit/2e1ee2c7a1456eb2fe0c0255959c695cc7908975) -
add URL interceptors to simplify routes definition
## Version 0.2.4 - Minor fix (2020/01/30)
### Issues Closed
#### Bugs Fixed
* [#47](https://github.com/SamR1/Fittrackee/issues/47) - timezone drop-down is not displayed correctly
* [#46](https://github.com/SamR1/Fittrackee/issues/46) - calendar cannot display more than 5 or 6 activities on the same day
In this release 2 issues were closed.
## Version 0.2.3 - FitTrackee available in French (2019/12/29)
### Issues Closed
#### New Features
* [#43](https://github.com/SamR1/Fittrackee/issues/43) - Display weekend days with a different background color on calendar
* [#40](https://github.com/SamR1/Fittrackee/issues/40) - Localize FitTrackee (i18n)
#### Bugs Fixed
* [#44](https://github.com/SamR1/Fittrackee/issues/44) - Cannot edit an activity that does not have a gpx file
In this release 3 issues were closed.
## Version 0.2.2 - Statistics fix (2019/09/23)
### Issues Closed
#### Bugs Fixed
* [#41](https://github.com/SamR1/Fittrackee/issues/41) - User statistics are incorrect
In this release 1 issue was closed.
## Version 0.2.1 - Fix and improvements (2019/09/01)
### Issues Closed
#### New Features
* [#4](https://github.com/SamR1/Fittrackee/issues/4) - Show points on the map when mouse over the chart
* [#14](https://github.com/SamR1/Fittrackee/issues/14) - Display segments informations
* [#21](https://github.com/SamR1/Fittrackee/issues/21) - Document the API
* [#23](https://github.com/SamR1/Fittrackee/issues/23) - The user can choose the first day of the week
* [#36](https://github.com/SamR1/Fittrackee/issues/36) - Disable user registration
* [#33](https://github.com/SamR1/Fittrackee/issues/33) - Add file size limit on file upload
* [#37](https://github.com/SamR1/Fittrackee/issues/37) - Display map on activities list
#### Bugs Fixed
* [#34](https://github.com/SamR1/Fittrackee/issues/34) - Weather is not displayed anymore
### Misc
* **[Poetry](https://poetry.eustace.io/)** replaces **[pipenv](https://docs.pipenv.org)** for Python packages management
In this release 8 issues were closed.
## 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.0 - First release 🎉 (2018-07-04)
**Features:**
- 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)
- Activity edition and deletion
- An activity can be displayed with map (if with gpx), weather (if the DarkSky API key is provided) and charts (speed and elevation)
- A user can add a note
- Month calendar with activities
- Current month statistics
- Records by sports:
- average speed
- farest distance
- longest duration
- maximum speed
- Activities list and search
**Notes:**
- only activity owner can see his activity
- no administration for now
➡️ more informations: see [wiki](https://github.com/SamR1/mpwo/wiki) and [current issues](https://github.com/SamR1/mpwo/issues)
### 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.

View File

@ -1,65 +0,0 @@
Features
########
List
~~~~
Users
^^^^^
- Account creation (only standard user, not admin)
- User registration can be disabled
Activities/Workouts
^^^^^^^^^^^^^^^^^^^
- 6 sports supported:
- Cycling (Sport)
- Cycling (Transport)
- Hiking
- Montain Biking
- Running
- Walking
- Dashboard with month calendar displaying activities and record. The week can start on Sunday or Monday (which can be changed in the user settings)
- 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 with a gpx file can be displayed with map, weather (if the DarkSky API key is provided) and charts (speed and elevation). Segments can be displayed
- Activity edition and deletion. User can add a note
- 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**
Translations
^^^^^^^^^^^^
FitTrackee is available in English and French (which can be saved in the user settings).
Dashboard
~~~~~~~~~
.. figure:: _images/fittrackee_screenshot-01.png
:alt: FitTrackee Dashboard
Activity/workout detail
~~~~~~~~~~~~~~~~~~~~~~~
.. figure:: _images/fittrackee_screenshot-02.png
:alt: FitTrackee Activity
Activities/workouts list
~~~~~~~~~~~~~~~~~~~~~~~~
.. figure:: _images/fittrackee_screenshot-03.png
:alt: FitTrackee Activities
Statistics
~~~~~~~~~~
.. figure:: _images/fittrackee_screenshot-04.png
:alt: FitTrackee Statistics

View File

@ -1,40 +0,0 @@
.. FitTrackee documentation master file, created by
sphinx-quickstart on Sun Jul 14 14:43:43 2019.
FitTrackee
==========
| 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:: _images/fittrackee_screenshot-01.png
:alt: FitTrackee Dashboard
Table of contents
=================
.. toctree::
:maxdepth: 2
installation
features
api/index
troubleshooting/index
changelog

View File

@ -1,183 +0,0 @@
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 <https://www.freepik.com/>`__ from `www.flaticon.com <https://www.flaticon.com/>`__.
Prerequisites
~~~~~~~~~~~~~
- PostgreSQL database (10+)
- Python 3.7+
- `Poetry <https://poetry.eustace.io>`__
- `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.
.. warning::
Since FitTrackee 0.2.1, Python packages installation needs Poetry. To install it on ArchLinux:
.. code-block:: bash
$ yaourt poetry
$ poetry --version
Poetry 0.12.17
# optional
$ poetry config settings.virtualenvs.in-project true
For other OS, see `Poetry Documentation <https://poetry.eustace.io/docs/#installation>`__
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 `Environment variables <installation.html#environment-variables>`__).
- 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
^^^^^^^^^^^^^^^^
.. warning::
Note that FitTrackee is not production-ready yet
- Download the last release (for now, it is the beta release v0.2.5):
.. code:: bash
$ wget https://github.com/SamR1/FitTrackee/archive/v0.2.5-beta.tar.gz
$ tar -xzf v0.2.5-beta.tar.gz
$ mv FitTrackee-0.2.3-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 `Environment variables <installation.html#environment-variables>`__).
- 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
~~~~~~~
.. warning::
| Before upgrading, make a backup of all data:
| - database (with `pg_dump <https://www.postgresql.org/docs/11/app-pgdump.html>`__ for instance)
| - upload directory: **FitTrackee/fittrackee_api/fittrackee_api/uploads/**
Dev environment
^^^^^^^^^^^^^^^
- Stop the application and pull the repository:
.. code:: bash
$ git pull
- Update **Makefile.config** and **Makefile.custom.config** file if needed
- Upgrade packages and database:
.. code:: bash
$ make install-dev
$ make upgrade-db
- Restart the server and the client:
.. code:: bash
$ make serve
Prod environment
^^^^^^^^^^^^^^^^
``TODO``
Environment variables
~~~~~~~~~~~~~~~~~~~~~
The following environment variables must be defined in **Makefile.custom.config**:
.. cssclass:: table-bordered table-striped
===================================== ======================================= ====================================
variable description app default value
===================================== ======================================= ====================================
``REACT_APP_GPX_LIMIT_IMPORT`` max. number of gpx file in zip archive 10
``REACT_APP_MAX_SINGLE_FILE_SIZE`` max. size of a gpx or picture file 1MB
``REACT_APP_MAX_ZIP_FILE_SIZE`` max. size of a zip archive 10MB
``REACT_APP_ALLOW_REGISTRATION`` allows users to register true
``REACT_APP_THUNDERFOREST_API_KEY`` ThunderForest API key no defaut value, must be initialized
``WEATHER_API`` DarkSky API key no defaut value, not mandatory
===================================== ======================================= ====================================

View File

@ -1,10 +0,0 @@
Administrator
#############
`JSON.parse: unexpected character at line 1 column 1 of the JSON data`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
On the **Network Tab**, if the requests are made to `http://localhost:3000/undefined/api`, that means the environnement variable **REACT_APP_API_URL** is not initialized.
Check if **Makefile.custom.config** file exists and **REACT_APP_API_URL** is correctly initialized (see `example <https://github.com/SamR1/FitTrackee/blob/master/Makefile.custom.config.example>`__), and rebuild the client.

View File

@ -1,9 +0,0 @@
Troubleshooting
#################
.. toctree::
:maxdepth: 2
:caption: Endpoints:
administrator
user

View File

@ -1,5 +0,0 @@
User
####
``TODO``