Skip to content

Track fitness goals, share progress, and motivate yourself and friends... Created at https://coslynx.com

Notifications You must be signed in to change notification settings

coslynx/Fitness-Tracker-MVP-Personalized

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fitness-Tracker-MVP-Personalized

A user-centric platform for personalized fitness tracking and a thriving community

Developed with the software and tools below.

Framework used Frontend technologies Backend technology Database used
git-last-commit GitHub commit activity GitHub top language

πŸ“‘ Table of Contents

  • πŸ“ Overview
  • πŸ“¦ Features
  • πŸ“‚ Structure
  • πŸ’» Installation
  • πŸ—οΈ Usage
  • 🌐 Hosting
  • πŸ“„ License
  • πŸ‘ Authors

πŸ“ Overview

This repository houses a Minimum Viable Product (MVP) for a Fitness Tracker application. The MVP is designed to empower users with personalized goal setting, detailed progress tracking, and a vibrant social community.

The project leverages a modern tech stack, including:

  • Frontend: React, Next.js, Tailwind CSS
  • Backend: Node.js, Express.js
  • Database: PostgreSQL
  • State Management: Zustand
  • Authentication: NextAuth.js

πŸ“¦ Features

Feature Description
πŸ” User Authentication Secure login and signup using email and password, with support for potential social login integrations in future iterations.
🎯 Goal Setting Users can create personalized fitness goals with specific targets, deadlines, and measurable metrics.
πŸ“Š Progress Tracking Track workout logs, including activity type, duration, calories burned, and other relevant metrics.
πŸ“ˆ Data Visualization Visualize progress towards goals using charts and graphs for a clear understanding of achievements.
πŸ’¬ Social Sharing Share workout logs and progress updates with friends and followers to build motivation and accountability within a community.

πŸ“‚ Structure

Fitness-Tracker-MVP-Personalized
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ components
β”‚   β”‚   β”œβ”€β”€ Button.tsx
β”‚   β”‚   β”œβ”€β”€ Header.tsx
β”‚   β”‚   β”œβ”€β”€ Layout.tsx
β”‚   β”‚   β”œβ”€β”€ GoalInput.tsx
β”‚   β”‚   β”œβ”€β”€ ProgressChart.tsx
β”‚   β”‚   └── SocialShareButton.tsx
β”‚   β”œβ”€β”€ pages
β”‚   β”‚   β”œβ”€β”€ _app.tsx
β”‚   β”‚   β”œβ”€β”€ index.tsx
β”‚   β”‚   β”œβ”€β”€ dashboard.tsx
β”‚   β”‚   └── login.tsx
β”‚   β”‚       └── index.tsx
β”‚   β”œβ”€β”€ styles
β”‚   β”‚   └── global.css
β”‚   β”œβ”€β”€ utils
β”‚   β”‚   β”œβ”€β”€ helpers.ts
β”‚   β”‚   β”œβ”€β”€ api.ts
β”‚   β”‚   β”œβ”€β”€ auth.ts
β”‚   β”‚   └── validation.ts
β”‚   └── config
β”‚       └── next-auth.config.ts
└── middleware
    └── authentication.ts

πŸ’» Installation

πŸ”§ Prerequisites

  • Node.js (LTS version recommended)
  • npm (or yarn)
  • PostgreSQL (with a running instance)

πŸš€ Setup Instructions

  1. Clone the repository:

    git clone https://github.com/coslynx/Fitness-Tracker-MVP-Personalized.git
  2. Navigate to the project directory:

    cd Fitness-Tracker-MVP-Personalized
  3. Install dependencies:

    npm install
  4. Create a .env file (example):

    cp .env.example .env
    • Update the .env file with your PostgreSQL credentials.

πŸ—οΈ Usage

πŸƒβ€β™‚οΈ Running the Development Server

  1. Start the development server:

    npm run dev
  2. Open your browser and navigate to: http://localhost:3000.

βš™οΈ Configuration

  • Configure the database connection in your .env file.
  • Adjust other settings as needed (e.g., social media API keys, if applicable).

πŸ“š Examples

  • πŸ“ Example 1: Setting a Fitness Goal

    • Login to the application.
    • Navigate to the "Goals" section.
    • Click the "Add Goal" button.
    • Enter a goal name (e.g., "Lose 10 pounds"), target value (e.g., "10"), and deadline (e.g., "2024-12-31").
    • Submit the goal.
  • πŸ“ Example 2: Logging a Workout

    • Login to the application.
    • Navigate to the "Workouts" section.
    • Click the "Log Workout" button.
    • Select the activity type (e.g., "Running").
    • Enter the workout duration (e.g., "30 minutes").
    • Submit the workout log.
  • πŸ“ Example 3: Sharing Workout Progress

    • Login to the application.
    • Navigate to your workout logs.
    • Click the "Share" button next to a specific workout entry.
    • Choose your preferred social media platform to share your progress.

