A web application that empowers fitness enthusiasts to set, track, and share their fitness goals with friends.
- π Overview
- π¦ Features
- π Structure
- π» Installation
- ποΈ Usage
- π Hosting
- π License
- π Authors
This repository contains a Minimum Viable Product (MVP) for a Fitness Goal Tracker and Share Hub. It's built using a modern stack, including Next.js, TypeScript, React, PostgreSQL, and utilizes custom LLMs for various functionalities.
Feature | Description | |
---|---|---|
βοΈ | Architecture | The codebase utilizes a modular architectural pattern with separate directories for different functionalities, promoting maintainability and scalability. |
π | Documentation | Comprehensive README file providing details about the MVP, its dependencies, and usage instructions. |
π | Dependencies | The codebase leverages external libraries and packages like Next.js, React, Tailwind CSS, Zustand, Prisma, and others. |
𧩠| Modularity | The modular structure allows for easier maintenance and reusability of the code, with separate directories for components, types, utils, and more. |
π§ͺ | Testing | The MVP includes unit tests for core functionalities using Jest and React Testing Library to ensure code reliability and quality. |
β‘οΈ | Performance | Performance optimizations are implemented, such as code splitting, image optimization, and efficient data fetching strategies. |
π | Security | Security is prioritized through input validation, secure data storage, and appropriate authentication mechanisms. |
π | Version Control | Git version control is used, with automated build and release processes powered by GitHub Actions workflow files. |
π | Integrations | The MVP integrates with APIs for tasks such as user authentication (Google), fitness data retrieval, and potentially social media sharing. |
πΆ | Scalability | The system is designed to handle increasing user loads and data volumes. Scalability is further improved through caching and cloud-based solutions. |
βββ pages
βββ api
βββ auth
βββ [...nextauth].js
- Node.js (LTS version recommended)
- npm (or yarn)
- Docker (optional, for local development with PostgreSQL)
- Clone the repository:
git clone https://github.com/spectra-ai-codegen/project-1723966604966-vezqdn.git
- Navigate to the project directory:
cd project-1723966604966-vezqdn
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open your browser and navigate to
http://localhost:3000
This MVP is designed to be hosted on a serverless platform like Vercel, Netlify, or AWS Lambda.
Vercel:
- Create a new Vercel project:
- Visit https://vercel.com/new
- Select "GitHub" and connect your GitHub account.
- Choose this repository.
- Follow the prompts to deploy.
- Configure environment variables:
- Create a
.env.production
file in the project root. - Add your environment variables (e.g.,
NEXT_PUBLIC_GOOGLE_CLIENT_ID
,DATABASE_URL
).
- Create a
- Deploy:
- Run
vercel
to deploy the application.
- Run
Netlify:
- Create a new Netlify site:
- Visit https://app.netlify.com/start
- Select "GitHub" and connect your GitHub account.
- Choose this repository.
- Follow the prompts to deploy.
- Configure environment variables:
- In the Netlify dashboard, go to "Site settings" > "Environment"
- Add your environment variables (e.g.,
NEXT_PUBLIC_GOOGLE_CLIENT_ID
,DATABASE_URL
).
- Deploy:
- Netlify will automatically deploy your application.
AWS Lambda:
- Set up an AWS account:
- Visit https://aws.amazon.com/
- Create an AWS Lambda function:
- Follow the instructions at https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html
- Configure the function:
- Select "Node.js" as the runtime.
- Choose a memory size and timeout.
- Upload the code:
- Create a zip file of the project directory.
- Upload the zip file to the Lambda function.
- Configure environment variables:
- Go to the Lambda function settings.
- Add your environment variables (e.g.,
NEXT_PUBLIC_GOOGLE_CLIENT_ID
,DATABASE_URL
).
- Deploy:
- Deploy the Lambda function.
Other Hosting Options:
- Heroku: Follow Heroku's deployment instructions for Node.js applications.
- Azure Functions: Follow Azure Functions' deployment instructions for Node.js.
NEXT_PUBLIC_GOOGLE_CLIENT_ID
: Your Google Client ID for OAuth.NEXT_PUBLIC_GOOGLE_CLIENT_SECRET
: Your Google Client Secret for OAuth.DATABASE_URL
: The connection string for your PostgreSQL database.
- GET /api/goals: Retrieves a list of all goals.
- POST /api/goals: Creates a new goal.
- GET /api/goals/:id: Retrieves a specific goal by ID.
- PUT /api/goals/:id: Updates a specific goal by ID.
- DELETE /api/goals/:id: Deletes a specific goal by ID.
The API uses JWT tokens for authentication and authorization. You can use next-auth
to generate and manage these tokens for users signing in with Google or with email/password.
This Minimum Viable Product (MVP) is licensed under the MIT License.
- Author Name - Spectra.codes
- Creator Name - DRIX10
Why only generate Code? When you can generate the whole Repository!