Skip to content

narainkarthikv/fit-track

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸƒβ€β™‚οΈ Fit-Track

Welcome to Fit-Track, your go-to exercise log-tracking application built with the MERN (MongoDB, Express, React+Vite) stack with Bootstrap CSS Framework. Whether you're a beginner or a pro, your contribution is welcome! 🀍🀝

GitHub issues GitHub forks GitHub stars MIT License

πŸ“š About

Fit-Track lets you:

  • Track and log your daily exercises and workouts
  • Monitor your fitness progress over time
  • View detailed exercise statistics and analytics
  • Join a community of fitness enthusiasts

πŸ› οΈ Tech Stack

Frontend
Backend
CI/CD

πŸ“š Table of Contents

Installation

Frontend

  1. Navigate to the frontend directory:
    cd frontend
  2. Install the dependencies:
    npm install
  3. Start the development server:
    npm run dev

Backend

  1. Navigate to the backend directory:
    cd backend
  2. Install the dependencies:
    npm install
  3. Setup MongoDB Atlas:
    1. Go to MongoDB Atlas and create an account if you don't already have one.
    2. Create a new cluster by following the prompts. Mongo Atlas Cluster Creation Tutorial
    3. Once the cluster is created, go to the Database Access section and create a user with the necessary privileges.
    4. Go to Network Access and allow your IP address (or allow access from anywhere if testing locally).
    5. In the Clusters section, click Connect, then choose Connect your application. You'll see a connection string that looks like this:
      mongodb+srv://<username>:<password>@cluster0.mongodb.net/?retryWrites=true&w=majority
      
    6. Replace <username> and <password> with your actual MongoDB Atlas username and password. Copy the entire connection string.
  4. Add MongoDB ATLAS_URI to .env file:
    • Create a .env file in the backend directory.
    • Add the following line to the .env file, replacing <your-mongodb-connection-string> with the connection string you copied from MongoDB Atlas:
      ATLAS_URI=mongodb+srv://<username>:<password>@cluster0.mongodb.net/fit-track?retryWrites=true&w=majority
  5. Start the server:
    node server.js
    or if nodemon is installed for live updates of backend:
    nodemon server.js

Project Structure

Frontend

The frontend directory contains the React application:

frontend/
β”œβ”€β”€ public/                 # Public assets and favicon
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/            # Static assets and Lottie animations
β”‚   β”‚   β”œβ”€β”€ images/        # Image assets
β”‚   β”‚   └── lottie/       # Lottie animation files
β”‚   β”œβ”€β”€ components/        # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ common/       # Shared components
β”‚   β”‚   β”œβ”€β”€ Exercise/     # Exercise-related components
β”‚   β”‚   β”œβ”€β”€ Heatmap/     # Heatmap visualization
β”‚   β”‚   └── Navbar/      # Navigation components
β”‚   β”œβ”€β”€ pages/            # Application pages/routes
β”‚   β”œβ”€β”€ slices/           # Redux toolkit slices
β”‚   β”œβ”€β”€ store/            # Redux store configuration
β”‚   └── utils/            # Utility functions
β”œβ”€β”€ index.html            # HTML template
β”œβ”€β”€ package.json          # Project dependencies
└── vite.config.js       # Vite configuration

Backend

The backend directory contains the Node.js server and Express application:

backend/
β”œβ”€β”€ models/               # MongoDB Schema models
β”‚   β”œβ”€β”€ exercise.model.js # Exercise data model
β”‚   └── user.model.js    # User data model
β”œβ”€β”€ routes/              # API route handlers
β”‚   β”œβ”€β”€ exercises.js     # Exercise-related routes
β”‚   └── user.js         # User authentication routes
β”œβ”€β”€ package.json         # Backend dependencies
└── server.js           # Express server setup

Development Standards

Code Style

  • We use ESLint and Prettier for code formatting and linting
  • Follow the established ESLint rules in both frontend and backend
  • Maximum line length is 100 characters
  • Use 2 spaces for indentation
  • Follow React best practices and hooks rules

Documentation

  • All components and functions must have JSDoc documentation
  • Include clear descriptions for API endpoints
  • Document complex business logic
  • Keep the README and API documentation up to date

Git Workflow

  • Create feature branches from develop using format: feature/description
  • Create bug fix branches using format: fix/description
  • Follow conventional commits specification
  • Submit PRs using the provided template
  • Squash commits before merging

Code Review Process

  • All PRs require at least one review
  • Address all comments and suggestions
  • Ensure CI checks pass before merging
  • Keep PRs focused and reasonably sized

Testing

  • Write unit tests for new features
  • Include API endpoint tests
  • Maintain test coverage above 80%
  • Test components in isolation

Contributing

We welcome contributions! To contribute to Fit-Track, follow these steps:

Forking the Repository

  1. Fork the repository by clicking the "Fork" button at the top right of the repository page on GitHub. Forking the Repository

Cloning the Repository

  1. Clone your forked repository to your local machine:
    git clone https://github.com/your-username/Fit-Track.git
  2. Navigate to the project directory:
    cd Fit-Track

Creating a Branch

  1. Create a new branch for your feature or bug fix (create a branch according to the issue working on):
    git switch -c your-branch-name

Making Changes

  1. Make your changes to the codebase. You can edit the files using your preferred code editor.

Committing Changes

  1. Add the changes to the staging area:
    git add .
  2. Commit the changes with a descriptive message:
    git commit -m "Description of your changes"

Pushing Changes

  1. Push the changes to your forked repository:
    git push origin your-branch-name

Creating a Pull Request

  1. Create a pull request from your forked repository to the main repository. Go to the "Pull Requests" tab on the main repository, and click "New Pull Request". Follow the instructions to create your pull request.

Contributors

Thanks to all our contributors who have helped make Fit-Track better! Check out our Contributors page.

Let's build something great together and make Fit-Track the best it can be! ❀️🀝

License

This project is licensed under the MIT License - see the LICENSE file for details.