Skip to content

ArpanVala/GoalSetter_v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

51 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GoalSetter - Personal Goal Tracking Application

πŸ“‹ Table of Contents

🎯 Project Overview

GoalSetter is a comprehensive personal goal tracking application built with the MERN stack (MongoDB, Express.js, React.js, Node.js). It allows users to create, manage, and track their personal goals with an intuitive category-based organization system.

πŸš€ Deployment

Backend Deployment (Render)

Frontend Deployment (Netlify)

Key Highlights

  • Personal Goal Management: Create, update, and delete goals with priority levels and due dates
  • Category Organization: Organize goals into custom categories for better management
  • Dashboard Analytics: Visual statistics showing goal progress and completion rates
  • User Authentication: Secure login/register system with JWT tokens
  • Responsive Design: Mobile-friendly interface built with Tailwind CSS

🌐 Live Demo

πŸ›  Tech Stack

Backend

  • Runtime: Node.js
  • Framework: Express.js
  • Database: MongoDB with Mongoose ODM
  • Authentication: JWT (JSON Web Tokens)
  • Password Hashing: bcryptjs
  • CORS: Cross-Origin Resource Sharing enabled
  • Environment: dotenv for configuration

Frontend

  • Framework: React.js 19.1.0
  • Build Tool: Vite
  • State Management: Redux Toolkit
  • Routing: React Router DOM
  • HTTP Client: Axios
  • Styling: Tailwind CSS
  • UI Components: Headless UI, Lucide React Icons
  • Notifications: React Toastify

πŸ— Project Architecture

GoalSetter/
β”œβ”€β”€ backend/                 # Express.js API server
β”‚   β”œβ”€β”€ config/             # Database configuration
β”‚   β”œβ”€β”€ controllers/        # Route handlers
β”‚   β”œβ”€β”€ middleware/         # Custom middleware
β”‚   β”œβ”€β”€ models/            # MongoDB schemas
β”‚   β”œβ”€β”€ routes/            # API routes
β”‚   └── server.js          # Main server file
β”œβ”€β”€ frontend/              # React.js application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ features/      # Redux slices and services
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   └── app/           # Redux store configuration
β”‚   └── public/            # Static assets
└── package.json           # Root package configuration

✨ Features

Core Functionality

  1. User Authentication

    • User registration and login
    • JWT-based session management
    • Secure password hashing
  2. Goal Management

    • Create, read, update, delete goals
    • Set priority levels (High, Medium, Low)
    • Set due dates with validation
    • Mark goals as completed/incomplete
  3. Category Management

    • Create custom categories
    • Rename and delete categories
    • Organize goals by categories
  4. Dashboard Analytics

    • Total categories count
    • Total goals count
    • Completed goals count
    • Due goals count
    • Category-wise progress tracking
  5. User Experience

    • Responsive design for all devices
    • Loading states and error handling
    • Toast notifications for user feedback
    • Intuitive navigation

πŸš€ Installation & Setup

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB database
  • Git

Backend Setup

  1. Clone the repository

    git clone <repository-url>
    cd GoalSetter
  2. Install dependencies

    npm install
  3. Environment Configuration Create a .env file in the root directory:

    PORT=5000
    MONGO_URI=your_mongodb_connection_string
    JWT_SECRET=your_jwt_secret_key
  4. Start the server

    npm start
    # or for development with nodemon
    npm run dev

Frontend Setup

  1. Navigate to frontend directory

    cd frontend
  2. Install dependencies

    npm install
  3. Start development server

    npm run dev
  4. Build for production

    npm run build

πŸ“ Project Structure

Backend Structure

backend/
β”œβ”€β”€ config/
β”‚   └── db.js              # MongoDB connection configuration
β”œβ”€β”€ controllers/
β”‚   β”œβ”€β”€ userController.js  # User authentication logic
β”‚   β”œβ”€β”€ goalController.js  # Goal CRUD operations
β”‚   └── categoryController.js # Category CRUD operations
β”œβ”€β”€ middleware/
β”‚   β”œβ”€β”€ authMiddleware.js  # JWT authentication middleware
β”‚   └── errorMiddleware.js # Global error handling
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ userModel.js       # User schema
β”‚   β”œβ”€β”€ goalModel.js       # Goal schema
β”‚   └── categoryModel.js   # Category schema
β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ userRoutes.js      # User authentication routes
β”‚   β”œβ”€β”€ goalRoutes.js      # Goal management routes
β”‚   └── categoryRoutes.js  # Category management routes
└── server.js              # Main server entry point

