Skip to content

Set fitness goals, track progress, achieve targets, and share your journey with friends... Created at https://coslynx.com

Notifications You must be signed in to change notification settings

coslynx/Fitness-Tracker-Social-React-Node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fitness Tracker MVP

A user-friendly web application to track fitness goals and connect with friends.

Developed with the software and tools below.

Framework: React Frontend: Javascript, HTML, CSS Backend: Node.js LLMs: Custom, Gemini, OpenAI
git-last-commit GitHub commit activity GitHub top language

πŸ“‘ Table of Contents

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

πŸ“ Overview

This repository houses the Minimum Viable Product (MVP) for a Fitness Tracker web application. It provides a foundation for fitness enthusiasts to track their progress towards their goals, stay motivated, and share their achievements with friends. The MVP is built using a robust and scalable architecture with React on the frontend and Node.js on the backend, complemented by a custom LLM for personalized features.

πŸ“¦ Features

Feature Description
πŸ”’ Secure Authentication Users can create accounts and securely log in, ensuring data privacy and personalized experiences.
🎯 Goal Setting Users can define personalized fitness goals, set target values, and track their progress.
πŸ“Š Progress Tracking Users can log workouts, activities, and nutrition, enabling detailed progress monitoring and analysis.
🀝 Social Sharing Users can connect with friends, share their achievements, and offer support, creating a motivating community.
πŸ“± Responsive Design The application adapts seamlessly to various devices, providing a consistent user experience across desktops, tablets, and mobile phones.
⚑️ Performance Optimized for fast loading times and smooth user interaction, ensuring a seamless user experience.
πŸ”„ Scalability Designed to handle a growing user base and accommodate future feature additions.
🌐 Accessibility Responsive design for seamless use on various devices.
πŸ§ͺ Testing Extensive unit and integration tests ensure code quality and robustness.

πŸ“‚ Structure

fitness-tracker-mvp/
β”œβ”€β”€ apps/
β”‚   └── client/
β”‚       └── src/
β”‚           └── ...
β”œβ”€β”€ packages/
β”‚   └── auth/
β”‚       └── src/
β”‚           └── ...
β”œβ”€β”€ packages/
β”‚   └── database/
β”‚       └── src/
β”‚           └── ...
└── ...

πŸ’» Installation

πŸ”§ Prerequisites

  • Node.js v18+
  • npm 8+
  • PostgreSQL 15+

πŸš€ Setup Instructions

  1. Clone the repository:
    git clone https://github.com/coslynx/Fitness-Tracker-MVP.git
    cd Fitness-Tracker-MVP
  2. Install dependencies:
    npm install
  3. Set up the database:
    [Provide specific commands for database setup, e.g., migrations]
  4. Configure environment variables:
    cp .env.example .env
    [Instruct to fill in necessary environment variables]

πŸ—οΈ Usage

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

  1. Start the development server:

    npm run dev
  2. [Provide any additional steps needed to fully run the MVP, e.g., starting a database, running a separate API server, etc.]

  3. Access the application:

βš™οΈ Configuration

  • .env: Contains environment variables for development, testing, and production.
    • NEXT_PUBLIC_API_URL: Public API URL for frontend communication.
    • DATABASE_URL: Connection string for the PostgreSQL database.
    • JWT_SECRET: Secret key for JWT token signing.

🌐 Hosting

πŸš€ Deployment Instructions

Deploying 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 fitness-tracker-mvp-production
  4. Set up environment variables:
    heroku config:set NODE_ENV=production
    heroku config:set DATABASE_URL=your_database_url_here
    [Add any other necessary environment variables]
  5. Deploy the code:
    git push heroku main
  6. Run database migrations (if applicable):
    heroku run npm run migrate

πŸ”‘ Environment Variables

  • DATABASE_URL: Connection string for the PostgreSQL database Example: postgresql://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

  • POST /api/auth/register

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

    • Description: Authenticate a user
    • Body: { "email": string, "password": string }
    • Response: { "token": string }
  • GET /api/auth/user

    • Description: Retrieve user data
    • Headers: Authorization: Bearer TOKEN
    • Response: { "id": string, "email": string }
  • POST /api/goals

    • Description: Create a new fitness goal
    • Headers: Authorization: Bearer TOKEN
    • Body: { "description": string, "targetValue": string, "deadline": Date }
    • Response: { "id": string, "description": string, "targetValue": string, "deadline": Date }
  • GET /api/goals

    • Description: Retrieve all goals for a user
    • Headers: Authorization: Bearer TOKEN
    • Response: [{ "id": string, "description": string, "targetValue": string, "deadline": Date }]
  • POST /api/workouts

    • Description: Log a new workout
    • Headers: Authorization: Bearer TOKEN
    • Body: { "date": Date, "duration": string, "activity": string, "intensity": string, "notes": string }
    • Response: { "id": string, "date": Date, "duration": string, "activity": string, "intensity": string, "notes": string }
  • GET /api/workouts

    • Description: Retrieve all workouts for a user
    • Headers: Authorization: Bearer TOKEN
    • Response: [{ "id": string, "date": Date, "duration": string, "activity": string, "intensity": string, "notes": string }]

πŸ”’ Authentication

  1. Users must register a new account or log in to receive a JWT token.
  2. Include the token in the Authorization header for all protected routes:
    Authorization: Bearer YOUR_JWT_TOKEN
    

πŸ“ Examples

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

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

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

# Response
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

# Retrieve user data
curl -X GET http://localhost:3000/api/auth/user \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

# Response
{
  "id": "user123",
  "email": "user@example.com"
}

# Create a new goal
curl -X POST http://localhost:3000/api/goals \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{"description": "Lose 5 pounds", "targetValue": "5", "deadline": "2024-01-01"}'

# Response
{
  "id": "goal123",
  "description": "Lose 5 pounds",
  "targetValue": "5",
  "deadline": "2024-01-01"
}

# Log a new workout
curl -X POST http://localhost:3000/api/workouts \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -d '{"date": "2023-12-15", "duration": "30", "activity": "Cardio", "intensity": "Medium", "notes": "Ran 3 miles"}'

# Response
{
  "id": "workout123",
  "date": "2023-12-15",
  "duration": "30",
  "activity": "Cardio",
  "intensity": "Medium",
  "notes": "Ran 3 miles"
}

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

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