WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

amgowda42/Goal_Setter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

66 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 Goal Setter:-

  • A MERN stack application built to help users set goals, track their progress, edit, and delete them with ease.
  • The main purpose of this project is to understand and implement a complete MERN stack workflow, including authentication, authorization, token handling, and clean code organization.

πŸš€ Features

  • βœ… User authentication & authorization
  • βœ… Token handling with cookies (res.cookies) β€” secure and modern approach
  • βœ… Centralized API handling with credentials support in frontend
  • βœ… Well-structured backend folder organization
  • βœ… Goal management: Create, Edit, Delete, Track progress
  • βœ… Type-safe frontend with TypeScript
  • βœ… Form validation using React Hook Form + Zod
  • βœ… API handling with React Query

πŸ› οΈ Tech Stack:-

Frontend

  • ⚑ Vite – Modern build tool
  • βš›οΈ React 19 – UI development
  • πŸ“¦ React Query – API handling
  • πŸ›‘οΈ TypeScript – Type safety
  • βœ… React Hook Form + Zod – Form validation

Backend

  • 🟒 Node.js – Runtime environment
  • 🚏 Express.js – Server framework
  • πŸƒ MongoDB (NoSQL) – Database
  • πŸ”‘ JWT + Cookies – Authentication

πŸ“‚ Project Structure

Goal-Setter/
β”‚
│── backend/                           # Express + MongoDB backend
β”‚   β”œβ”€β”€ config/                        # DB connection & Cores Options setup
β”‚   β”‚   β”œβ”€β”€ db.js
β”‚   β”‚   └── coresOptions.js
β”‚   β”‚
β”‚   β”œβ”€β”€ controllers/                   # Route logic
β”‚   β”‚   β”œβ”€β”€ goal.controller.js         # Goal Controller logics
|   |   └── user.controller.js         # User COntroller logics
β”‚   β”‚
β”‚   β”œβ”€β”€ middleware/                    # Auth & error handling
β”‚   β”‚   β”œβ”€β”€ authMiddleware.js
β”‚   β”‚   └── errorMiddleware.js
β”‚   β”‚
β”‚   β”œβ”€β”€ models/
|   |   β”œβ”€β”€ user.model.js              # MongoDB models
β”‚   β”‚   └── goal.model.js
β”‚   β”‚
β”‚   β”œβ”€β”€ routes/                        # API routes
β”‚   β”‚   β”œβ”€β”€ goal.routes.js
β”‚   β”‚   └── user.routes.js
β”‚   β”œβ”€β”€ server.js                      # Entry point
β”‚   └── package.json
β”‚
│── client/                            # React + Vite frontend
β”‚   β”œβ”€β”€ public/                        # Static assets
β”‚   β”‚   └── favicon.ico
β”‚   β”‚
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/                       # Centralized API handling
|   |   |   β”œβ”€β”€ AuthLoader.tsx         # load to logic on every hard refresh
β”‚   β”‚   β”‚   β”œβ”€β”€ apiSlice.tsx           # base url with code splitting allowed
β”‚   β”‚   β”‚   └── store.tsx              # store
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ ui/                        # Reusable UI components
|   |   |   β”œβ”€β”€ NotFoundPage.tsx
β”‚   β”‚   β”‚   └── Navbar.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ features/                  # feature wise file organised
|   |   |   β”œβ”€β”€ goal/
|   |   |   |   β”œβ”€β”€ goalApiSlice.tsx   # goal apis called
|   |   |   |   └── goal/              # goal feature components
β”‚   β”‚   β”‚   └── auth/
|   |   |       β”œβ”€β”€ authApiSlice.tsx   # auth apis called
|   |   |       └── auth/              # auth feature components
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ layouts/                   # Layouts (auth and main)
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthLayout.tsx
|   |   |   └── AuthenticatedLayout.tsx
|   |   |
β”‚   β”‚   β”œβ”€β”€ routes/                    # Routes configured
β”‚   β”‚   β”‚   β”œβ”€β”€ ProtectedRoute.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ PublicRoute.tsx
β”‚   β”‚   β”‚   └── index.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ utils/                     # utils
β”‚   β”‚   β”‚   β”œβ”€β”€ useAuth.tsx            # use Auth hook
β”‚   β”‚   β”‚   └── getErrorMessage.tsx    # Error display logic function
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ App.tsx                    # Root component
β”‚   β”‚   └── main.tsx                   # Entry point
β”‚   β”‚
β”‚   β”œβ”€β”€ tsconfig.app.json
β”‚   β”œβ”€β”€ eslint.config.js
β”‚   β”œβ”€β”€ vite.config.ts
β”‚   └── package.json
β”‚
└── README.md                          # Readme

βš™οΈ Installation & Setup

1️⃣ Clone the repository git clone https://github.com/amgowda42/Goal_Setter.git

2️⃣ Backend Setup

cd backend
npm install

Create a .env file inside the backend/ folder and add:

MONGODB_URI=your_mongodb_connection_string
PORT=8000
JWT_SECRET=your_secret_key

Start backend:

npm run dev

3️⃣ Frontend Setup

cd client
npm install

Start frontend:

npm run dev

▢️ Usage

  • Register/Login as a user.
  • Set your goals (title, description, etc.).
  • Track progress, edit, or delete goals anytime.
  • Authentication is handled securely using cookies.

🎯 Learning Outcomes

  • Through this project, I focused on:
  • Building a full-stack MERN app with modern best practices.
  • Implementing authentication/authorization using JWT + cookies.
  • Organizing backend with a clean folder structure.
  • Using React Query for centralized API handling.
  • Adding type safety & validation in frontend with TypeScript + Zod.

πŸ“œ License

  • This project is licensed under the MIT License.

About

MERN full stack Application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •