Skip to content

Conversation

@gunjanghate
Copy link
Contributor

🚀 Add Next.js + Express + MongoDB Template

Overview
This PR adds a Next.js + Express + MongoDB starter template to Celtrix, providing developers with a modern full-stack solution that bridges a Next.js frontend with a dedicated Express backend and MongoDB integration. Available in both TypeScript and JavaScript variants.


✨ Key Features

Frontend (Next.js 15)

  • App Router with latest Next.js features

  • TailwindCSS for responsive, modern styling

  • Mobile-first design

  • ESLint & Prettier configuration

  • Sample components: User management interface

  • API integration examples

  • Custom 404 page

Backend (Express.js)

  • Express 5 with modern middleware

  • MongoDB/Mongoose integration

  • Security with Helmet and CORS

  • Request logging with Morgan

  • Full CRUD API for user management

  • MVC architecture

  • Health check endpoints


📊 API Endpoints

Method Endpoint Description Response
GET /api/users Get all users Array of users
GET /api/users/:id Get user by ID Single user object
POST /api/users Create new user Created user object
PUT /api/users/:id Update user Updated user object
DELETE /api/users/:id Delete user Success message
GET /api/health Health check System status
GET / API info API documentation

🔧 CLI Integration & Setup

  • Added Next.js + Express + MongoDB option to CLI selection menu

  • Template manager updated for new stack structure

  • Setup commands:

# Create new project
npx celtrix my-next-express-app

Choose Next.js + Express + MongoDB stack

Select TypeScript or JavaScript

Start development

cd my-next-express-app/client && npm run dev
cd my-next-express-app/server && npm run dev


🎯 Why This Matters

  • Separation of concerns: Frontend and backend scalable independently

  • Modern stack: Latest Next.js 15 + Express 5

  • Production ready: Security, validation, and error handling built-in

  • Developer friendly: TypeScript-first with comprehensive documentation


🧪 Testing

  • Verified all package versions install correctly

  • Template copying works for TS and JS

  • Frontend builds and runs

  • Backend starts and connects to MongoDB

  • API endpoints function correctly

  • 404 page displays properly

  • CLI integration works seamlessly


Impact:
Adds a modern full-stack alternative to MERN with better separation of concerns, flexible backend scaling, Express ecosystem compatibility, and TypeScript-first development experience.

Closes: [Link to related issue]
Demo: Available via npx celtrix → select new stack option


@JoeCelaster
Copy link
Member

@gunjanghate . Can you drop a sample working video or screenshots ?

@gunjanghate
Copy link
Contributor Author

@gunjanghate
Copy link
Contributor Author

@gunjanghate gunjanghate changed the base branch from main to basic-scaffold October 6, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants