Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/coslynx/fitness-tracker-social-react-node
- Owner: coslynx
- Created: 2024-11-08T06:26:47.000Z (6 days ago)
- Default Branch: main
- Last Pushed: 2024-11-08T06:34:29.000Z (6 days ago)
- Last Synced: 2024-11-08T07:28:59.626Z (6 days ago)
- Topics: 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
- Language: TypeScript
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Fitness Tracker MVPA user-friendly web application to track fitness goals and connect with friends.
Developed with the software and tools below.
## ๐ 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!