Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/coslynx/fitness-tracker-social-react-node

Set fitness goals, track progress, achieve targets, and share your journey with friends... Created at https://coslynx.com
https://github.com/coslynx/fitness-tracker-social-react-node

api-development code-generation coslynx developer-tools devops express fitness-app fitness-tracker goal-tracking javascript machine-learning mvp nodejs postgresql react react-app social-fitness supabase workout-tracker

Last synced: 6 days ago
JSON representation

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

Awesome Lists containing this project

README

        




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

```text
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:
```bash
git clone https://github.com/coslynx/Fitness-Tracker-MVP.git
cd Fitness-Tracker-MVP
```
2. Install dependencies:
```bash
npm install
```
3. Set up the database:
```bash
[Provide specific commands for database setup, e.g., migrations]
```
4. Configure environment variables:
```bash
cp .env.example .env
[Instruct to fill in necessary environment variables]
```

## ๐Ÿ—๏ธ Usage

### ๐Ÿƒโ€โ™‚๏ธ Running the MVP

1. Start the development server:
```bash
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:
- Web interface: [http://localhost:3000](http://localhost:3000)
- API endpoint: [http://localhost:3000/api](http://localhost:3000/api)

### โš™๏ธ 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:
```bash
npm install -g heroku
```
2. Login to Heroku:
```bash
heroku login
```
3. Create a new Heroku app:
```bash
heroku create fitness-tracker-mvp-production
```
4. Set up environment variables:
```bash
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:
```bash
git push heroku main
```
6. Run database migrations (if applicable):
```bash
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

```bash
# Register a new user
curl -X POST http://localhost:3000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "password": "securepass123"}'

# Response
{
"id": "user123",
"email": "[email protected]",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

# Login
curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]", "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": "[email protected]"
}

# 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](https://choosealicense.com/licenses/agpl-3.0/) license.

### ๐Ÿค– AI-Generated MVP

This MVP was entirely generated using artificial intelligence through [CosLynx.com](https://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:
- Website: [CosLynx.com](https://coslynx.com)
- Twitter: [@CosLynxAI](https://x.com/CosLynxAI)


๐ŸŒ CosLynx.com


Create Your Custom MVP in Minutes With CosLynxAI!