Skip to content

Set fitness goals, track progress, and share achievements with friends... Created at https://coslynx.com

Notifications You must be signed in to change notification settings

coslynx/Fitness-Tracker-Social-Progress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fitness Tracker

Empower your fitness journey with a user-friendly web application for tracking progress, setting goals, and connecting with a community.

Developed with the software and tools below.

Framework: Next.js Frontend: React UI: Material UI State: Context API
git-last-commit GitHub commit activity GitHub top language

πŸ“‘ Table of Contents

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

πŸ“ Overview

The repository houses the Fitness Tracker MVP, a web application built with a focus on user experience, data privacy, and scalability. The application leverages the power of React for a robust front-end, Material UI for a visually appealing interface, and local storage for streamlined user data management.

πŸ“¦ Features

Feature Description
πŸ” Secure Authentication The application implements secure user authentication and registration, allowing users to create accounts and manage their personal fitness data.
🎯 Personalized Goal Setting Users can define their fitness goals, including weight loss, distance targets, or muscle gain, and track progress towards achieving them.
πŸ“Š Progress Tracking Users can track their weight, body measurements, workouts, and other relevant metrics to monitor their progress and stay motivated.
🀝 Social Sharing Users can share their achievements and progress with friends and family through social media integration, fostering a sense of community.
🎨 Responsive Design The application adapts seamlessly to different screen sizes, ensuring a smooth user experience across desktop, tablet, and mobile devices.
πŸ—ƒοΈ Data Storage User data, goals, and progress are stored locally using localForage for efficient and secure data handling.
⚑ Performance Optimization The application is optimized for speed and responsiveness, leveraging Next.js's server-side rendering and code splitting features.

πŸ“‚ Structure

fitness-tracker/
β”œβ”€β”€ apps/
β”‚   └── web/
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   β”œβ”€β”€ components/
β”‚       β”‚   β”‚   β”œβ”€β”€ LoginForm.jsx
β”‚       β”‚   β”‚   β”œβ”€β”€ DashboardStats.jsx
β”‚       β”‚   β”‚   β”œβ”€β”€ GoalList.jsx
β”‚       β”‚   β”‚   β”œβ”€β”€ Header.jsx
β”‚       β”‚   β”‚   β”œβ”€β”€ Button.jsx
β”‚       β”‚   β”‚   β”œβ”€β”€ GoalCreationForm.jsx
β”‚       β”‚   β”‚   └── ...
β”‚       β”‚   β”œβ”€β”€ pages/
β”‚       β”‚   β”‚   β”œβ”€β”€ Home.jsx
β”‚       β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx
β”‚       β”‚   β”‚   β”œβ”€β”€ Goals.jsx
β”‚       β”‚   β”‚   β”œβ”€β”€ Profile.jsx
β”‚       β”‚   β”‚   └── ...
β”‚       β”‚   β”œβ”€β”€ hooks/
β”‚       β”‚   β”‚   β”œβ”€β”€ useAuth.js
β”‚       β”‚   β”‚   β”œβ”€β”€ useFetch.js
β”‚       β”‚   β”‚   └── ...
β”‚       β”‚   β”œβ”€β”€ context/
β”‚       β”‚   β”‚   β”œβ”€β”€ AuthContext.js
β”‚       β”‚   β”‚   └── ...
β”‚       β”‚   β”œβ”€β”€ services/
β”‚       β”‚   β”‚   β”œβ”€β”€ api.js
β”‚       β”‚   β”‚   β”œβ”€β”€ auth.js
β”‚       β”‚   β”‚   └── ...
β”‚       β”‚   β”œβ”€β”€ utils/
β”‚       β”‚   β”‚   β”œβ”€β”€ helpers.js
β”‚       β”‚   β”‚   β”œβ”€β”€ validators.js
β”‚       β”‚   β”‚   └── ...
β”‚       β”‚   └── styles/
β”‚       β”‚       └── global.css
β”‚       β”œβ”€β”€ public/
β”‚       β”‚   β”œβ”€β”€ index.html
β”‚       β”‚   └── favicon.ico
β”‚       └── ...
└── packages/
    └── shared/
        β”œβ”€β”€ components/
        β”‚   β”œβ”€β”€ ...
        β”œβ”€β”€ hooks/
        β”‚   β”œβ”€β”€ ...
        └── utils/
            β”œβ”€β”€ ...
            └── localForageService.js

