- π Overview
- π¦ Features
- π Structure
- π» Installation
- ποΈ Usage
- π Hosting
- π License
- π Authors
This repository contains the code for a Minimum Viable Product (MVP) of FitTrack, a web application aimed at simplifying fitness goal tracking and achievement sharing. It leverages the power of a modern tech stack: Next.js for frontend development, Node.js for backend functionality, and a PostgreSQL database for data storage. FitTrack offers a user-friendly interface and social features that encourage motivation and community engagement.
Feature | Description | |
---|---|---|
π | User Authentication | Secure user registration and login using email/password or Google Sign-in. |
π― | Goal Setting | Define personalized fitness goals with specific parameters, such as target weight, workout frequency, or distance. |
π | Progress Tracking | Track workouts, nutrition, and overall progress towards goals, with detailed visualizations. |
π€ | Social Sharing | Share achievements, progress updates, and motivational messages with friends within the app. |
FitTrack-MVP
βββ app
β βββ layout
β β βββ page.js
β βββ page
β βββ index.js
βββ components
β βββ Header.jsx
β βββ GoalInput.jsx
β βββ ProgressChart.jsx
β βββ SocialShareButton.jsx
β βββ Button.jsx
βββ lib
β βββ auth.ts
β βββ api.ts
βββ pages
β βββ api
β β βββ auth.ts
β β βββ goals.ts
β β βββ progress.ts
β βββ _app.tsx
β βββ index.tsx
β βββ dashboard.tsx
β βββ login.tsx
βββ styles
β βββ global.css
βββ config
β βββ next-auth.config.ts
βββ middleware
β βββ authentication.ts
βββ .env
βββ package.json
βββ README.md
βββ tailwind.config.ts
βββ tsconfig.json
- Node.js (LTS version recommended)
- npm (or yarn)
- A free Supabase account (for database)
- Clone the repository:
git clone https://github.com/coslynx/FitTrack-MVP.git
- Navigate to the FitTrack-MVP directory:
cd FitTrack-MVP
- Install dependencies:
npm install
- Create a
.env
file in the root directory of the project and add the following environment variables:NEXT_PUBLIC_SUPABASE_URL
: Your Supabase URL (found in the Supabase dashboard)NEXT_PUBLIC_SUPABASE_KEY
: Your Supabase API key (found in the Supabase dashboard)NEXT_PUBLIC_GOOGLE_CLIENT_ID
: Your Google Client ID for authenticationNEXT_PUBLIC_GOOGLE_CLIENT_SECRET
: Your Google Client Secret for authentication
- Start the development server:
npm run dev
- Open your browser and navigate to
http://localhost:3000
.
- Adjust configurations in
next.config.js
for deployment settings and optimization. - Update the
next-auth.config.ts
file for authentication providers.
- Setting a goal:
- Log in to your account.
- Navigate to the "Goals" section.
- Enter the desired goal (e.g., "Lose 5 pounds") and specify any relevant parameters (e.g., timeframe, target weight).
- Click "Add Goal".
- Tracking progress:
- Log in to your account.
- Navigate to the "Dashboard" section.
- Record workouts and nutrition entries for each day.
- Visualize progress charts for different metrics.
- Sharing achievements:
- Log in to your account.
- Create a post celebrating your achievements.
- Share the post with friends who are connected on the platform.
- Set up a Supabase database:
- Create a new Supabase project.
- Create tables to store user data, goals, progress, and social interaction data.
- Set up authentication with Supabase to enable secure user registration and login.
- Configure environment variables:
- Create a
.env
file in the root directory of the project. - Replace the placeholders in the
.env
file with your Supabase URL, API key, and Google authentication credentials.
- Create a
- Deploy the application:
- Use Vercel to deploy the application:
vercel
- Use Netlify:
netlify deploy
- Use GitHub Pages:
- Configure a GitHub Actions workflow for automatic deployment.
- Use Vercel to deploy the application:
- GET /api/auth/session: Fetches the current user session information.
- POST /api/goals: Creates a new fitness goal for the current user.
- GET /api/goals: Retrieves all goals for the current user.
- PUT /api/goals/:id: Updates an existing goal.
- DELETE /api/goals/:id: Deletes a goal.
- POST /api/progress: Logs workout or nutrition data for the current user.
- GET /api/progress: Retrieves the user's progress data.
- POST /api/social/posts: Creates a new social post.
- GET /api/social/posts: Retrieves social posts.
Use JWT tokens for authentication with NextAuth.js.
- Fetching goals:
curl -X GET http://localhost:3000/api/goals -H "Authorization: Bearer [JWT token]"
This project is licensed under the MIT License - see the LICENSE file for details.
- Author Name - CosLynx.com
- Creator Name - CosLynxAI
Create Your Custom MVP in Minutes With CosLynxAI!