Skip to content

Track fitness goals progress share achievements FitGo... Created at https://coslynx.com

Notifications You must be signed in to change notification settings

coslynx/FitGo-goal-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fitness Tracking MVP

Markdown Folder Icon

FitGo-goal-tracker

Web application for tracking fitness goals, progress, and social sharing.

Developed with the software and tools below.

React JavaScript, HTML, CSS Node.js Custom LLMs, Gemini, OpenAI
git-last-commit GitHub commit activity GitHub top language

πŸ“‘ Table of Contents

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

πŸ“ Overview

The repository contains a Minimum Viable Product (MVP) called "FitGo-goal-tracker" that provides a comprehensive solution for fitness enthusiasts to track their goals, progress, and share achievements with friends. The MVP is built using a tech stack that includes React, JavaScript, HTML, CSS, Node.js, and Custom LLMs including Gemini and OpenAI.

πŸ“¦ Features

Feature Description
βš™οΈ Architecture The codebase follows a modular architectural pattern with separate directories for different functionalities, such as user authentication, goal management, progress tracking, and social sharing. This ensures easier maintenance and scalability.
πŸ“„ Documentation The repository includes a comprehensive README file that provides an overview of the Minimum Viable Product (MVP), its dependencies, and detailed usage instructions.
πŸ”— Dependencies The codebase relies on various external libraries and packages such as React, Axios, Mongoose, and Tailwind CSS. These dependencies are essential for building and styling the UI components, handling API requests, and managing the database.
🧩 Modularity The modular structure allows for easier maintenance and reusability of the code, with separate directories and files for different functionalities such as authentication, goal management, progress tracking, and social sharing.
πŸ§ͺ Testing The MVP includes unit tests using frameworks like Jest and React Testing Library to ensure the reliability and robustness of the codebase.
⚑️ Performance The application is designed with performance in mind, utilizing techniques such as code splitting, memoization, and asynchronous data fetching to optimize the user experience.
πŸ” Security The MVP implements security best practices, including input validation, data encryption, and secure communication protocols to protect user data and prevent common vulnerabilities.
πŸ”€ Version Control The codebase is managed using Git for version control, with GitHub Actions workflow files for automated build and release processes.
πŸ”Œ Integrations The application integrates with various external services, such as social media platforms for goal sharing, and leverages browser APIs for features like progress tracking and reminders.
πŸ“Ά Scalability The system is designed to handle increased user load and data volume, utilizing caching strategies and cloud-based solutions for better scalability.

πŸ“‚ Structure

β”œβ”€β”€ src
β”‚   β”œβ”€β”€ components
β”‚   β”‚   β”œβ”€β”€ Button.tsx
β”‚   β”‚   β”œβ”€β”€ Input.tsx
β”‚   β”‚   └── Modal.tsx
β”‚   β”œβ”€β”€ hooks
β”‚   β”‚   β”œβ”€β”€ useAuth.ts
β”‚   β”‚   └── useGoals.ts
β”‚   β”œβ”€β”€ pages
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx
β”‚   β”‚   β”œβ”€β”€ Goals.tsx
β”‚   β”‚   └── Profile.tsx
β”‚   β”œβ”€β”€ services
β”‚   β”‚   β”œβ”€β”€ api.ts
β”‚   β”‚   β”œβ”€β”€ authService.ts
β”‚   β”‚   └── goalService.ts
β”‚   β”œβ”€β”€ types
β”‚   β”‚   β”œβ”€β”€ auth.ts
β”‚   β”‚   └── goals.ts
β”‚   └── utils
β”‚       β”œβ”€β”€ helpers.ts
β”‚       └── validators.ts
β”œβ”€β”€ public
β”‚   └── index.html
β”œβ”€β”€ .env
β”œβ”€β”€ package.json
β”œβ”€β”€ README.md
β”œβ”€β”€ startup.sh
└── commands.json

πŸ’» Installation

Warning

πŸ”§ Prerequisites

  • Node.js v16+
  • npm v8+
  • MongoDB v5.0+

πŸš€ Setup Instructions

  1. Clone the repository:

    git clone https://github.com/coslynx/FitGo-goal-tracker.git
    cd FitGo-goal-tracker
  2. Install dependencies:

    npm install
  3. Set up the database:

    # Start the MongoDB database
    docker-compose up -d mongodb
    
    # Run database migrations
    npm run migrate
  4. Configure environment variables:

    cp .env.example .env
    # Fill in the necessary environment variables, such as MONGODB_URI, JWT_SECRET, and API_KEY

πŸ—οΈ Usage

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

  1. Start the development server:

    npm run dev
  2. Start the API server:

    npm run api
  3. Access the application:

Tip

βš™οΈ Configuration

  • The .env file contains the necessary environment variables for the application, such as the database connection string, JWT secret, and API keys.
  • Modify the values in the .env file to match your specific setup.

πŸ“š Examples

Here are some examples of using the MVP's core features:

  • User Registration:

    curl -X POST http://localhost:3000/api/auth/register \
         -H "Content-Type: application/json" \
         -d '{"username": "newuser", "email": "user@example.com", "password": "securepass123"}'
  • Setting a Fitness 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"}'
  • Logging Progress:

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

🌐 Hosting

πŸš€ Deployment Instructions

Deploying the Fitness Tracking MVP to Heroku:

  1. Install the Heroku CLI:

    npm install -g heroku
  2. Login to Heroku:

    heroku login
  3. Create a new Heroku app:

    heroku create FitGo-goal-tracker-production
  4. Set up environment variables:

    heroku config:set NODE_ENV=production
    heroku config:set MONGODB_URI=your_mongodb_uri_here
    heroku config:set JWT_SECRET=your_jwt_secret_here
  5. Deploy the code:

    git push heroku main
  6. Run database migrations (if applicable):

    heroku run npm run migrate

πŸ”‘ Environment Variables

The following environment variables are required for the Fitness Tracking MVP:

  • MONGODB_URI: Connection string for the MongoDB database Example: mongodb://user:password@host:port/database
  • JWT_SECRET: Secret key for JWT token generation Example: your-256-bit-secret
  • API_KEY: Key for external API integration (if applicable) Example: abcdef123456

πŸ“œ API Documentation

πŸ” Endpoints

The Fitness Tracking MVP provides the following API 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/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 }
  • POST /api/progress

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

    • Description: Retrieve the user's fitness goals
    • Headers: Authorization: Bearer TOKEN
    • Response: [{ "id": string, "type": string, "target": number, "deadline": date, "progress": number }]

πŸ”’ Authentication

The Fitness Tracking MVP uses JSON Web Tokens (JWT) for authentication. Here's how it works:

  1. Register a new user or login to receive a JWT token.
  2. Include the token in the Authorization header for all protected routes:
    Authorization: Bearer YOUR_JWT_TOKEN
    
  3. The token will expire after a certain period, and you'll need to request a new token using the refresh token (if applicable).

πŸ“ Examples

Here are some examples of using the Fitness Tracking MVP's API:

# 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
}

Note

πŸ“œ 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: FitGo-goal-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!