Empower your fitness journey with a user-friendly web application for tracking progress, setting goals, and connecting with a community.
- π Overview
- π¦ Features
- π Structure
- π» Installation
- ποΈ Usage
- π Hosting
- π License
- π Authors
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.
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. |
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
- Node.js v16+
- npm 7+
- A code editor (e.g., VS Code, Sublime Text)
-
Clone the repository:
git clone https://github.com/coslynx/Fitness-Tracker.git cd Fitness-Tracker
-
Install dependencies:
npm install
-
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.
- Update the
-
Start the development server:
npm run dev
-
Access the application:
- Open http://localhost:3000 in your web browser.
-
Build the application:
npm run build
-
Deploy to a suitable platform:
-
Netlify: https://app.netlify.com/start/
-
GitHub Pages: https://pages.github.com/
-
For each platform, follow the specific deployment instructions provided in their documentation.
NEXT_PUBLIC_API_URL
: URL of your API endpoint (if applicable).- Example:
http://your-api-endpoint.com
- Example:
- [Add any other environment variables specific to your deployment configuration.]
-
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 }
-
Register a new user or log in to receive a JWT token.
-
Include the token in the
Authorization
header for all protected API requests:Authorization: Bearer YOUR_JWT_TOKEN
-
The token will expire after a certain time (e.g., 1 hour). You can implement a token refresh mechanism if needed.
# 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"}'
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
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!