Updated README

This commit is contained in:
João Vitória Silva
2024-07-24 15:50:11 +01:00
parent 675653a8ef
commit c9ae93c637
4 changed files with 18 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
<div align="center"> <div align="center">
<img src="frontend/public/logo/logo.png" width="128" height="128"> <img src="frontend/app/public/logo/logo.png" width="128" height="128">
# Endurain # Endurain
@@ -15,7 +15,7 @@
Endurain is a self-hosted fitness tracking service that operates much like Strava but allows users to have complete control over their data and the hosting environment. The application's frontend is built using Vue.js and Bootstrap CSS. On the backend, it leverages Python FastAPI, Alembic, SQLAlchemy, stravalib and gpxpy for seamless integration with Strava and .gpx file import. The MariaDB database engine is employed to efficiently store and manage user data, while Jaeger is used for basic observability. Endurain is a self-hosted fitness tracking service that operates much like Strava but allows users to have complete control over their data and the hosting environment. The application's frontend is built using Vue.js and Bootstrap CSS. On the backend, it leverages Python FastAPI, Alembic, SQLAlchemy, stravalib and gpxpy for seamless integration with Strava and .gpx file import. The MariaDB database engine is employed to efficiently store and manage user data, while Jaeger is used for basic observability.
To deploy Endurain, Docker images are available, and a comprehensive example can be found in the "docker-compose.yml" file provided. Configuration is facilitated through environment variables, ensuring flexibility and ease of customization. To deploy Endurain, Docker images are available, and a comprehensive example can be found in the "docker-compose.yml.example" file provided. Configuration is facilitated through environment variables, ensuring flexibility and ease of customization.
As a non-professional developer, my journey with Endurain involved learning and implementing new technologies and concepts, with invaluable assistance from ChatGPT. The primary motivation behind this project was to gain hands-on experience and expand my understanding of modern development practices. Second motivation is that I'm an amateur triathlete and I want to keep track of my gear and gear components usage. As a non-professional developer, my journey with Endurain involved learning and implementing new technologies and concepts, with invaluable assistance from ChatGPT. The primary motivation behind this project was to gain hands-on experience and expand my understanding of modern development practices. Second motivation is that I'm an amateur triathlete and I want to keep track of my gear and gear components usage.
@@ -63,17 +63,17 @@ To support this in your implementation you will need to:
--- ---
# Frontend # Frontend
Table bellow shows supported environemnt variables. Variables marked with optional "No" should be set to avoid errors. Table bellow shows supported environment variables. Variables marked with optional "No" should be set to avoid errors.
Environemnt variable | Default value | Optional | Notes Environemnt variable | Default value | Optional | Notes
--- | --- | --- | --- --- | --- | --- | ---
VITE_BACKEND_PROTOCOL | http | Yes | Needs to be https if you want to enable Strava integration. You may need to update this variable based on docker image spin up VITE_BACKEND_PROTOCOL | http | Yes | Needs to be https if you want to enable Strava integration. Strava callback relies on this. You may need to update this variable based on docker image spin up (api host or local ip (example: http://192.168.1.10:98))
VITE_BACKEND_HOST | localhost:98 | Yes | Needs to be set and be Internet faced/resolved if you want to enable Strava integration. Strava callback relies on this. You may need to update this variable based on docker image spin up (api host or local ip (example: 192.168.1.10:98)) VITE_BACKEND_HOST | localhost:98 | Yes | Needs to be set and be Internet faced/resolved if you want to enable Strava integration. Strava callback relies on this. You may need to update this variable based on docker image spin up (api host or local ip (example: http://192.168.1.10:98))
Frontend dependencies: Frontend dependencies:
- To check npm dependencies used, use npm file (package.json) - To check npm dependencies used, use npm file (package.json)
- User avatars create using DiceBear (https://www.dicebear.com) avataaars style. - User avatars create using DiceBear (https://www.dicebear.com) avataaars style.
- Logo created using Canvas - Logo created on Canva
--- ---
# Backend # Backend
@@ -86,21 +86,20 @@ DB_PORT | 3306 | Yes | N/A
DB_USER | endurain | Yes | N/A DB_USER | endurain | Yes | N/A
DB_PASSWORD | changeme | `No` | N/A DB_PASSWORD | changeme | `No` | N/A
DB_DATABASE | endurain | Yes | N/A DB_DATABASE | endurain | Yes | N/A
SECRET_KEY | changeme | `No` | N/A SECRET_KEY | changeme | `No` | Run "openssl rand -hex 32" on a terminal to get a secret
ALGORITHM | HS256 | Yes | Currently only HS256 is supported ALGORITHM | HS256 | Yes | Currently only HS256 is supported
ACCESS_TOKEN_EXPIRE_MINUTES | 15 | Yes | N/A ACCESS_TOKEN_EXPIRE_MINUTES | 15 | Yes | Time in minutes
REFRESH_TOKEN_EXPIRE_DAYS | 7 | Yes | N/A REFRESH_TOKEN_EXPIRE_DAYS | 7 | Yes | Time in days
STRAVA_CLIENT_ID | changeme | `No` | N/A STRAVA_CLIENT_ID | changeme | `No` | Needed if you want to enable the Strava integration
STRAVA_CLIENT_SECRET | changeme | `No` | N/A STRAVA_CLIENT_SECRET | changeme | `No` | Needed if you want to enable the Strava integration
STRAVA_AUTH_CODE | changeme | `No` | N/A STRAVA_AUTH_CODE | changeme | `No` | Needed if you want to enable the Strava integration
JAEGER_ENABLED | false | Yes | N/A JAEGER_ENABLED | false | Yes | N/A
JAEGER_PROTOCOL | http | Yes | N/A JAEGER_PROTOCOL | http | Yes | N/A
JAEGER_HOST | jaeger | Yes | N/A JAEGER_HOST | jaeger | Yes | N/A
JAGGER_PORT | 4317 | Yes | N/A JAGGER_PORT | 4317 | Yes | N/A
STRAVA_DAYS_ACTIVITIES_ONLINK | 30 | Yes | N/A STRAVA_DAYS_ACTIVITIES_ONLINK | 30 | Yes | On Strava integration setup the number of days (including today) to get activities. Strava free API limitations can limit number of days you can query in a given time
FRONTEND_PROTOCOL | http | Yes | Needs to be set if you want to enable Strava integration. You may need to update this variable based on docker image spin up FRONTEND_PROTOCOL | http | Yes | Needs to be set if you want to enable Strava integration. You may need to update this variable based on docker image spin up (frontend host or local ip (example: http://192.168.1.10:8080))
FRONTEND_HOST | frontend | Yes | Needs to be set if you want to enable Strava integration. You may need to update this variable based on docker image spin up (frontend host or local ip (example: 192.168.1.10:8080)) FRONTEND_HOST | frontend:8080 | Yes | Needs to be set if you want to enable Strava integration. You may need to update this variable based on docker image spin up (frontend host or local ip (example: http://192.168.1.10:8080))
FRONTEND_PORT | frontend | Yes | Needs to be set if you want to enable Strava integration. You may need to update this variable based on docker image spin up
GEOCODES_MAPS_API | changeme | `No` | <a href="https://geocode.maps.co/">Geocode maps</a> offers a free plan consisting of 1 Request/Second. Registration necessary. GEOCODES_MAPS_API | changeme | `No` | <a href="https://geocode.maps.co/">Geocode maps</a> offers a free plan consisting of 1 Request/Second. Registration necessary.
Table bellow shows the obligatory environemnt variables for mariadb container. You should set them based on what was also set for backend container. Table bellow shows the obligatory environemnt variables for mariadb container. You should set them based on what was also set for backend container.

View File

@@ -53,8 +53,7 @@ ENV JAEGER_PROTOCOL="http"
ENV JAGGER_PORT=4317 ENV JAGGER_PORT=4317
ENV STRAVA_DAYS_ACTIVITIES_ONLINK=30 ENV STRAVA_DAYS_ACTIVITIES_ONLINK=30
ENV FRONTEND_PROTOCOL="http" ENV FRONTEND_PROTOCOL="http"
ENV FRONTEND_HOST="frontend" ENV FRONTEND_HOST="frontend:8080"
ENV FRONTEND_PORT=8080
ENV GEOCODES_MAPS_API="changeme" ENV GEOCODES_MAPS_API="changeme"
# Run main.py when the container launches # Run main.py when the container launches

View File

@@ -17,13 +17,6 @@ from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
# from session import router as session_router
# from users import router as users_router
# from activities import router as activities_router
# from activity_streams import router as activity_streams_router
# from gears import router as gears_router
# from followers import router as followers_router
import session.router as session_router import session.router as session_router
import session.security as session_security import session.security as session_security
import users.router as users_router import users.router as users_router
@@ -121,7 +114,6 @@ required_env_vars = [
"STRAVA_DAYS_ACTIVITIES_ONLINK", "STRAVA_DAYS_ACTIVITIES_ONLINK",
"FRONTEND_PROTOCOL", "FRONTEND_PROTOCOL",
"FRONTEND_HOST", "FRONTEND_HOST",
"FRONTEND_PORT",
"GEOCODES_MAPS_API", "GEOCODES_MAPS_API",
] ]
@@ -157,9 +149,7 @@ origins = [
"http://localhost:5173", "http://localhost:5173",
os.environ.get("FRONTEND_PROTOCOL") os.environ.get("FRONTEND_PROTOCOL")
+ "://" + "://"
+ os.environ.get("FRONTEND_HOST") + os.environ.get("FRONTEND_HOST"),
+ ":"
+ os.environ.get("FRONTEND_PORT"),
] ]
app.add_middleware( app.add_middleware(

View File

@@ -25,8 +25,7 @@ services:
- STRAVA_AUTH_CODE=changeme - STRAVA_AUTH_CODE=changeme
- GEOCODES_MAPS_API=changeme - GEOCODES_MAPS_API=changeme
- FRONTEND_PROTOCOL=http # default is http - FRONTEND_PROTOCOL=http # default is http
- FRONTEND_HOST=frontend # frontend host or local ip (example: 192.168.1.10:8080), default is frontend - FRONTEND_HOST=frontend:8080 # frontend host or local ip (example: 192.168.1.10:8080), default is frontend
- FRONTEND_PORT=8080 # default is 80
ports: ports:
- "98:80" # API port, change per your needs - "98:80" # API port, change per your needs
volumes: volumes: