Skip to content

Project: Core Feature Implementation and Initial User Testing. Created at https://spectra.codes, which is owned by @Drix10

Notifications You must be signed in to change notification settings

coslynx/fitness-tracker-web-app-mvp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

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

Repository files navigation

fitness-tracker-web-app-mvp

A web application designed to empower individuals to reach their fitness goals

Developed with the software and tools below.

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 "fitness-tracker-web-app-mvp" that provides a comprehensive solution using the following tech stack: Next.js, React, JavaScript, HTML, CSS, Node.js, MongoDB, and Tailwind CSS.

πŸ“¦ Features

Feature Description
βš™οΈ Architecture The codebase follows a modular architectural pattern with separate directories for different functionalities, ensuring easier maintenance and scalability.
πŸ“„ Documentation The repository includes a README file that provides a detailed overview of the Minimum Viable Product (MVP), its dependencies, and usage instructions.
πŸ”— Dependencies The codebase relies on various external libraries and packages such as React, Next.js, MongoDB, Tailwind CSS, and NextAuth.js, which are essential for building and styling the UI components, handling authentication, and managing database interactions.
🧩 Modularity The modular structure allows for easier maintenance and reusability of the code, with separate directories and files for different functionalities such as components, pages, and utility functions.
πŸ§ͺ Testing Implement unit tests using frameworks like Jest or React Testing Library to ensure the reliability and robustness of the codebase.
⚑️ Performance The performance of the system can be optimized based on factors such as the browser and hardware being used. Consider implementing performance optimizations for better efficiency.
πŸ” Security Enhance security by implementing measures such as input validation, data encryption, and secure communication protocols.
πŸ”€ Version Control Utilizes Git for version control with GitHub Actions workflow files for automated build and release processes.
πŸ”Œ Integrations Interacts with browser APIs, external services through HTTP requests, and includes integrations with fitness tracking and social media APIs.
πŸ“Ά Scalability Design the system to handle increased user load and data volume, utilizing caching strategies and cloud-based solutions for better scalability.

πŸ“‚ Structure

fitness-tracker-web-app-mvp
β”œβ”€β”€ components
β”‚   β”œβ”€β”€ Header.js
β”‚   β”œβ”€β”€ Footer.js
β”‚   β”œβ”€β”€ GoalCard.js
β”‚   β”œβ”€β”€ WorkoutLog.js
β”‚   β”œβ”€β”€ SocialFeed.js
β”‚   └── Navigation.js
β”œβ”€β”€ pages
β”‚   β”œβ”€β”€ index.js
β”‚   β”œβ”€β”€ login.js
β”‚   β”œβ”€β”€ signup.js
β”‚   β”œβ”€β”€ goals.js
β”‚   β”œβ”€β”€ progress.js
β”‚   └── community.js
β”œβ”€β”€ lib
β”‚   β”œβ”€β”€ db.js
β”‚   β”œβ”€β”€ auth.js
β”‚   └── utils.js
β”œβ”€β”€ styles
β”‚   β”œβ”€β”€ global.css
β”‚   └── tailwind.config.js
β”œβ”€β”€ public
β”‚   β”œβ”€β”€ index.html
β”‚   └── favicon.ico
β”œβ”€β”€ package.json
└── README.md

πŸ’» Installation

πŸ”§ Prerequisites

  • Node.js
  • npm
  • Docker (Optional, for deployment)

πŸš€ Setup Instructions

  1. Clone the repository:
    • git clone https://github.com/<github account username>/fitness-tracker-web-app-mvp.git
  2. Navigate to the project directory:
    • cd fitness-tracker-web-app-mvp
  3. Install dependencies:
    • npm install
  4. (Optional) Configure environment variables:
    • Create a .env.local file in the project root.
    • Add the following environment variables (replace placeholders with your actual values):
      • NEXT_PUBLIC_GOOGLE_CLIENT_ID (For Google OAuth integration)
      • NEXT_PUBLIC_GOOGLE_CLIENT_SECRET (For Google OAuth integration)
      • MONGODB_URI (For MongoDB connection)

