LinkFit is a social fitness application that connects fitness enthusiasts and enables them to participate in a 100-day fitness challenge, share their progress, and connect with a community of like-minded individuals.
- Key Features
- Technologies
- Installation & Setup
- Project Structure
- API Documentation
- Testing
- Contributing
- Daily Challenges: Receive a new exercise challenge every day for 100 days
- Progress Tracking: Track your completed days and overall progress
- Personalized Exercises: AI-generated challenges using OpenAI, tailored to your fitness level
- Posts & Images: Share your fitness journey with photos and text
- Social Interactions:
- Like posts
- Comment and engage in discussions
- Follow other users
- User Profiles: Create a personalized profile with picture, bio, and personal information
- Badge System: Earn badges based on achievements and progress
- Achievement Tracking: View all your badges and accomplishments
- Share Achievements: Share your achievements with the community
- News Feed: View posts from all users
- Today's Challenge: Quick access to the daily challenge
- Statistics: View your progress and fitness statistics
- Save favorite posts for quick access later
- Sign Up & Login: Complete authentication system
- Firebase Authentication: Support for Google sign-in
- Security: Data protection with JWT tokens
- React 19 - Modern UI library
- TypeScript - Type-safe development
- Vite - Fast build tool
- React Router - Page navigation
- Firebase Auth - User authentication
- Axios - HTTP requests
- SASS/SCSS - Advanced styling
- Font Awesome - Icons
- Node.js - Runtime environment
- Express.js - API framework
- TypeScript - Type-safe development
- MongoDB - NoSQL database
- Mongoose - MongoDB ODM
- JWT - Token authentication
- bcryptjs - Password hashing
- Multer - File uploads
- OpenAI API - Exercise challenge generation
- Swagger - API documentation
- Jest - Unit testing
- ESLint - Code quality
- dotenv - Environment variables
- Node.js (version 18 or higher)
- npm or yarn
- MongoDB (local or Atlas)
- Firebase account (for authentication)
- OpenAI API key (for challenge generation)
git clone <repository-url>
cd LinkFitBackend:
cd server
npm installFrontend:
cd ../client
npm installCreate a .env file in the server/ directory:
# Database
MONGODB_URI=mongodb://localhost:27017/linkfit
# Or
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/linkfit
# Server
PORT=3000
NODE_ENV=development
# JWT
JWT_SECRET=your-secret-key-here
# OpenAI
OPENAI_API_KEY=your-openai-api-key-here
# HTTPS (for production)
HTTPS_PORT=443Development:
cd server
npm run devProduction:
cd server
npm run build
npm startThe server will run on http://localhost:3000
Development:
cd client
npm run devThe application will run on http://localhost:5173
Build for Production:
cd client
npm run buildFiles will be built to the server/client-dist/ directory
LinkFit/
βββ client/ # Frontend - React Application
β βββ src/
β β βββ components/ # React Components
β β β βββ Achievements/
β β β βββ Dashboard/
β β β βββ HomePage/
β β β βββ Profile/
β β β βββ Post/
β β β βββ ...
β β βββ contexts/ # React Contexts
β β βββ httpService.ts # HTTP Service
β β βββ App.tsx # Main Component
β βββ public/ # Static Files
β βββ package.json
β
βββ server/ # Backend - Express API
β βββ src/
β β βββ config/ # Configuration (DB, Swagger)
β β βββ controllers/ # Controllers
β β βββ models/ # MongoDB Models
β β βββ routes/ # API Routes
β β βββ middleware/ # Middleware (Auth, etc.)
β β βββ index.ts # Entry Point
β βββ uploads/ # Uploaded Files
β βββ package.json
β
βββ README.md
After running the server, you can access Swagger documentation at:
http://localhost:3000/api-docs
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/check- Check user statusPOST /api/auth/google- Google sign-in
GET /api/user- Get all usersGET /api/user/:id- Get specific userPUT /api/user- Update profilePOST /api/user/upload-picture- Upload profile picture
GET /api/post- Get all posts (with pagination)POST /api/post- Create new postPUT /api/post/:id/like- Like/unlike postDELETE /api/post/:id- Delete post
POST /api/comment- Add commentDELETE /api/comment/:id- Delete comment
GET /api/exercises/challenge/:day- Get challenge for specific dayPOST /api/exercises/complete- Mark challenge as completedGET /api/exercises/progress- Get user progress
Run tests:
cd server
npm testRun tests in watch mode:
npm run test:watch- Private messaging between users
- Fitness groups
- Custom challenges
- Integration with fitness devices (Apple Watch, Fitbit)
- Mobile application (React Native)
- Notification system
- Leaderboard and competitions
Contributions are welcome! Please:
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available under the MIT license.
For questions, suggestions, or support, please open an issue on GitHub.
Thanks to all contributors and users who help make this project successful!
LinkFit - Connect your fitness with the community! πͺ