A full-stack boilerplate template leveraging Next.js, Express, and Redux Toolkit.
This template provides a robust foundation for developing modern web applications with server-side rendering (SSR) using Next.js and Express. It is designed for flexibility and can be easily customized or extended.
The project is structured with a custom Next.js server, allowing advanced routing patterns and middleware integration.
The repository is organized into two primary directories:
backend/– Express.js serversrc/– Next.js application
- Pre-configured with Redux Toolkit – Includes
{ createSlice }and{ createApi }for state management and API handling. - Custom Hook –
useIsClienthook prevents React hydration mismatches. - Styled with React-Bootstrap – Pre-integrated with
react-bootstrapfor easy UI styling. - Navigation & Routing – Simple navbar with
HomeandFeaturespages as examples. - Middleware Setup – Express server configured with
morgan,cors, andbody-parser. - ES Module Support – Uses
.mjsextension for native ES module compatibility. - Developer Tools –
nodemonfor hot-reloading during backend development.
- Client: Next.js, Redux Toolkit
- Server: Express.js
- Styling: React-Bootstrap
- Node.js v18+
- (Optional) React Developer Tools & Redux DevTools for debugging
Clone the repository and install dependencies:
# Using degit (recommended)
npx degit https://github.com/astra-media/nextjs-express-starter.git example
cd example
# OR Clone via Git
git clone https://github.com/astra-media/nextjs-express-starter.git example
cd example
# Install dependencies
npm installnpm run dev # Starts the Express server with nodemonThe server runs on http://localhost:3000/.
npm run build # Bundles the app and creates the 'dist' directory| Command | Description |
|---|---|
npm run dev |
Starts backend/server.mjs with Nodemon (hot-reloading) |
npm start |
Runs backend/server.mjs using Node.js |
npm run build |
Builds the application for production |
- react-express-starter – A full-stack boilerplate using Express, React + Vite, Redux Toolkit, and React Router.
This project is licensed under the MIT License. See the LICENSE file for details.