Skip to content

Project: Rapid Prototyping for Concept Validation. Created at https://spectra.codes, which is owned by @Drix10

Notifications You must be signed in to change notification settings

coslynx/Fitrio-unsr5n

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

28 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Fitrio-unsr5n

A web-based application for setting, tracking, and achieving fitness goals with a supportive community.

Developed with the software and tools below.

Framework: Next.js Frontend: TypeScript, HTML, CSS Backend: Node.js Database: PostgreSQL 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

The repository contains a Minimum Viable Product (MVP) called "Fitrio-unsr5n" that provides a comprehensive solution for users to set, track, and achieve their fitness goals. The platform fosters a sense of community and motivation by enabling users to share their progress with friends and fellow fitness enthusiasts.

πŸ“¦ 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 Minimum Viable Product (MVP), its dependencies, and usage instructions.
πŸ”— Dependencies The codebase relies on various external libraries and packages such as Next.js, React, Zustand, Tailwind CSS, Prisma, and Sentry, which are essential for building and styling the UI components, managing state, and handling external services.
🧩 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, hooks, and utilities.
πŸ§ͺ 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 for automatic data synchronization.
πŸ“Ά Scalability Design the system to handle increased user load and data volume, utilizing caching strategies and cloud-based solutions for better scalability.

πŸ“‚ Structure

Fitrio-unsr5n/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ Dashboard/
β”‚   β”‚   β”‚   β”œβ”€β”€ GoalCard.js
β”‚   β”‚   β”‚   └── ActivityLog.js
β”‚   β”‚   β”œβ”€β”€ GoalSetting/
β”‚   β”‚   β”‚   β”œβ”€β”€ GoalForm.js
β”‚   β”‚   β”‚   └── GoalTypeDropdown.js
β”‚   β”‚   β”œβ”€β”€ SocialFeed/
β”‚   β”‚   β”‚   β”œβ”€β”€ PostItem.js
β”‚   β”‚   β”‚   └── PostForm.js
β”‚   β”‚   β”œβ”€β”€ Navigation/
β”‚   β”‚   β”‚   └── NavBar.js
β”‚   β”‚   └── Auth/
β”‚   β”‚       └── Login.js
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   β”œβ”€β”€ goals.js
β”‚   β”‚   └── profile.js
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useGoal.js
β”‚   β”‚   β”œβ”€β”€ useActivity.js
β”‚   β”‚   β”œβ”€β”€ useUser.js
β”‚   β”‚   └── useAuth.js
β”‚   β”œβ”€β”€ layouts/
β”‚   β”‚   └── MainLayout.js
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ constants.js
β”‚   β”‚   β”œβ”€β”€ api.js
β”‚   β”‚   β”œβ”€β”€ helpers.js
β”‚   β”‚   └── validations.js
β”‚   └── styles/
β”‚       └── globals.css
β”œβ”€β”€ prisma/
β”‚   └── schema.prisma
β”œβ”€β”€ .eslintrc.js
β”œβ”€β”€ next.config.js
β”œβ”€β”€ tailwind.config.js
β”œβ”€β”€ tsconfig.json
β”œβ”€β”€ jest.config.js
└── README.md

πŸ’» Installation

πŸ”§ Prerequisites

  • Node.js
  • npm
  • Docker

πŸš€ Setup Instructions

  1. Clone the repository:
    • git clone https://github.com/spectra-ai-codegen/Fitrio-unsr5n.git
  2. Navigate to the project directory:
    • cd Fitrio-unsr5n
  3. Install dependencies:
    • npm install
  4. Set up the database:
    • Create a PostgreSQL database instance (using Docker or your preferred method).
    • Create a .env file in the root directory and configure the following environment variables:
      • DATABASE_URL: The connection string for your PostgreSQL database.
  5. Initialize Prisma:
    • npx prisma init
    • npx prisma generate
  6. Run the development server:
    • npm run dev

πŸ—οΈ Usage

πŸƒβ€β™‚οΈ Running the Minimum Viable Product (MVP)

  1. Start the development server (if not already running):
    • npm run dev
  2. Open your browser and navigate to http://localhost:3000.

βš™οΈ Configuration

Adjust configuration settings in next.config.js, tailwind.config.js, or .env file.

πŸ“š Examples

  • πŸ“ Example 1: Setting a Weight Loss Goal
    • Users can create a new goal by selecting "Weight Loss" from the goal type dropdown, entering their target weight, and choosing a start and end date.
  • πŸ“ Example 2: Tracking Running Progress
    • Users can connect their fitness trackers (e.g., Fitbit, Apple Watch) to automatically log their running activities and visualize their progress in charts and graphs.
  • πŸ“ Example 3: Sharing Achievements with Friends
    • Users can share their workout updates, achievements, and progress with friends and fellow fitness enthusiasts on the social feed, fostering a supportive community.

🌐 Hosting

πŸš€ Deployment Instructions

If applicable, provide details on how to host the Minimum Viable Product (MVP) using various services, such as:

Vercel Netlify GitHub Pages AWS Google Cloud

Vercel

  1. Deploy the code:
    • vercel
  2. Follow the prompts to configure the Vercel deployment.

Netlify

  1. Deploy the code:
    • netlify deploy
  2. Follow the prompts to configure the Netlify deployment.

GitHub Pages

  1. Create a new GitHub repository with the project code.
  2. Go to the repository's settings.
  3. Select "Pages" from the left-hand menu.
  4. Choose the "Branch" and "Folder" to deploy from (typically "gh-pages" and "docs", respectively).
  5. Click "Save" to deploy the project.

AWS

  1. Create a new AWS account (if you don't have one).
  2. Create a new S3 bucket to store the static assets of the project.
  3. Create a new CloudFront distribution to serve the content from the S3 bucket.
  4. Configure the CloudFront distribution to use the appropriate origin (S3 bucket).
  5. Deploy the code to the S3 bucket.

Google Cloud

  1. Create a new Google Cloud project.
  2. Create a new Cloud Storage bucket to store the static assets of the project.
  3. Create a new Cloud CDN service to serve the content from the Cloud Storage bucket.
  4. Configure the Cloud CDN service to use the appropriate origin (Cloud Storage bucket).
  5. Deploy the code to the Cloud Storage bucket.

πŸ”‘ Environment Variables

  • NEXT_PUBLIC_SENTRY_DSN: The DSN for your Sentry project (optional, for error tracking).
  • DATABASE_URL: The connection string for your PostgreSQL database.

πŸ“œ API Documentation

πŸ” Endpoints

  • GET /api/goals: Retrieves a list of user's goals.
  • POST /api/goals: Creates a new goal for the user.
  • GET /api/goals/:id: Retrieves a specific goal by its ID.
  • PUT /api/goals/:id: Updates an existing goal by its ID.
  • DELETE /api/goals/:id: Deletes a goal by its ID.
  • GET /api/activities: Retrieves a list of user's activities.
  • POST /api/activities: Creates a new activity log for the user.
  • GET /api/activities/:id: Retrieves a specific activity by its ID.
  • PUT /api/activities/:id: Updates an existing activity by its ID.
  • DELETE /api/activities/:id: Deletes an activity by its ID.

πŸ”’ Authentication

The API uses JWT tokens for authentication.

πŸ“ Examples

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

πŸ“œ License

This project is licensed under the MIT License.

πŸ‘₯ Authors

🌐 Spectra.Codes

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

Developer: Drix10 Website: Spectra.codes Backed by: Google, Microsoft & Amazon for Startups Finalist: Backdrop Build v4