πŸ’» Installation

πŸ”§ Prerequisites

  • Node.js v16+
  • npm 7+
  • A code editor (e.g., VS Code, Sublime Text)

πŸš€ Setup Instructions

  1. Clone the repository:

    git clone https://github.com/coslynx/Fitness-Tracker.git
    cd Fitness-Tracker
  2. Install dependencies:

    npm install
  3. Configure environment variables:

    cp .env.example .env
    • Update the .env file with your desired environment variables, such as the API URL and any external service keys.

πŸ—οΈ Usage

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

  1. Start the development server:

    npm run dev
  2. Access the application:

🌐 Hosting

πŸš€ Deployment Instructions

  1. Build the application:

    npm run build
  2. Deploy to a suitable platform:

πŸ”‘ Environment Variables

  • NEXT_PUBLIC_API_URL: URL of your API endpoint (if applicable).
    • Example: http://your-api-endpoint.com
  • [Add any other environment variables specific to your deployment configuration.]

πŸ“œ API Documentation

πŸ” Endpoints

  • POST /api/auth/register

    • Description: Register a new user
    • Body: { "username": string, "email": string, "password": string }
    • Response: { "id": string, "username": string, "email": string, "token": string }
  • POST /api/auth/login

    • Description: Log in an existing user
    • Body: { "email": string, "password": string }
    • Response: { "id": string, "username": string, "email": string, "token": string }
  • POST /api/goals

    • Description: Create a new fitness goal
    • Headers: Authorization: Bearer TOKEN
    • Body: { "type": string, "target": number, "deadline": date }
    • Response: { "id": string, "type": string, "target": number, "deadline": date, "progress": number }
  • GET /api/goals

    • Description: Get all user goals
    • Headers: Authorization: Bearer TOKEN
    • Response: [ { "id": string, "type": string, "target": number, "deadline": date, "progress": number }, ...]
  • PUT /api/goals/:id

    • Description: Update a specific goal
    • Headers: Authorization: Bearer TOKEN
    • Body: { "type": string, "target": number, "deadline": date }
    • Response: { "id": string, "type": string, "target": number, "deadline": date, "progress": number }
  • DELETE /api/goals/:id

    • Description: Delete a specific goal
    • Headers: Authorization: Bearer TOKEN
    • Response: {}
  • GET /api/progress

    • Description: Get user progress data
    • Headers: Authorization: Bearer TOKEN
    • Response: [ { "goalId": string, "value": number, "date": date }, ...]
  • POST /api/progress

    • Description: Log progress for a specific goal
    • Headers: Authorization: Bearer TOKEN
    • Body: { "goalId": string, "value": number, "date": date }
    • Response: {}
  • GET /api/profile

    • Description: Get user profile information
    • Headers: Authorization: Bearer TOKEN
    • Response: { "username": string, "email": string, "photoURL": string, "goals": [ ... ], "progress": [ ... ] }
  • PUT /api/profile

    • Description: Update user profile information
    • Headers: Authorization: Bearer TOKEN
    • Body: { "username": string, "email": string, "photoURL": string }
    • Response: { "username": string, "email": string, "photoURL": string }

πŸ”’ Authentication

  1. Register a new user or log in to receive a JWT token.

  2. Include the token in the Authorization header for all protected API requests:

    Authorization: Bearer YOUR_JWT_TOKEN
    
  3. The token will expire after a certain time (e.g., 1 hour). You can implement a token refresh mechanism if needed.

πŸ“ Examples

# Register a new user
curl -X POST http://localhost:3000/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"username": "fitnessuser", "email": "user@example.com", "password": "securepass123"}'

# Response
{
  "id": "user123",
  "username": "fitnessuser",
  "email": "user@example.com",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

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

# Response
{
  "id": "goal123",
  "type": "weight_loss",
  "target": 10,
  "deadline": "2023-12-31",
  "progress": 0
}

# Log progress for a goal
curl -X POST http://localhost:3000/api/progress \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{"goalId": "goal123", "value": 2, "date": "2023-06-15"}'

# Update user profile
curl -X PUT http://localhost:3000/api/profile \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{"username": "updatedusername", "email": "updated@example.com", "photoURL": "https://example.com/profile-pic.jpg"}'

πŸ“œ 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

πŸ“ž 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!