This repository contains the backend code for the FormFixer project, a user management system built with Node.js and MongoDB. The backend is designed to handle authentication, registration, profile management, and file uploads while maintaining a clean and modular code structure.
- JavaScript (Node.js for backend)
- Express.js: Backend routing and middleware management.
- Multer: Handles file uploads.
- MongoDB: Stores user data securely.
- dotenv: Manages environment variables.
- bcrypt: Hashes passwords for secure storage.
- jsonwebtoken: Implements user authentication using JSON Web Tokens.
- nodemailer: Sends email notifications and verification links.
├── Backend
│ ├── Database
│ │ └── Connect.js # MongoDB connection
│ ├── Helpers
│ │ └── Time.js # Date and time utility functions
│ ├── Middleware
│ │ ├── JwtAuth.js # JWT-based authentication middleware
│ │ └── Logger.js # Logs incoming requests with timestamps
│ ├── Routes
│ │ └── UserRoutes.js # User-related routes (registration, login, profile update)
│ ├── Services
│ │ ├── EmailService.js # Email handling service using Nodemailer
│ │ └── SecurityService.js # Password hashing and verification service
│ └── index.js # Main server entry point
-
Authentication:
- Implements JWT-based authentication to secure routes.
- Verifies tokens before granting access to restricted resources.
-
User Registration:
- Accepts user details, hashes passwords with
bcrypt, and stores them in MongoDB. - Sends an email verification link during registration.
- Accepts user details, hashes passwords with
-
Login Functionality:
- Authenticates users by verifying email and password.
- Issues a JWT token for session management.
-
Profile Picture Upload:
- Allows users to upload a profile picture.
- Saves the file on the server and updates the user's profile in MongoDB.
-
Utilities:
- Custom Date Formatting: Utility functions to handle date and time operations.
- Request Logging: Logs incoming requests with timestamps for debugging and monitoring.
-
Modular Design:
- Code is organized into reusable modules (e.g., database connection, middleware, services) for maintainability and scalability.
Connect.js: Establishes a connection to the MongoDB database and exports theFormFixerdatabase instance.
Time.js: Provides utility methods for formatting dates, converting to 12-hour time, and comparing dates.
JwtAuth.js: Middleware for verifying JSON Web Tokens in requests.Logger.js: Logs incoming requests with timestamps using theCustomDateutility.
UserRoutes.js:- Register: Handles user registration, hashes passwords, and sends email verification links.
- Login: Authenticates users and generates JWT tokens.
- Profile Picture Upload: Updates the user's profile picture and stores it in the database.
EmailService.js: Sends emails usingnodemailer(e.g., verification emails).SecurityService.js: Handles password hashing and verification withbcrypt.
index.js:- Sets up Express middleware, routes, and serves static files.
- Starts the server and listens for incoming connections.
This repository contains the frontend code for the FormFixer project, a fitness-focused AI application that helps users master exercise forms using video analysis. The application is built using React Native and Expo for a seamless mobile experience.
- TypeScript and JavaScript (React Native for frontend development)
- Expo: For cross-platform app development.
- React Native Vision Camera: Provides video processing and camera functionality.
- TensorFlow Lite: Runs machine learning models on-device for real-time pose estimation.
- Skia: Handles drawing and rendering.
- Expo Router: Provides routing for navigation.
- Haptics API: Adds tactile feedback for user interactions.
- Custom fonts (
Bakbakone.ttf,Inter.ttf, andRoboto-Regular.ttf). - Background images, icons, and placeholders for enhanced UI.
├── Frontend
│ ├── app
│ │ ├── (tabs)
│ │ │ ├── AccountSettingPage.tsx # User account management page
│ │ │ ├── Home.tsx # Main dashboard with forms and progress
│ │ │ ├── Settings.tsx # User settings page
│ │ │ ├── Video.tsx # Video analysis page with TensorFlow Lite integration
│ │ │ ├── _layout.tsx # Tab layout for navigation
│ │ ├── +not-found.tsx # 404 error page
│ │ ├── _layout.tsx # Root layout with font loading and splash screen
│ │ ├── hooks
│ │ │ ├── GlobalStyleContext.tsx # Customizable global styles (colors, fonts)
│ │ │ ├── UserContext.tsx # User context for authentication and profile data
│ │ ├── index.tsx # Login page
│ │ ├── register.tsx # Registration page
│ │ └── forgotPassword.tsx # Password reset page
│ ├── assets # Fonts and images
│ │ ├── fonts
│ │ │ ├── Bakbakone.ttf
│ │ │ ├── Inter.ttf
│ │ │ └── Roboto-Regular.ttf
│ │ ├── images
│ │ ├── loginbg.jpg # Login background
│ │ ├── signupbg.png # Signup background
│ │ ├── homebg.png # Home page background
│ │ ├── graph.png # Graph icon for progress
│ │ ├── check.png # Checkmark icon for completed forms
│ │ ├── benchpress.jpg # Example exercise image
│ │ └── splashscreen_logo.png # Splash screen logo
│ ├── Fetchers # API request utilities
│ │ ├── Auth
│ │ │ ├── AuthDelete.ts
│ │ │ ├── AuthGet.ts
│ │ │ ├── AuthPost.ts
│ │ │ ├── AuthPut.ts
│ │ ├── NoAuth
│ │ ├── Get.ts
│ │ ├── Post.ts
│ │ ├── Put.ts
│ ├── .env # Environment variables
│ ├── build_instructions.txt # Build setup instructions
│ ├── package.json # Project dependencies
│ ├── tsconfig.json # TypeScript configuration
│ └── metro.config.js # Expo Metro bundler configuration
- Login/Register: Allows users to securely create accounts and log in.
- Forgot Password: Enables users to reset their passwords using email verification.
- User Context: Maintains session state and user profile data.
- Real-Time Pose Estimation: Processes user movements with TensorFlow Lite for fitness feedback.
- Confidence Threshold Control: Adjustable settings for upper and lower body pose detection.
- Customizable Overlay: Displays keypoints and connections in real-time.
- Modern Design: Clean, dark-themed UI with red and white accents.
- Progress Dashboard: Tracks forms mastered and remaining exercises.
- Custom Fonts and Assets: Enhances readability and aesthetic appeal.
- Tabs: Includes
Home,Settings, andVideosections. - 404 Page: Handles undefined routes gracefully.
- Centralized styling for consistent UI elements across the app.
- Customizable colors, font sizes, and font families via
GlobalStyleContext.
Home.tsx: Displays progress, mastered forms, and exercise options.Video.tsx: Processes real-time video for pose analysis.Settings.tsx: Allows users to manage notifications, profile pictures, and account settings.AccountSettingPage.tsx: Handles user-specific details and updates.
GlobalStyleContext.tsx: Centralized styles for colors, fonts, and sizes.UserContext.tsx: Manages user authentication and profile data.
Fetchers/Auth: Handles authenticated API requests (e.g., login, profile updates).Fetchers/NoAuth: Manages non-authenticated requests (e.g., forgot password).