🌐 Hosting

πŸš€ Deployment Instructions

Using Vercel (Recommended)

  1. Login to Vercel:

  2. Import project:

    • Click the "Import Project" button and select the Fitness-Tracker-MVP-Personalized directory.
    • Follow the Vercel instructions to configure your project and deploy.

Using Netlify

  1. Login to Netlify:

  2. Import project:

    • Click the "New site from Git" button.
    • Connect your GitHub account and select the Fitness-Tracker-MVP-Personalized repository.
    • Follow the Netlify instructions to configure your project and deploy.

Using GitHub Pages

  1. Create a gh-pages branch:

    git checkout -b gh-pages
  2. Install the gh-pages package:

    npm install gh-pages --save-dev
  3. Configure the gh-pages package:

    • Update your package.json file with the following:
      "scripts": {
        "deploy": "gh-pages -d build"
      }
  4. Build the application:

    npm run build
  5. Deploy to GitHub Pages:

    npm run deploy
  6. Push the changes to the gh-pages branch:

    git push origin gh-pages

Using AWS

  1. Create an AWS account (if you don't have one):

  2. Create an S3 bucket:

    • Go to the S3 console and create a new bucket.
  3. Configure an S3 bucket website:

    • In the S3 bucket settings, enable "Static website hosting" and configure the index document (index.html).
  4. Deploy the build files:

    • Use the AWS CLI or a tool like the AWS S3 plugin for VS Code to upload the build files (from the build directory) to the S3 bucket.
  5. Configure a CloudFront distribution (optional):

    • Set up a CloudFront distribution to serve your S3 website content with a custom domain name and caching.

Using Google Cloud

  1. Create a Google Cloud Platform (GCP) account (if you don't have one):

  2. Create a Cloud Storage bucket:

    • Go to the Cloud Storage console and create a new bucket.
  3. Configure a website on Cloud Storage:

    • In the Cloud Storage bucket settings, enable "Website hosting" and configure the index document (index.html).
  4. Deploy the build files:

    • Use the Google Cloud Storage CLI or a tool like the Google Cloud Storage plugin for VS Code to upload the build files (from the build directory) to the Cloud Storage bucket.
  5. Configure a Cloud CDN (optional):

    • Use Cloud CDN to cache and accelerate your Cloud Storage website content.

πŸ”‘ Environment Variables

  • NEXT_PUBLIC_APP_NAME: Your application name (displayed in the header).
  • NEXT_PUBLIC_APP_DESCRIPTION: Your application description (displayed in the header).
  • DATABASE_URL: Your PostgreSQL database URL (e.g., postgres://username:password@host:port/database_name).

πŸ“œ API Documentation

πŸ” Endpoints

  • GET /api/goals: Retrieves a list of goals for the current user.
  • POST /api/goals: Creates a new goal for the current user.
  • GET /api/goals/:id: Retrieves a specific goal by its ID.
  • PUT /api/goals/:id: Updates an existing goal by its ID.
  • DELETE /api/goals/:id: Deletes a goal by its ID.
  • POST /api/workouts: Logs a new workout for the current user.
  • GET /api/workouts: Retrieves a list of workouts for the current user.
  • GET /api/workouts/:id: Retrieves a specific workout by its ID.
  • PUT /api/workouts/:id: Updates an existing workout by its ID.
  • DELETE /api/workouts/:id: Deletes a workout by its ID.

πŸ”’ Authentication

  • The API endpoints require authentication.
  • Authentication is handled through NextAuth.js, using JWT tokens for session management.

πŸ“ Examples

# Get all goals
curl -X GET -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3000/api/goals

# Create a new goal
curl -X POST -H "Authorization: Bearer YOUR_JWT_TOKEN" -H "Content-Type: application/json" -d '{"name": "Lose 10 pounds", "target": "10", "deadline": "2024-12-31"}' http://localhost:3000/api/goals

# Log a new workout
curl -X POST -H "Authorization: Bearer YOUR_JWT_TOKEN" -H "Content-Type: application/json" -d '{"type": "Running", "duration": "30 minutes"}' http://localhost:3000/api/workouts

πŸ“œ License & Attribution

πŸ“„ License

This Minimum Viable Product (MVP) is licensed under the GNU AGPLv3 license.

πŸ€– AI-Generated MVP

This MVP was entirely generated using artificial intelligence through CosLynx.com.

No human was directly involved in the coding process of the repository: Fitness-Tracker-MVP-Personalized

πŸ“ž Contact

For any questions or concerns regarding this AI-generated MVP, please contact CosLynx at:

🌐 CosLynx.com

Create Your Custom MVP in Minutes With CosLynxAI!