mern-template-jpz
v2.0.3
Published
Scaffold a MERN TypeScript authentication app with Vite, React, Tailwind CSS, Express, MongoDB, and JWT refresh-token rotation.
Downloads
840
Maintainers
Readme
MERN Template CLI tool
mern-template-jpz is a CLI tool that creates a ready-to-use MERN authentication starter.
The generated app includes a TypeScript/Express + MongoDB backend with secure access/refresh token authentication, plus a React/Vite frontend wired to the API.
What It Creates
backend- Express, MongoDB, Mongoose, TypeScript, JWT auth, httpOnly refresh cookies, session tracking, rate limiting, and security middlewarefrontend- React, Vite, TypeScript, Tailwind CSS, React Router, Zustand, Axios, and auth pages
The scaffold includes registration, login, logout, token refresh, protected routing, and startup refresh handling.
Quick Start
Create a new project folder:
npx mern-template-jpz my-appYou can also run the CLI without a project name:
npx mern-template-jpzWhen you do not add a project name, the template files are created in the current folder.
If you created a new project folder, open it:
cd my-appInstall and start the backend:
cd backend
npm install
cp .env.example .env
npm run devOpen another terminal, then install and start the frontend:
cd my-app/frontend
npm install
cp .env.example .env
npm run devThe frontend runs at http://localhost:5173 by default. The backend API runs at the port configured in backend/.env.
Using Global Install
npm install -g mern-template-jpz
mern-template-jpz my-appCommand Format
npx mern-template-jpz [project-name]Options:
-f, --force- allow scaffolding into a non-empty directory-h, --help- show help
Generated Folder Structure
backend/
src/
controllers/
db/
middlewares/
models/
routes/
services/
types/
utils/
index.ts
frontend/
src/
api/
assets/
axios/
components/
layouts/
loaders/
pages/
routes/
stores/
types/
utils/
App.tsx
index.css
main.tsxLicense
This CLI tool is licensed under the MIT License. See LICENSE.
