Skip to content

Latest commit

Β 

History

History
119 lines (90 loc) Β· 4.97 KB

File metadata and controls

119 lines (90 loc) Β· 4.97 KB

Project Name

License The Odin Project

A full-stack application built with React and Express as part of The Odin Project's NodeJS curriculum. Features JWT authentication, role-based access control, PostgreSQL via Prisma ORM, and a modular search system.

πŸ“‹ Table of Contents

✨ Features

  • JWT authentication with HttpOnly cookies
  • Role-based access control (USER / ADMIN / SUPER_ADMIN)
  • Full-stack search with filters, sorting, and URL-state persistence
  • Prisma ORM with PostgreSQL
  • Vitest + React Testing Library test suite (client & server)
  • Dark/light theme toggle
  • Responsive layout with mobile Navbar

πŸš€ Getting Started

See docs/setup.md for the full environment setup guide.

Quick start (after setup):

npm run install:all   # install all dependencies
npm run dev           # start client + server concurrently

πŸ“ Project Structure

template-react-expressjs/
β”œβ”€β”€ client/               # React + Vite frontend
β”‚   └── src/
β”‚       β”œβ”€β”€ components/   # UI components grouped by domain
β”‚       β”œβ”€β”€ config/       # searchConfig.js β€” drives all search UI
β”‚       β”œβ”€β”€ layouts/      # MainLayout (Navbar + Outlet)
β”‚       β”œβ”€β”€ modules/api/  # Fetch wrappers per domain
β”‚       β”œβ”€β”€ pages/        # Route-level components
β”‚       β”œβ”€β”€ providers/    # Auth, Theme, Toast context
β”‚       β”œβ”€β”€ routes/       # AuthRoute, AdminRoute guards
β”‚       β”œβ”€β”€ routes.jsx    # createBrowserRouter config
β”‚       └── styles/       # Global CSS variables, reset, animations
β”œβ”€β”€ server/               # Express backend
β”‚   └── src/
β”‚       β”œβ”€β”€ config/       # Passport, CORS, cookie options
β”‚       β”œβ”€β”€ controllers/  # Route handlers
β”‚       β”œβ”€β”€ db/queries/   # Prisma query functions per domain
β”‚       β”œβ”€β”€ middleware/   # Auth, error, app middleware
β”‚       └── routes/       # Express routers
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ setup.md          # Environment setup (PostgreSQL, .env, pgAdmin)
β”‚   β”œβ”€β”€ architecture.md   # Stack overview, request flow, patterns
β”‚   └── testing.md        # Testing conventions and patterns
β”œβ”€β”€ CONTRIBUTING.md       # Branching, commit conventions, PR process
β”œβ”€β”€ CHANGELOG.md          # Version history
└── package.json          # Root orchestration scripts

πŸ“– Documentation

Doc Description
docs/setup.md PostgreSQL installation (Windows/macOS/Linux), .env config, pgAdmin 4
docs/architecture.md Stack overview, request flow, client/server structure, auth flow
docs/testing.md Testing patterns, mocking conventions, what to test
CONTRIBUTING.md Branching strategy, commit conventions, PR process
CHANGELOG.md Version history

πŸ§ͺ Testing

cd client && npm run test:watch   # client β€” watch mode
cd server && npm run test:watch   # server β€” watch mode

See docs/testing.md for patterns, mocking conventions, and gotchas.

πŸ’‘ Future Improvements

  • Gallery and list view modes for search results
  • Pagination on search results
  • Email verification on signup
  • File upload support (profile avatars)
  • Rate limiting on auth endpoints

πŸ› οΈ Technologies Used

Client: React 19, React Router 7, Vite, CSS Modules, Lucide React, Vitest, React Testing Library

Server: Node.js, Express, Prisma ORM, PostgreSQL, Passport.js (Local + JWT), bcryptjs, express-validator

Tooling: ESLint, Prettier, concurrently, nodemon

πŸ™ Acknowledgments

  • The Odin Project β€” For providing an amazing free curriculum
  • The TOP Community β€” For being supportive and helpful throughout

Built with πŸ’‘ and β˜• as part of my journey through The Odin Project β€” NodeJS