πŸ—οΈ Usage

πŸƒβ€β™‚οΈ Running the Minimum Viable Product (MVP)

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

βš™οΈ Configuration

  • You can adjust configuration settings for the project in the next.config.js file and the .env.local file.

πŸ“š Examples

  • πŸ“ Example 1: How to create a new fitness goal
  • πŸ“ Example 2: How to log a workout session
  • πŸ“ Example 3: How to share progress with friends

🌐 Hosting

πŸš€ Deployment Instructions

Vercel

  1. Install the Vercel CLI:
    • npm install -g vercel
  2. Login to Vercel:
    • vercel login
  3. Initialize Vercel for the project:
    • vercel init
  4. Deploy the project:
    • vercel

Netlify

  1. Create a Netlify account and install the Netlify CLI:
    • npm install -g netlify-cli
  2. Login to Netlify:
    • netlify login
  3. Initialize Netlify for the project:
    • netlify init
  4. Deploy the project:
    • netlify deploy

GitHub Pages

  1. Create a new GitHub repository and push your code.
  2. In the repository settings, go to Pages.
  3. Select the branch and folder for your deployment (usually gh-pages or docs).
  4. Click "Save."

AWS

  1. Create an AWS account and configure the necessary services, including S3, CloudFront, and EC2.
  2. Build and deploy your application to an S3 bucket.
  3. Configure CloudFront to serve your application content from the S3 bucket.
  4. Set up a domain name and route traffic to your CloudFront distribution.

Google Cloud

  1. Create a Google Cloud account and configure the necessary services, including App Engine, Cloud Storage, and Cloud SQL.
  2. Deploy your application to App Engine.
  3. Configure Cloud Storage to store your application assets.
  4. Set up a domain name and route traffic to your App Engine application.

πŸ”‘ Environment Variables

  • NEXT_PUBLIC_GOOGLE_CLIENT_ID: Google OAuth Client ID (replace with your actual ID)
  • NEXT_PUBLIC_GOOGLE_CLIENT_SECRET: Google OAuth Client Secret (replace with your actual secret)
  • MONGODB_URI: MongoDB connection URI (replace with your actual URI)
  • NEXTAUTH_URL: The URL of your application (replace with your actual URL)
  • NEXTAUTH_SECRET: A secret used for signing JWTs (replace with a unique secret)

πŸ“œ API Documentation

πŸ” Endpoints

  • GET /api/goals: Retrieves a list of fitness goals for the current user.
  • POST /api/goals: Creates a new fitness goal for the current user.
  • PUT /api/goals/:id: Updates a specific fitness goal for the current user.
  • DELETE /api/goals/:id: Deletes a specific fitness goal for the current user.
  • GET /api/workouts: Retrieves a list of workouts logged by the current user.
  • POST /api/workouts: Creates a new workout entry for the current user.
  • PUT /api/workouts/:id: Updates a specific workout entry for the current user.
  • DELETE /api/workouts/:id: Deletes a specific workout entry for the current user.

πŸ”’ Authentication

User authentication is handled using the NextAuth.js library. Users can sign up and log in using their email and password or by connecting their Google account.

πŸ“ Examples

# Get a list of goals for the current user
curl -X GET 'http://localhost:3000/api/goals' \
-H 'Authorization: Bearer <your_jwt_token>'

# Create a new workout entry
curl -X POST 'http://localhost:3000/api/workouts' \
-H 'Authorization: Bearer <your_jwt_token>' \
-H 'Content-Type: application/json' \
-d '{
  "type": "Running",
  "date": "2023-10-26",
  "duration": 30,
  "distance": 3,
  "caloriesBurned": 300
}'

πŸ“œ License

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

πŸ‘₯ Authors

🌐 Spectra.Codes

Why only generate Code? When you can generate the whole Repository!