Skip to content

Web app to schedule and track everything running related.

Notifications You must be signed in to change notification settings

conorlyness/TrackMyRun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrackMyRun

Project to enable you to log all of your runs, view and edit them and even upload your images to view them in the gallery.

If you wish to run a dev enviornment of the app rather than running the exe, the following steps are:

There are two options for the database:

Option 1 (This requires flags to be passed to the npm commands* See more below): you can either use PostgreSQL locally or a cloud instance of it. (Note: current configuration is using PostgreSQL so if you wish to use SQL server then the queries will need to be tweaked to use the SQL server syntax. Find these queries inside: server -> sqlQueries -> analytics.js & core.js) The database can be installed locally or you can use an online hosted service. You will need to add the databases username, password and host into a .env file which you can place in the root of the server folder. Once you have created a .env file, add the following three variables:

  1. DB_USER =
  2. DB_PASSWORD =
  3. DB_HOST = <The host for the db, eg. localhost or the address if its hosted online>

Copy the contents of this text file and execute this as a new sql query, ensure you use the query corresponding to your database choice. This will create the DB and all the required tables:
SQL_TrackMyRun_DB_Creation.txt

The values will be used in config.js on the server.

Option 2: This will be the default if you do not create a db yourself or use a hosted one. A sqlite db will be seeded and connected to automatically and this will be local to your machine.

Starting the server

Note: if you start your server to run local dev and you opt for the sqlite db, this will be a seperate db to the sqlite one which will be made by the packaged exe version.

  • CD into server folder
  • run npm install
  • run node index.js

Running the server as a Docker container

If you prefer to run your server inside a container, say you want Docker to always run the server without having to manually start it. Go ahead and:

  • CD into the server folder
  • run: docker build -t .
  • run: docker build -t .
  • run: docker run --restart always -p 3001:3001 -d

Starting the client

  • CD into client folder
  • run npm install
  • run npm run build
  • If you are going with database option 1, you will need to pass the following flags: --CloudDB
  • run ng serve to start the client OR if DB option 1: 'ng serve --CloudDB'
  • if you would like to run the angular app in electron, run the commmand, npm run electorn

Using Strava with the app

  • You will need to create your own strava key which will enable the app to be personalised to your strava data: https://www.strava.com/settings/api
  • once you have completed that, you need to copy the Client ID and Client Secret
  • open the config.js in the server folder and you will see two properties: stravaClientSecret & stravaClientID. Paste your values here
  • inside strava.service.ts in the client folder you will see a variable called clientId. Paste your Client ID there also
  • You should now see the strava icon appear in the top right of the app when running it. You can login with your details and it will connect your strava account to TMR!

Troubleshooting

NOTE: If you run into an error in the build step regarding ngx-electron. Goto the node modules file electron.service.d.ts at: node_modules/ngx-electron/lib/electron.service.d.ts and comment out the 'readonly remote: Electron.Remote;' and then try to rebuild

What to Expect from the app: log analyticsDash

About

Web app to schedule and track everything running related.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published