Frontend Structure

frontend/src/
β”œβ”€β”€ app/
β”‚   └── store.js           # Redux store configuration
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ CategoryList.jsx   # Category display component
β”‚   β”œβ”€β”€ CategoryModel.jsx  # Category creation modal
β”‚   β”œβ”€β”€ DeleteModal.jsx    # Confirmation modal
β”‚   β”œβ”€β”€ Loading.jsx        # Loading component
β”‚   β”œβ”€β”€ Navbar.jsx         # Navigation component
β”‚   └── RenameCategoryModal.jsx # Category rename modal
β”œβ”€β”€ features/
β”‚   β”œβ”€β”€ auth/
β”‚   β”‚   β”œβ”€β”€ authService.js # Authentication API calls
β”‚   β”‚   └── authSlice.js   # Redux auth state management
β”‚   β”œβ”€β”€ categories/
β”‚   β”‚   β”œβ”€β”€ categoryService.js # Category API calls
β”‚   β”‚   └── categorySlice.js   # Redux category state
β”‚   └── goals/
β”‚       β”œβ”€β”€ goalService.js # Goal API calls
β”‚       └── goalSlice.js   # Redux goal state management
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ AddGoalPage.jsx    # Goal creation page
β”‚   β”œβ”€β”€ CategoryPage.jsx   # Category detail page
β”‚   β”œβ”€β”€ Dashboard.jsx      # Main dashboard
β”‚   β”œβ”€β”€ EditGoalPage.jsx   # Goal editing page
β”‚   β”œβ”€β”€ HomePage.jsx       # Landing page
β”‚   β”œβ”€β”€ LoginPage.jsx      # User login
β”‚   β”œβ”€β”€ RegisterPage.jsx   # User registration
β”‚   └── NotFound404.jsx    # 404 error page
β”œβ”€β”€ App.jsx                # Main app component
└── main.jsx              # App entry point

🎨 Frontend Architecture

State Management with Redux Toolkit

The application uses Redux Toolkit for centralized state management with three main slices:

  1. Auth Slice (authSlice.js)

    • Manages user authentication state
    • Handles login, register, and logout actions
    • Stores user information and authentication status
  2. Goals Slice (goalSlice.js)

    • Manages goal-related state
    • Handles CRUD operations for goals
    • Tracks loading states and errors
  3. Categories Slice (categorySlice.js)

    • Manages category-related state
    • Handles CRUD operations for categories
    • Tracks loading states and errors

Routing Structure

<Routes>
  <Route path="/" element={<HomePage/>} />
  <Route path="/login" element={<LoginPage/>} />
  <Route path="/register" element={<RegisterPage/>} />
  <Route path="/dashboard" element={<Dashboard/>}/>
  <Route path="/category/:id" element={<CategoryPage/>} />
  <Route path="/add-goal" element={<AddGoalPage/>} />
  <Route path="/edit/:id" element={<EditGoalPage/>}/>
  <Route path="*" element={<NotFound404/>}/>
</Routes>

πŸ”„ State Management

Redux Store Configuration

The application uses Redux Toolkit's configureStore with the following configuration:

const store = configureStore({
  reducer: {
    auth: authReducer,
    goals: goalReducer,
    categories: categoryReducer
  }
})

Async Actions

All API calls are handled using Redux Toolkit's createAsyncThunk for:

  • User authentication (register, login, logout)
  • Goal operations (create, read, update, delete)
  • Category operations (create, read, update, delete)

🎯 Routing

Public Routes

  • / - Landing page
  • /login - User login
  • /register - User registration

Protected Routes

  • /dashboard - Main dashboard with statistics
  • /category/:id - Category detail page
  • /add-goal - Create new goal
  • /edit/:id - Edit existing goal

Error Handling

  • * - 404 Not Found page

🎨 Styling & UI

Design System

  • Framework: Tailwind CSS for utility-first styling
  • Icons: Lucide React for consistent iconography
  • Components: Headless UI for accessible components
  • Responsive: Mobile-first responsive design

Key Design Features

  • Clean and modern interface
  • Consistent color scheme (violet/blue theme)
  • Smooth animations and transitions
  • Loading states and error handling
  • Toast notifications for user feedback

πŸ‘¨β€πŸ’» Author

Arpan Vala - Personal goal tracking application built with MERN stack.


About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages