Skip to content

Project: Core Feature Implementation and User Testing. Created at https://spectra.codes, which is owned by @Drix10

Notifications You must be signed in to change notification settings

coslynx/FitBuzz-8kfmlp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fitness Tracker

A web application for setting fitness goals, tracking progress, and fostering a community.

Developed with the software and tools below.

Framework: Next.js Frontend: TypeScript, React Backend: Node.js, Express Database: PostgreSQL
git-last-commit GitHub commit activity GitHub top language

πŸ“‘ Table of Contents

  • πŸ“ Overview
  • πŸ“¦ Features
  • πŸ“‚ Structure
  • πŸ’» Installation
  • πŸ—οΈ Usage
  • 🌐 Hosting
  • πŸ“„ License
  • πŸ‘ Authors

πŸ“ Overview

The repository contains a Minimum Viable Product (MVP) called "Fitness Tracker" that provides a comprehensive solution for fitness enthusiasts, using a combination of React, TypeScript, Node.js, Express, and PostgreSQL.

πŸ“¦ Features

Feature Description
βš™οΈ Architecture The codebase follows a modular architectural pattern with separate directories for different functionalities, ensuring easier maintenance and scalability.
πŸ“„ Documentation The repository includes a README file that provides a detailed overview of the MVP, its dependencies, and usage instructions.
πŸ”— Dependencies The codebase relies on various external libraries and packages such as React, Next.js, Prisma, and Zustand, which are essential for building and styling the UI components, handling data, and managing state.
🧩 Modularity The modular structure allows for easier maintenance and reusability of the code, with separate directories and files for different functionalities such as components, pages, and API routes.
πŸ§ͺ Testing Implement unit tests using frameworks like Jest or React Testing Library to ensure the reliability and robustness of the codebase.
⚑️ Performance The performance of the system can be optimized based on factors such as the browser and hardware being used. Consider implementing performance optimizations for better efficiency.
πŸ” Security Enhance security by implementing measures such as input validation, data encryption, and secure communication protocols.
πŸ”€ Version Control Utilizes Git for version control with GitHub Actions workflow files for automated build and release processes.
πŸ”Œ Integrations Interacts with browser APIs, external services through HTTP requests, and includes integrations with fitness tracker APIs (Fitbit, Garmin, Apple Health), social media platforms, and other relevant services.
πŸ“Ά Scalability Design the system to handle increased user load and data volume, utilizing caching strategies and cloud-based solutions for better scalability.

πŸ“‚ Structure

Fitness Tracker
β”œβ”€β”€ .env
β”œβ”€β”€ prisma
β”‚   β”œβ”€β”€ schema.prisma
β”‚   └── migrations
β”‚       └── 20231026172212_init
β”‚           β”œβ”€β”€ migration.sql
β”‚           └── _meta.json
β”œβ”€β”€ pages
β”‚   β”œβ”€β”€ api
β”‚   β”‚   β”œβ”€β”€ auth
β”‚   β”‚   β”‚   β”œβ”€β”€ [...nextauth].js
β”‚   β”‚   β”‚   └── callback.js
β”‚   β”‚   β”œβ”€β”€ workout
β”‚   β”‚   β”‚   β”œβ”€β”€ create.js
β”‚   β”‚   β”‚   β”œβ”€β”€ get.js
β”‚   β”‚   β”‚   β”œβ”€β”€ update.js
β”‚   β”‚   β”‚   └── delete.js
β”‚   β”‚   β”œβ”€β”€ goal
β”‚   β”‚   β”‚   β”œβ”€β”€ create.js
β”‚   β”‚   β”‚   β”œβ”€β”€ get.js
β”‚   β”‚   β”‚   β”œβ”€β”€ update.js
β”‚   β”‚   β”‚   └── delete.js
β”‚   β”‚   β”œβ”€β”€ nutrition
β”‚   β”‚   β”‚   β”œβ”€β”€ create.js
β”‚   β”‚   β”‚   β”œβ”€β”€ get.js
β”‚   β”‚   β”‚   β”œβ”€β”€ update.js
β”‚   β”‚   β”‚   └── delete.js
β”‚   β”‚   β”œβ”€β”€ sleep
β”‚   β”‚   β”‚   β”œβ”€β”€ create.js
β”‚   β”‚   β”‚   β”œβ”€β”€ get.js
β”‚   β”‚   β”‚   β”œβ”€β”€ update.js
β”‚   β”‚   β”‚   └── delete.js
β”‚   β”‚   β”œβ”€β”€ social
β”‚   β”‚   β”‚   β”œβ”€β”€ getPosts.js
β”‚   β”‚   β”‚   β”œβ”€β”€ createPost.js
β”‚   β”‚   β”‚   └── updatePost.js
β”‚   β”‚   β”œβ”€β”€ recommendation
β”‚   β”‚   β”‚   β”œβ”€β”€ workout.js
β”‚   β”‚   β”‚   β”œβ”€β”€ nutrition.js
β”‚   β”‚   β”‚   └── sleep.js
β”‚   β”‚   └── user
β”‚   β”‚       β”œβ”€β”€ get.js
β”‚   β”‚       └── update.js
β”‚   β”œβ”€β”€ dashboard
β”‚   β”‚   └── page.js
β”‚   β”œβ”€β”€ profile
β”‚   β”‚   └── page.js
β”‚   β”œβ”€β”€ goals
β”‚   β”‚   └── page.js
β”‚   β”œβ”€β”€ community
β”‚   β”‚   └── page.js
β”‚   β”œβ”€β”€ login
β”‚   β”‚   └── page.js
β”‚   └── register
β”‚       └── page.js
β”œβ”€β”€ components
β”‚   β”œβ”€β”€ Layout.js
β”‚   β”œβ”€β”€ Header.js
β”‚   β”œβ”€β”€ GoalCard.js
β”‚   β”œβ”€β”€ GoalList.js
β”‚   β”œβ”€β”€ ProgressChart.js
β”‚   β”œβ”€β”€ SocialFeed.js
β”‚   β”œβ”€β”€ Post.js
β”‚   β”œβ”€β”€ InputField.js
β”‚   β”œβ”€β”€ Button.js
β”‚   β”œβ”€β”€ Spinner.js
β”‚   β”œβ”€β”€ WorkoutCard.js
β”‚   β”œβ”€β”€ NutritionCard.js
β”‚   β”œβ”€β”€ SleepCard.js
β”‚   β”œβ”€β”€ RecommendationCard.js
β”‚   └── Chatbot.js
β”œβ”€β”€ public
β”‚   β”œβ”€β”€ favicon.ico
β”‚   └── vercel.json
β”œβ”€β”€ tailwind.config.js
β”œβ”€β”€ next.config.js
β”œβ”€β”€ tsconfig.json
└── README.md

πŸ’» Installation

πŸ”§ Prerequisites

  • Node.js
  • npm
  • PostgreSQL

πŸš€ Setup Instructions

  1. Clone the repository:
    • git clone https://github.com/<github account username>/Fitness-Tracker.git
  2. Navigate to the project directory:
    • cd Fitness-Tracker
  3. Install dependencies:
    • npm install
  4. Create a .env file in the project root and add the following environment variables:
    • DATABASE_URL=postgres://<your_database_user>:<your_database_password>@<your_database_host>:<your_database_port>/<your_database_name>
  5. Generate Prisma client:
    • npx prisma generate
  6. Migrate database:
    • npx prisma db push

πŸ—οΈ Usage

πŸƒβ€β™‚οΈ Running the Project

  1. Start the development server:
    • npm run dev
  2. Open your browser and navigate to http://localhost:3000.

🌐 Hosting

πŸš€ Deployment Instructions

  1. Build the project:
    • npm run build
  2. Deploy the build artifacts to your chosen hosting platform (e.g., Vercel, Netlify, Heroku).

πŸ”‘ Environment Variables

  • DATABASE_URL: Database connection string.

πŸ“œ API Documentation

πŸ” Endpoints

  • /api/auth: Handles user authentication and session management.
  • /api/workout: Endpoints for managing workout data (create, read, update, delete).
  • /api/goal: Endpoints for managing fitness goals (create, read, update, delete).
  • /api/nutrition: Endpoints for managing nutrition data (create, read, update, delete).
  • /api/sleep: Endpoints for managing sleep data (create, read, update, delete).
  • /api/social: Endpoints for social features (get posts, create posts, update posts).
  • /api/recommendation: Endpoints for personalized recommendations (workout, nutrition, sleep).
  • /api/user: Endpoints for managing user data (get, update).

πŸ”’ Authentication

Use NextAuth.js for authentication and session management.

πŸ“ Examples

  • curl -X GET http://localhost:3000/api/workout

πŸ“œ License

This project is licensed under the MIT License.

πŸ‘₯ Authors

🌐 Spectra.Codes

Why only generate Code? When you can generate the whole Repository!