Web application that allows users to set fitness goals, track their progress, and connect with a community of like-minded individuals.
- π Overview
- π¦ Features
- π Structure
- π» Installation
- ποΈ Usage
- π Hosting
- π License
- π Authors
This repository contains the code for a Minimum Viable Product (MVP) of a fitness tracker web application. The application focuses on providing users a convenient and engaging way to set fitness goals, track their progress, and connect with a community of other fitness enthusiasts. This MVP was developed with a tech stack of Next.js, TypeScript, PostgreSQL, Tailwind CSS, and Zustand. It leverages a RESTful API built with Express.js for backend operations and utilizes NextAuth.js for user authentication.
Feature | Description | |
---|---|---|
βοΈ | Architecture | The codebase follows a modular architectural pattern with separate directories for different functionalities, ensuring easier maintenance and scalability. |
π | Documentation | This README file provides a comprehensive overview of the Minimum Viable Product (MVP), its dependencies, and usage instructions. |
π | Dependencies | The codebase relies on various external libraries and packages such as React, Zustand, Next.js, Tailwind CSS, and Prisma Client, which are essential for building and styling the UI components, managing application state, and interacting with the database. |
𧩠| Modularity | The modular structure allows for easier maintenance and reusability of the code, with separate directories and files for different functionalities such as pages, components, API routes, and database schemas. |
π§ͺ | 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 potentially includes integrations with fitness tracker APIs for automatic data import. |
πΆ | Scalability | Design the system to handle increased user load and data volume, utilizing caching strategies and cloud-based solutions for better scalability. |
FitTrack-ipgtb7
βββ pages
β βββ api
β β βββ auth
β β β βββ [...nextauth].js
β β βββ goals
β β β βββ [id].js
β β β βββ index.js
β β βββ activities
β β β βββ [id].js
β β β βββ index.js
β β βββ users
β β β βββ [id].js
β β βββ profile
β β βββ [id].js
β βββ dashboard
β β βββ page.jsx
β βββ goal
β β βββ page.jsx
β βββ activity
β β βββ page.jsx
β βββ social
β β βββ page.jsx
β βββ settings
β βββ page.jsx
βββ components
β βββ Header.jsx
β βββ Footer.jsx
β βββ GoalCard.jsx
β βββ ActivityCard.jsx
β βββ SocialCard.jsx
β βββ ProgressChart.jsx
β βββ Navigation.jsx
β βββ UserProfile.jsx
βββ prisma
β βββ schema.prisma
β βββ migrations
β βββ 20231026171918_init
β βββ migration.sql
β βββ migration.ts
βββ styles
β βββ globals.css
βββ public
β βββ favicon.ico
βββ next.config.js
- Node.js
- npm
- Docker (optional for local development)
- Clone the repository:
git clone https://github.com/spectra-ai-codegen/FitTrack-ipgtb7.git
- Navigate to the project directory:
cd FitTrack-ipgtb7
- Install dependencies:
npm install
- (Optional) If you want to set up a local PostgreSQL database, follow these steps:
- Install PostgreSQL:
- Use your operating system's package manager to install PostgreSQL.
- Create a database:
- Use
psql
to connect to PostgreSQL and create a new database.
- Use
- Configure environment variables:
- In the root directory of the project, create a file named
.env
and add the following environment variables:
DATABASE_URL=postgresql://user:password@host:port/database
- Replace the placeholders with your actual database credentials.
- In the root directory of the project, create a file named
- Install PostgreSQL:
- Start the development server:
npm run dev
- Open your browser and navigate to http://localhost:3000.
- Environment Variables:
- Configure the following environment variables in the
.env
file (create this file if it doesn't exist):DATABASE_URL
: The connection string for your PostgreSQL database.NEXTAUTH_URL
: The base URL for your application (e.g.,http://localhost:3000
).NEXTAUTH_SECRET
: A secret key for secure session management.- (Optional)
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
: If you are using Google authentication, configure these variables with your Google API credentials.
- Configure the following environment variables in the
- Database Setup:
- Make sure you have PostgreSQL installed and running.
- If you're using a different database, you'll need to adjust the Prisma schema and configuration.
- Create a new goal:
- Access the "Goals" page.
- Fill out the goal creation form with a title, description, and target date.
- Click "Create Goal".
- Track your progress:
- Access the "Activities" page.
- Log your workouts manually or connect a fitness tracker to automatically import activity data.
- View your progress towards your goals on the "Dashboard" page.
- Connect with friends:
- Access the "Social" page.
- Connect with friends by entering their email addresses or using Google authentication.
- Share your progress updates with your friends and participate in fitness challenges.
You can deploy this application to a variety of hosting platforms. Here's a guide for deploying to Vercel:
Vercel Deployment:
- Create a Vercel account: If you don't have one already, visit https://vercel.com and sign up.
- Install Vercel CLI: Install the Vercel CLI globally using
npm install -g vercel
. - Initialize Vercel project: Run
vercel init
in your project's root directory. - Deploy to Vercel: Run
vercel deploy
to deploy your project to Vercel. Follow the prompts to configure your deployment. - Configure environment variables: Go to your Vercel dashboard, select your project, and configure environment variables like
DATABASE_URL
,NEXTAUTH_URL
,NEXTAUTH_SECRET
, and potentially your Google API credentials.
Other Hosting Platforms:
- You can adapt the deployment instructions for platforms like Netlify, GitHub Pages, AWS, Google Cloud, or other hosting providers. Consult their respective documentation for specific deployment guides.
- For Heroku or other cloud platforms, you may need to set up a database instance separately and configure the application to connect to it.
DATABASE_URL
: The connection string for your PostgreSQL database (configure in your hosting platform's environment variables).NEXTAUTH_URL
: The base URL for your application (configure in your hosting platform's environment variables).NEXTAUTH_SECRET
: A secret key for secure session management (configure in your hosting platform's environment variables).- (Optional)
GOOGLE_CLIENT_ID
andGOOGLE_CLIENT_SECRET
: If you are using Google authentication, configure these variables with your Google API credentials (configure in your hosting platform's environment variables).
This Minimum Viable Product (MVP) is licensed under the GNU AGPLv3.
- Author Name - Spectra.codes
- Creator Name - DRIX10
Why only generate Code? When you can generate the whole Repository!