Menu

How I Structure Small-Business Web Projects with Next.js, Node.js and MongoDB
πŸ“°

How I Structure Small-Business Web Projects with Next.js, Node.js and MongoDB

DEV Community: nextjsΒ·HaseebullahΒ·6 days ago
#rHRK78a1
#devtonextjs#devto#dev#cached#admin
Long article (541 words) β€” no AI summary yet.
Reading 0:00
15s threshold

Most small businesses don't need a microservices architecture. They need a website that loads fast, an admin area they can actually use, and data they can trust. Over the past few years of building web apps for shops, cafes and other small businesses, I've settled on a simple structure that keeps projects maintainable without over-engineering them.

The stack

Next.js (React) for the public site and the admin dashboard

Node.js + Express.js for an API when the project needs one beyond Next.js API routes

MongoDB for flexible product/catalogue data, or MySQL when the data is strongly relational (invoices, ledgers)

Folder structure

my-shop/ β”œβ”€β”€ app/ # Next.js routes (public pages + /admin) β”‚ β”œβ”€β”€ (site)/ # home, products, contact β”‚ └── admin/ # protected dashboard β”œβ”€β”€ components/ # shared UI β”œβ”€β”€ lib/ β”‚ β”œβ”€β”€ db.js # single database connection β”‚ β”œβ”€β”€ auth.js # session / role helpers β”‚ └── validators.js # input validation schemas β”œβ”€β”€ models/ # data models (Product, Order, Customer) └── services/ # business logic…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.