A web-based application for setting, tracking, and achieving fitness goals with a supportive community.
- π Overview
- π¦ Features
- π Structure
- π» Installation
- ποΈ Usage
- π Hosting
- π License
- π Authors
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.
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. |
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
- Node.js
- npm
- Docker
- Clone the repository:
git clone https://github.com/spectra-ai-codegen/Fitrio-unsr5n.git
- Navigate to the project directory:
cd Fitrio-unsr5n
- Install dependencies:
npm install
- 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.
- Initialize Prisma:
npx prisma init
npx prisma generate
- Run the development server:
npm run dev
- Start the development server (if not already running):
npm run dev
- Open your browser and navigate to http://localhost:3000.
Adjust configuration settings in next.config.js
, tailwind.config.js
, or .env
file.
- π 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.
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
- Deploy the code:
vercel
- Follow the prompts to configure the Vercel deployment.
- Deploy the code:
netlify deploy
- Follow the prompts to configure the Netlify deployment.
- Create a new GitHub repository with the project code.
- Go to the repository's settings.
- Select "Pages" from the left-hand menu.
- Choose the "Branch" and "Folder" to deploy from (typically "gh-pages" and "docs", respectively).
- Click "Save" to deploy the project.
- Create a new AWS account (if you don't have one).
- Create a new S3 bucket to store the static assets of the project.
- Create a new CloudFront distribution to serve the content from the S3 bucket.
- Configure the CloudFront distribution to use the appropriate origin (S3 bucket).
- Deploy the code to the S3 bucket.
- Create a new Google Cloud project.
- Create a new Cloud Storage bucket to store the static assets of the project.
- Create a new Cloud CDN service to serve the content from the Cloud Storage bucket.
- Configure the Cloud CDN service to use the appropriate origin (Cloud Storage bucket).
- Deploy the code to the Cloud Storage bucket.
NEXT_PUBLIC_SENTRY_DSN
: The DSN for your Sentry project (optional, for error tracking).DATABASE_URL
: The connection string for your PostgreSQL database.
- 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.
The API uses JWT tokens for authentication.
curl -X GET http://localhost:3000/api/goals
This project is licensed under the MIT License.
- Author Name - Spectra.codes
- Creator Name - DRIX10
Why only generate Code? When you can generate the whole Repository!