https://github.com/top-submissions/template-react-expressjs
https://github.com/top-submissions/template-react-expressjs
authentication crud css-modules express fullstack javascript jwt nodejs postgresql prisma react react-router rest-api role-based-access-control template testing the-odin-project typescript-ready vite vitest
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/top-submissions/template-react-expressjs
- Owner: top-submissions
- License: mit
- Created: 2026-02-09T09:14:17.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-03-20T06:05:34.000Z (3 months ago)
- Last Synced: 2026-03-20T21:50:47.786Z (3 months ago)
- Topics: authentication, crud, css-modules, express, fullstack, javascript, jwt, nodejs, postgresql, prisma, react, react-router, rest-api, role-based-access-control, template, testing, the-odin-project, typescript-ready, vite, vitest
- Language: JavaScript
- Size: 630 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Project Name
[](LICENSE)
[](https://www.theodinproject.com/paths/full-stack-javascript/courses/nodejs)
> 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
- [Project Name](#project-name)
- [๐ Table of Contents](#-table-of-contents)
- [โจ Features](#-features)
- [๐ Getting Started](#-getting-started)
- [๐ Project Structure](#-project-structure)
- [๐ Documentation](#-documentation)
- [๐งช Testing](#-testing)
- [๐ก Future Improvements](#-future-improvements)
- [๐ ๏ธ Technologies Used](#๏ธ-technologies-used)
- [๐ Acknowledgments](#-acknowledgments)
## โจ 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](docs/setup.md)** for the full environment setup guide.
**Quick start** (after setup):
```bash
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](docs/setup.md) | PostgreSQL installation (Windows/macOS/Linux), `.env` config, pgAdmin 4 |
| [docs/architecture.md](docs/architecture.md) | Stack overview, request flow, client/server structure, auth flow |
| [docs/testing.md](docs/testing.md) | Testing patterns, mocking conventions, what to test |
| [CONTRIBUTING.md](CONTRIBUTING.md) | Branching strategy, commit conventions, PR process |
| [CHANGELOG.md](CHANGELOG.md) | Version history |
## ๐งช Testing
```bash
cd client && npm run test:watch # client โ watch mode
cd server && npm run test:watch # server โ watch mode
```
See [docs/testing.md](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