- 📍 Overview
- 📦 Features
- 📂 Structure
- 💻 Installation
- 🏗️ Usage
- 🌐 Hosting
- 📄 License
- 👏 Authors
This repository houses a Minimum Viable Product (MVP) for a Fitness Tracker application. The MVP is designed to empower users with personalized goal setting, detailed progress tracking, and a vibrant social community.
The project leverages a modern tech stack, including:
- Frontend: React, Next.js, Tailwind CSS
- Backend: Node.js, Express.js
- Database: PostgreSQL
- State Management: Zustand
- Authentication: NextAuth.js
Feature | Description | |
---|---|---|
🔐 | User Authentication | Secure login and signup using email and password, with support for potential social login integrations in future iterations. |
🎯 | Goal Setting | Users can create personalized fitness goals with specific targets, deadlines, and measurable metrics. |
📊 | Progress Tracking | Track workout logs, including activity type, duration, calories burned, and other relevant metrics. |
📈 | Data Visualization | Visualize progress towards goals using charts and graphs for a clear understanding of achievements. |
💬 | Social Sharing | Share workout logs and progress updates with friends and followers to build motivation and accountability within a community. |
Fitness-Tracker-MVP-Personalized
├── src
│ ├── components
│ │ ├── Button.tsx
│ │ ├── Header.tsx
│ │ ├── Layout.tsx
│ │ ├── GoalInput.tsx
│ │ ├── ProgressChart.tsx
│ │ └── SocialShareButton.tsx
│ ├── pages
│ │ ├── _app.tsx
│ │ ├── index.tsx
│ │ ├── dashboard.tsx
│ │ └── login.tsx
│ │ └── index.tsx
│ ├── styles
│ │ └── global.css
│ ├── utils
│ │ ├── helpers.ts
│ │ ├── api.ts
│ │ ├── auth.ts
│ │ └── validation.ts
│ └── config
│ └── next-auth.config.ts
└── middleware
└── authentication.ts
- Node.js (LTS version recommended)
- npm (or yarn)
- PostgreSQL (with a running instance)
-
Clone the repository:
git clone https://github.com/coslynx/Fitness-Tracker-MVP-Personalized.git
-
Navigate to the project directory:
cd Fitness-Tracker-MVP-Personalized
-
Install dependencies:
npm install
-
Create a
.env
file (example):cp .env.example .env
- Update the
.env
file with your PostgreSQL credentials.
- Update the
-
Start the development server:
npm run dev
-
Open your browser and navigate to: http://localhost:3000.
- Configure the database connection in your
.env
file. - Adjust other settings as needed (e.g., social media API keys, if applicable).
-
📝 Example 1: Setting a Fitness Goal
- Login to the application.
- Navigate to the "Goals" section.
- Click the "Add Goal" button.
- Enter a goal name (e.g., "Lose 10 pounds"), target value (e.g., "10"), and deadline (e.g., "2024-12-31").
- Submit the goal.
-
📝 Example 2: Logging a Workout
- Login to the application.
- Navigate to the "Workouts" section.
- Click the "Log Workout" button.
- Select the activity type (e.g., "Running").
- Enter the workout duration (e.g., "30 minutes").
- Submit the workout log.
-
📝 Example 3: Sharing Workout Progress
- Login to the application.
- Navigate to your workout logs.
- Click the "Share" button next to a specific workout entry.
- Choose your preferred social media platform to share your progress.
-
Login to Vercel:
-
Import project:
- Click the "Import Project" button and select the
Fitness-Tracker-MVP-Personalized
directory. - Follow the Vercel instructions to configure your project and deploy.
- Click the "Import Project" button and select the
-
Login to Netlify:
-
Import project:
- Click the "New site from Git" button.
- Connect your GitHub account and select the
Fitness-Tracker-MVP-Personalized
repository. - Follow the Netlify instructions to configure your project and deploy.
-
Create a
gh-pages
branch:git checkout -b gh-pages
-
Install the
gh-pages
package:npm install gh-pages --save-dev
-
Configure the
gh-pages
package:- Update your
package.json
file with the following:"scripts": { "deploy": "gh-pages -d build" }
- Update your
-
Build the application:
npm run build
-
Deploy to GitHub Pages:
npm run deploy
-
Push the changes to the
gh-pages
branch:git push origin gh-pages
-
Create an AWS account (if you don't have one):
-
Create an S3 bucket:
- Go to the S3 console and create a new bucket.
-
Configure an S3 bucket website:
- In the S3 bucket settings, enable "Static website hosting" and configure the index document (
index.html
).
- In the S3 bucket settings, enable "Static website hosting" and configure the index document (
-
Deploy the build files:
- Use the AWS CLI or a tool like the AWS S3 plugin for VS Code to upload the build files (from the
build
directory) to the S3 bucket.
- Use the AWS CLI or a tool like the AWS S3 plugin for VS Code to upload the build files (from the
-
Configure a CloudFront distribution (optional):
- Set up a CloudFront distribution to serve your S3 website content with a custom domain name and caching.
-
Create a Google Cloud Platform (GCP) account (if you don't have one):
-
Create a Cloud Storage bucket:
- Go to the Cloud Storage console and create a new bucket.
-
Configure a website on Cloud Storage:
- In the Cloud Storage bucket settings, enable "Website hosting" and configure the index document (
index.html
).
- In the Cloud Storage bucket settings, enable "Website hosting" and configure the index document (
-
Deploy the build files:
- Use the Google Cloud Storage CLI or a tool like the Google Cloud Storage plugin for VS Code to upload the build files (from the
build
directory) to the Cloud Storage bucket.
- Use the Google Cloud Storage CLI or a tool like the Google Cloud Storage plugin for VS Code to upload the build files (from the
-
Configure a Cloud CDN (optional):
- Use Cloud CDN to cache and accelerate your Cloud Storage website content.
NEXT_PUBLIC_APP_NAME
: Your application name (displayed in the header).NEXT_PUBLIC_APP_DESCRIPTION
: Your application description (displayed in the header).DATABASE_URL
: Your PostgreSQL database URL (e.g.,postgres://username:password@host:port/database_name
).
GET /api/goals
: Retrieves a list of goals for the current user.POST /api/goals
: Creates a new goal for the current user.GET /api/goals/:id
: Retrieves a specific goal by its ID.PUT /api/goals/:id
: Updates an existing goal by its ID.DELETE /api/goals/:id
: Deletes a goal by its ID.POST /api/workouts
: Logs a new workout for the current user.GET /api/workouts
: Retrieves a list of workouts for the current user.GET /api/workouts/:id
: Retrieves a specific workout by its ID.PUT /api/workouts/:id
: Updates an existing workout by its ID.DELETE /api/workouts/:id
: Deletes a workout by its ID.
- The API endpoints require authentication.
- Authentication is handled through NextAuth.js, using JWT tokens for session management.
# Get all goals
curl -X GET -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:3000/api/goals
# Create a new goal
curl -X POST -H "Authorization: Bearer YOUR_JWT_TOKEN" -H "Content-Type: application/json" -d '{"name": "Lose 10 pounds", "target": "10", "deadline": "2024-12-31"}' http://localhost:3000/api/goals
# Log a new workout
curl -X POST -H "Authorization: Bearer YOUR_JWT_TOKEN" -H "Content-Type: application/json" -d '{"type": "Running", "duration": "30 minutes"}' http://localhost:3000/api/workouts
This Minimum Viable Product (MVP) is licensed under the GNU AGPLv3 license.
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-Personalized
For any questions or concerns regarding this AI-generated MVP, please contact CosLynx at:
- Website: CosLynx.com
- Twitter: @CosLynxAI
Create Your Custom MVP in Minutes With CosLynxAI!