Giter Site home page Giter Site logo

nyumat / progressad Goto Github PK

View Code? Open in Web Editor NEW
4.0 0.0 0.0 37.86 MB

An all-in-one fitness tracker for Oregon State University's Dixon Recreation Center.

Home Page: https://trackmedixon.onrender.com/

License: MIT License

JavaScript 79.24% HTML 1.26% CSS 0.36% TypeScript 19.14%
express mongodb nodejs oregon-state-university reactjs dixon workout-tracker

progressad's Introduction

ProgressAD ๐Ÿƒ | ๐Ÿ‹๏ธ

A workout tracking system for Oregon State University's Dixon Recreation Center.

Watch the video

Note Web Services on the free instance type are automatically spun down after 15 minutes of inactivity. When a new request for a free service comes in, Render spins it up again so it can process the request.

This can cause a response delay of up to 30 seconds for the first request that comes in after a period of inactivity.

Quick Specs

Getting Started

First, clone the repo from the command line:

git clone https://github.com/TrackMeAtDixon/Progress.git

Now that you haved checked out the repo locally, start in creating an .env file by running touch .env in the backend ./dir.

After this, open the .env file you just created in a text editor and format it like so:

PORT=XXXXX
URI=XXXXX
JWT_SECRET_KEY=XXXXX
CLOUD_NAME=XXXXX
CLOUDINARY_API_KEY=XXXXX
CLOUDINARY_API_SECRET=XXXXX

Replace 'XXXXX' with the actual values or else the api won't function properly!
Cloudinary SDK authentication details here.

If you're cloning/forking ProgressAD to make a change, you will need environment variables as well.
In root of the frontend directory, create another .env file and format it like so:

REACT_APP_TRCKME_BACKEND=https://progress-backend.onrender.com <--- Connect to deployed API
REACT_APP_TRCKME_BACKEND=http://localhost:8081 <--- Connect to the dev backend if running FE/BE concurrently, locally. 

Now that you've setup the enviornment variables and cloned the repository, it's time to run the dev server.

Installation

In the backend directory run: npm install

Execute this command in ./frontend/ as well!

Let's go over the key package.json scripts and what each of them do.

"server": "nodemon index.js",

Start the web server in ./backend with hot reloading. (restart when src. code changes are made)

"start": "react-scripts start",

Start the frontend-only webpack development server in./frontend.

Code Formatting

The code base follows a strict prettier style guideline which can be executed from the repo root with:

"format": "prettier --write './**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc"

You must have the package installed and a .prettierrc file in the root directory for this command to work!

After this, you're ready to run the application locally!

API Reference

/api/users/register | register a user
method: POST
input: username, pin, weight, height, BMI, bloodType (optional)
output: status code, msg, token

/api/users/login | log in a user
method: POST
input: username, pin
output: status code, msg, token

/api/users/logout | logout a user
method: PATCH
input: username
output: status code, msg

/api/users/init_login | (pending deletion?) set inital login to false
method: PATCH
input: username
output: status code, msg

/api/users/get | Get the user {username}'s document from MongoDB
method: GET
input: username
output: status code, msg, user

/api/workouts/create | Create a new workout for a user
method: POST
input: username, workoutType, workoutIntensity
output: status code, msg

/api/workout/machines/add | Add a new machine to a user's workout
method: POST
input: username, machine_id
output: status code, msg

/api/workout/machines/sets/add | Append a new set to a Strength type machine
method: PUT
input: username, reps, weight, machine_id
output: status code, msg

/api/workout/machines/cardio/add | Append a new exercise to a Cardio type machine
method: PUT
input: username, distance, timeSpent, machine_id
output: status code, msg

/api/machines/create | Upload a new machine to the Dixon Rec. Center collection.
method: POST
input: machine_name, machine_type
output: status code, message

/api/machines/get | Get all the machines in the Dixon collection.
method: GET
input: none
output: msg,
machines{machine_name,machine_id,machine_type,machine_status,machine_image}

/api/machines/update_status | Update the status of a machine at Dixon.
method: PUT
input: machine_id, username
output: status code, msg, machines

/api/users/update | Update and save the profile of the user.
method: PUT
input: old_username, username, weight,  height, BMI, age, firstName, lastName
output: status code, msg, user

/api/workouts/get | Get the user's current workout and past saved workouts
method: GET
input: username
output: status code, msg, currentWorkout, savedWorkouts

/api/workout/rate | Rate the user's workout before ending.
method: PATCH
input: username, effortLevel, tirednessLevel
output: status code, msg

/api/workout/end | End the user's current workout
method: PATCH
input: username
output: status code, msg, savedWorkouts

License

MIT License

progressad's People

Contributors

jsrockett avatar nyumat avatar

Stargazers

 avatar  avatar  avatar  avatar

progressad's Issues

[Refactor] Migrate the entire ProgressAD codebase to Typescript with strict type checking.

It's Finally Time.

I'd like to add new/better features to the application, but using plain JavaScript is not effective or efficient as the application grows.

I can't explain the amount of "property doesn't exist on undefined" and other lack-of-type-based issues we've gotten throughout the early development process.

So, ProgressAD will be migrating to TypeScript.

This will be incremental, so I'll be doing the backend first, and then hitting the frontend.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.