Projects

Goal Setter

2022·1 min read

React
JavaScript
Express
MongoDB
GitHub

A small full-stack MERN app where authenticated users can register, log in, and manage a private list of personal goals. Built in 2022 as a learning project covering the full Redux Toolkit + Express + JWT flow end-to-end.

Personal goal tracker with JWT auth — React + Redux Toolkit + Node + MongoDB.

A small full-stack MERN app where authenticated users can register, log in, and manage a private list of personal goals. Built in 2022 as a learning project covering the full Redux Toolkit + Express + JWT flow end-to-end.

✨ Features

  • JWT authentication — register / login with hashed passwords (bcryptjs) and Bearer token sessions
  • Protected goal CRUD — create, read, update, and delete goals scoped to the logged-in user
  • Redux Toolkit — authSlice and goalSlice driving all client state via createAsyncThunk
  • Protected routes on the React side with redirects for unauthenticated users
  • Toast notifications via react-toastify for auth and CRUD feedback
  • Centralized Express error handler with express-async-handler

🛠️ Tech Stack

  • Frontend — React 17, Redux Toolkit, React Router v6, Axios, react-toastify
  • Backend — Node.js, Express
  • Database — MongoDB via Mongoose
  • Auth — JWT (jsonwebtoken) + bcryptjs
  • Dev tooling — nodemon, concurrently

📁 Project Structure

.
├── backend/
│   ├── config/         # Mongo connection
│   ├── controllers/    # goal + user controllers
│   ├── middleware/     # auth (protect) + error handler
│   ├── models/         # Mongoose models
│   ├── routes/         # /api/goals, /api/users
│   └── server.js
└── frontend/
    └── src/
        ├── app/        # Redux store
        ├── features/
        │   ├── auth/   # authSlice + authService
        │   └── goals/  # goalSlice + goalService
        ├── components/
        └── pages/

🔌 API

All /api/goals routes require an Authorization: Bearer <token> header.

Method Endpoint Description
POST /api/users Register a new user
POST /api/users/login Log in, returns JWT
GET /api/users/me Current user (protected)
GET /api/goals List the user's goals
POST /api/goals Create a goal
PUT /api/goals/:id Update a goal
DELETE /api/goals/:id Delete a goal

🙌 Credits

Built by Mohamed Gado.

More projects

  • Movie App2022 · React
  • House Market Place2022 · React
  • Breaking Bad Cast2022 · React
All projects