Skip to content

Project: Track fitness goals, log workouts, and share achievements with friends.. Created at https://coslynx.com

Notifications You must be signed in to change notification settings

coslynx/it-rack-itness-oal-racking-pp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

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

Repository files navigation

FitTrack - Fitness Goal Tracking and Sharing

A web application to simplify fitness goal tracking and achievement sharing.

Developed with the software and tools below.

Framework used for building the application Frontend technologies used Backend technology used Database used Authentication library used
git-last-commit GitHub commit activity GitHub top language

πŸ“‘ Table of Contents

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

πŸ“ Overview

This repository contains the code for a Minimum Viable Product (MVP) of FitTrack, a web application aimed at simplifying fitness goal tracking and achievement sharing. It leverages the power of a modern tech stack: Next.js for frontend development, Node.js for backend functionality, and a PostgreSQL database for data storage. FitTrack offers a user-friendly interface and social features that encourage motivation and community engagement.

πŸ“¦ Features

Feature Description
πŸ” User Authentication Secure user registration and login using email/password or Google Sign-in.
🎯 Goal Setting Define personalized fitness goals with specific parameters, such as target weight, workout frequency, or distance.
πŸ“ˆ Progress Tracking Track workouts, nutrition, and overall progress towards goals, with detailed visualizations.
🀝 Social Sharing Share achievements, progress updates, and motivational messages with friends within the app.

πŸ“‚ Structure

FitTrack-MVP
β”œβ”€β”€ app
β”‚   β”œβ”€β”€ layout
β”‚   β”‚   └── page.js
β”‚   └── page
β”‚       └── index.js
β”œβ”€β”€ components
β”‚   β”œβ”€β”€ Header.jsx
β”‚   β”œβ”€β”€ GoalInput.jsx
β”‚   β”œβ”€β”€ ProgressChart.jsx
β”‚   β”œβ”€β”€ SocialShareButton.jsx
β”‚   └── Button.jsx
β”œβ”€β”€ lib
β”‚   β”œβ”€β”€ auth.ts
β”‚   └── api.ts
β”œβ”€β”€ pages
β”‚   β”œβ”€β”€ api
β”‚   β”‚   β”œβ”€β”€ auth.ts
β”‚   β”‚   β”œβ”€β”€ goals.ts
β”‚   β”‚   └── progress.ts
β”‚   β”œβ”€β”€ _app.tsx
β”‚   β”œβ”€β”€ index.tsx
β”‚   β”œβ”€β”€ dashboard.tsx
β”‚   └── login.tsx
β”œβ”€β”€ styles
β”‚   └── global.css
β”œβ”€β”€ config
β”‚   └── next-auth.config.ts
β”œβ”€β”€ middleware
β”‚   └── authentication.ts
β”œβ”€β”€ .env
β”œβ”€β”€ package.json
β”œβ”€β”€ README.md
β”œβ”€β”€ tailwind.config.ts
└── tsconfig.json

πŸ’» Installation

πŸ”§ Prerequisites

  • Node.js (LTS version recommended)
  • npm (or yarn)
  • A free Supabase account (for database)

πŸš€ Setup Instructions

  1. Clone the repository:
    • git clone https://github.com/coslynx/FitTrack-MVP.git
  2. Navigate to the FitTrack-MVP directory:
    • cd FitTrack-MVP
  3. Install dependencies:
    • npm install
  4. Create a .env file in the root directory of the project and add the following environment variables:
    • NEXT_PUBLIC_SUPABASE_URL: Your Supabase URL (found in the Supabase dashboard)
    • NEXT_PUBLIC_SUPABASE_KEY: Your Supabase API key (found in the Supabase dashboard)
    • NEXT_PUBLIC_GOOGLE_CLIENT_ID: Your Google Client ID for authentication
    • NEXT_PUBLIC_GOOGLE_CLIENT_SECRET: Your Google Client Secret for authentication

πŸ—οΈ Usage

πŸƒβ€β™‚οΈ Running the FitTrack MVP

  1. Start the development server:
    • npm run dev
  2. Open your browser and navigate to http://localhost:3000.

βš™οΈ Configuration

  • Adjust configurations in next.config.js for deployment settings and optimization.
  • Update the next-auth.config.ts file for authentication providers.

πŸ“š Examples

  • Setting a goal:
    • Log in to your account.
    • Navigate to the "Goals" section.
    • Enter the desired goal (e.g., "Lose 5 pounds") and specify any relevant parameters (e.g., timeframe, target weight).
    • Click "Add Goal".
  • Tracking progress:
    • Log in to your account.
    • Navigate to the "Dashboard" section.
    • Record workouts and nutrition entries for each day.
    • Visualize progress charts for different metrics.
  • Sharing achievements:
    • Log in to your account.
    • Create a post celebrating your achievements.
    • Share the post with friends who are connected on the platform.

🌐 Hosting

πŸš€ Deployment Instructions

  1. Set up a Supabase database:
    • Create a new Supabase project.
    • Create tables to store user data, goals, progress, and social interaction data.
    • Set up authentication with Supabase to enable secure user registration and login.
  2. Configure environment variables:
    • Create a .env file in the root directory of the project.
    • Replace the placeholders in the .env file with your Supabase URL, API key, and Google authentication credentials.
  3. Deploy the application:
    • Use Vercel to deploy the application:
      • vercel
    • Use Netlify:
      • netlify deploy
    • Use GitHub Pages:
      • Configure a GitHub Actions workflow for automatic deployment.

πŸ“œ API Documentation

πŸ” Endpoints

  • GET /api/auth/session: Fetches the current user session information.
  • POST /api/goals: Creates a new fitness goal for the current user.
  • GET /api/goals: Retrieves all goals for the current user.
  • PUT /api/goals/:id: Updates an existing goal.
  • DELETE /api/goals/:id: Deletes a goal.
  • POST /api/progress: Logs workout or nutrition data for the current user.
  • GET /api/progress: Retrieves the user's progress data.
  • POST /api/social/posts: Creates a new social post.
  • GET /api/social/posts: Retrieves social posts.

πŸ”’ Authentication

Use JWT tokens for authentication with NextAuth.js.

πŸ“ Examples

  • Fetching goals:
    curl -X GET http://localhost:3000/api/goals -H "Authorization: Bearer [JWT token]"

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘₯ Authors

🌐 CosLynx.com

Create Your Custom MVP in Minutes With CosLynxAI!