Fitlog is a GenAI-powered workout tracking application that allows users to log their routines, workouts, and sets. The app includes features like fuzzy search for routine and workout names, powered by Fuse.js, and integrates Prisma for database management. This is a MERN-stack application built using Next.js for server-side rendering.
- User Authentication: User signup and login using Clerk.
- Routine and Workout Tracking: Create routines, log workouts, and track sets.
- Fuzzy Search: Implements fuzzy search with Fuse.js for retrieving routine and workout IDs based on user input.
- AI Chat Integration: Chat with an AI-powered assistant to log workouts and get fitness insights.
- Responsive UI: Built with Mantine UI and styled with Tailwind CSS for a modern and responsive design.
- Next.js: React framework for building server-rendered applications.
- Prisma: ORM for interacting with a PostgreSQL database.
- Clerk: Authentication service for handling user sessions.
- Fuse.js: Fuzzy search functionality to enhance search experience for routines and workouts.
- Mantine UI: UI library for modern React components.
- Tailwind CSS: Utility-first CSS framework for styling.
- TypeScript: For static type-checking in the project.
- LangChain: AI integration for chat-based workout assistance.
Here is the database schema for tracking user routines, workouts, and sets:
- User: Contains
user_id
,username
, andpassword
. - Routine: Contains
routine_id
,routine_name
, anduser_id
. A routine has multiple workouts. - Workout: Contains
workout_id
,workout_name
,routine_id
, anddate
. A workout has multiple sets. - Set: Contains
set_id
,set_weight
,set_reps
,workout_id
, anddate
.
-
Clone the repository:
git clone https://github.com/yourusername/fitlog.git
-
Navigate into the project directory:
cd fitlog
-
Install dependencies:
npm install
-
Set up environment variables by creating a .env file. Add your Prisma database URL, Clerk credentials, and other required environment variables:
DATABASE_URL="your_postgres_database_url" NEXT_PUBLIC_CLERK_FRONTEND_API="your_clerk_frontend_api" CLERK_API_KEY="your_clerk_api_key" GROQ_API_KEY="Groq Api Key" NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/ NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/ NEXT_PUBLIC_CLERK_SIGN_IN_URL=/login NEXT_PUBLIC_CLERK_SIGN_UP_URL=/signup
-
Apply Prisma migrations to your database:
npx prisma migrate dev
-
Run the development server:
npm run dev
Open your browser and go to http://localhost:3000 to see the app in action.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Feel free to fork the repository and submit pull requests. Contributions are welcome!
Future Enhancements
Advanced Analytics: Integrate charts and analytics for users to visualize their workout progress.
GenAI Improvements: Enhance the AI assistant with personalized workout recommendations.
Mobile App: Plan to extend the web app into a mobile application using React Native.
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.