Atlas, step by step
Everything you need to set up, customise and ship the Atlas Next.js admin dashboard template.
Introduction
Atlas is a production-style Next.js dashboard template for online stores: one of the best Next.js templates for a working admin and e-commerce back office, not just a marketing page. It is built with Next.js 16 (App Router), React 19, Tailwind CSS v4 and shadcn/ui on Base UI (no Radix). It is a static export with a mock data layer, so it runs without a backend. Thirty-two app pages cover dashboards, products, orders, customers, shipments, cart, users, tasks, settings and auth; sixty-nine component documentation pages cover every shadcn/ui primitive used across them.
What is included
- Tailwind CSS v4, compiled at build time (no CDN script in the browser)
- Design tokens in one place: OKLCH CSS variables in
src/styles/globals.css, switched by adarkclass and adata-accentattribute - A zustand store seeded from JSON "database" tables in
src/data/, read through TanStack Query hooks - shadcn/ui's Base UI primitives in
src/components/atoms/, each with its own documentation page under/components/* - SEO-friendly static export:
next buildpre-renders every route to plain HTML, CSS and JavaScript inout/ - Atomic-design architecture: atoms → molecules → organisms → features → app
next build, not a mock-up — every page is pre-rendered HTML with no server-side rendering at runtime. See Build and deployment for the one detail to watch (the configured basePath).Getting started
Install the tools, run one command, and the template builds, opens in your browser and rebuilds whenever you save a file.
Requirements
| Tool | Version | Needed for |
|---|---|---|
| Node.js | 18 or newer | Building the template |
| npm | 9 or newer | Installing packages |
Install and run
cd atlas-next
npm install
npm run devcd atlas-next
yarn
yarn devcd atlas-next
pnpm install
pnpm devnpm run dev starts the Next.js dev server at http://localhost:3000 with fast refresh; every change you save in src/ shows up in the browser.
Commands
| Command | What it does |
|---|---|
npm run dev | Start the dev server with fast refresh at localhost:3000 |
npm run build | Build the static export into out/ |
npm start | Start the Next.js production server (serves the build) |
npx tsc --noEmit | Type-check only, without building |
src/ only. Everything in out/ is generated and is replaced on every build.Folder structure
Everything you edit lives in src/; the build writes the finished site to out/. Here is where each piece sits.
atlas-next/
├── src/
│ ├── app/ ← file-based routes (thin page.tsx files)
│ │ ├── (app)/ ← dashboard, products, orders, customers, shipments,
│ │ │ cart, users, tasks, settings, components/* (69 docs)
│ │ ├── auth/ ← sign-in, sign-up, forgot-password
│ │ └── errors/ ← 403, 404, 500, maintenance
│ ├── features/<name>/ ← feature views, types and store slice, one folder per area
│ ├── components/
│ │ ├── atoms/ ← shadcn/Base UI primitives (button, input, badge, table, …)
│ │ ├── molecules/ ← small compositions (kpi-card, search-input, form-field, …)
│ │ └── organisms/ ← self-contained sections + layout/ (app shell, sidebar, topbar)
│ ├── data/ ← mock database: one JSON file per table
│ ├── data/demo/ ← sample content for the SaaS dashboard and /components docs
│ ├── lib/store/ ← zustand store; seed.ts is the mock-API adapter
│ ├── lib/query/ ← TanStack Query hooks over the store
│ ├── lib/validation/ ← one zod schema per form
│ ├── lib/shell/ ← nav.ts, route-meta.ts and app-shell config
│ └── styles/ ← globals.css: design tokens (CSS variables) and theme
├── out/ ← generated static export, upload this
├── static-files/ ← documentation and preview pages (this file)
├── next.config.ts, tsconfig.json
└── package.jsonData (mock database)
Each JSON file in src/data/ is a database table (products, customers, orders, shipments, users, tasks, cart); src/data/demo/ holds sample content for the SaaS dashboard and the component docs pages. Change a table's JSON and rebuild to change what every page shows.
Components
Components follow atomic design and dependencies only point upward: atoms ← molecules ← organisms ← features ← app. Change an atom once and every page that uses it updates.
| Folder | Used for |
|---|---|
components/atoms/ | shadcn/ui Base UI primitives, taken from shadcn-ui/ui's apps/v4/registry/bases/base/ui with Lucide icons |
components/molecules/ | kpi-card, search-input, form-field, status-badge, page-header, … |
components/organisms/ | confirm-delete, page-skeleton, and layout/ (app shell, sidebar, topbar, search, notifications) |
features/<name>/ | Feature views, types and the store slice for one page area |
Pages and components
Detail pages are static routes that take the record in the query string (a static export has no dynamic segments), for example /products/view?id=p1.
| Group | Routes |
|---|---|
| Dashboards | /, /dashboard/saas |
| Products | /products, /products/grid, /products/view, /products/gallery, /products/new, /products/edit |
| Orders | /orders, /orders/board, /orders/view, /orders/invoice |
| Customers | /customers, /customers/grid, /customers/view, /customers/insights |
| Shipments | /shipments, /shipments/view, /shipments/new, /shipments/edit |
| General | /cart, /users, /tasks, /settings |
| Auth / errors | /auth/sign-in, /auth/sign-up, /auth/forgot-password, /errors/403, /errors/404, /errors/500, /errors/maintenance |
| Docs | /components/* — one page per UI component (69 total) |
To add a page: create src/app/(app)/<area>/<page>/page.tsx rendering a feature view, then add it to src/lib/shell/route-meta.ts and src/lib/shell/nav.ts.
Design tokens
Every color is an OKLCH CSS variable in src/styles/globals.css, exposed to Tailwind as bg-primary, text-muted-foreground, bg-chart-1 and so on. Use the tokens, not hex or raw palette colors.
Key variables
oklch(0.55 var(--c) var(--h))Driven by --h (hue) and --c (chroma), not a fixed hexchart-1 = --primary, others offset --hUsed by the Recharts dashboard and insights pagesoklch(0.975 0.004 255) / dark setSidebar background, foreground, border and ringAccent switch
<html data-accent="blue|violet|emerald|rose|orange"> remaps --h/--c for the whole palette — see the table below for the exact values, set in src/styles/globals.css.
| Accent | --h | --c |
|---|---|---|
| blue (default) | 262 | 0.2 |
| violet | 295 | 0.21 |
| emerald | 160 | 0.15 |
| rose | 12 | 0.21 |
| orange | 50 | 0.18 |
Dark mode & accents
Dark mode toggles the dark class on <html> from the top bar; the choice and the chosen accent are remembered per device.
data-accent attribute are plain attribute toggles — no JavaScript theme library, just the CSS variable sets in globals.css responding to them.Tailwind CSS
Tailwind CSS v4 is wired through @tailwindcss/postcss (and @tailwindcss/turbopack in dev). There is no inline style in markup; conditional states use variants and attributes instead of hardcoded colors.
- Value-driven helpers for anything Tailwind can't express as a literal class:
hueClass(n)withtint-thumb|tint-avatar|tint-swatchfor hue-based colors,pctWidth(n)withpct-w-*for progress widths - Tailwind only sees literal class names — build lists of classes explicitly or generate a range with
@source inline(...), never string-join a class name at runtime - Conditional states use
hover:,dark:,aria-pressed:,data-[state=open]:rather than hardcoded colors
Components
Files in src/components/atoms/ are the official shadcn base (Base UI) components from shadcn-ui/ui (apps/v4/registry/bases/base/ui) with Lucide icons, styled with plain Tailwind utilities in the components themselves — no separate theme stylesheet.
Refreshing or adding a component
On a machine with network access: npx shadcn@latest add <name> (base: base, icons: lucide), then move the file into src/components/atoms/ and fix its @/components/atoms/... imports.
Local edits already made to shadcn defaults
select.tsx (auto labels for <SelectValue/>, string onValueChange), badge.tsx (success/warning/info/violet variants), card.tsx (header action layout), and orientation data-attribute selectors.
Finding a component's doc page
Every primitive has a page at /components/<name> — for example /components/data-table or /components/dialog — rendered with sample content from src/data/demo/.
Data layer (mock API)
There is no backend. Each JSON file in src/data/ is a database table (products, customers, orders, shipments, users, tasks, cart).
| Layer | Role |
|---|---|
src/lib/store/seed.ts | Loads the tables. The single file to replace to use a real API. |
src/lib/store/ | A zustand store (localStorage key atlas:v2, synced across tabs). State changes only through actions: use<Name>Actions() in each feature's store.ts dispatches to the root reducer |
src/lib/query/ | TanStack Query hooks over the store; reads go through async functions so swapping in a real API only touches this layer |
src/lib/validation/ | One zod schema per form |
store.ts so old localStorage data doesn't break the app on load.SEO
Atlas is a Next.js dashboard template first, so most pages sit behind an authenticated-style shell rather than being optimized for organic search the way a Next.js landing page template would be — but the static export still gives every route its own pre-rendered HTML, a real URL and a fast first paint with no server round-trip.
- Every route pre-renders to plain HTML, CSS and JavaScript at build time
public/favicon.svgand the page<title>/metadata come from each route's ownpage.tsx- If you expose any page publicly (for example a status or pricing page built on top of Atlas), add per-route
metadataexports the same way Next.js App Router expects
Build and deployment
next.config.ts sets output: "export", so next build always produces a static out/ folder — plain HTML, CSS and JS, deployable to any static host.
next build always runs in production mode, which means next.config.ts's basePath (/themes/atlas-ecommerce-nextjs-template/app) is baked into every asset URL in out/. Serve the export at that exact sub-path, or remove the basePath line in next.config.ts and rebuild if you are deploying to a domain root instead.- Image loading uses a custom loader (
imageLoader.ts) since static export can't use the default Next.js image optimizer npm run buildwrites the export toout/; upload that folder as-is- No Node server, serverless function or image optimization service is required at runtime
Dependencies
All of the stack, and why each package is there.
| Package | Why |
|---|---|
next, react, react-dom | Next.js 16 App Router (src/app), React 19 |
tailwindcss, @tailwindcss/postcss, tw-animate-css | Tailwind CSS v4 + shadcn animation utilities |
@base-ui/react | shadcn/ui's Base UI variant behind Select, Dialog, Dropdown, Tabs, Switch… |
class-variance-authority, clsx, tailwind-merge | shadcn's cn() helper and variants |
lucide-react | Icons |
recharts | Required by shadcn's chart component |
zustand | The app store, persisted to localStorage |
@tanstack/react-query | Query hooks over the store, the swap point for a real API |
zod | One validation schema per form |
Fonts: system font stack — no font package.
Customisation
Common tasks and where each one lives.
Switch the whole palette in one place
Set data-accent on <html>, or edit --h/--c directly in globals.css. Buttons, charts, the sidebar and dark mode all follow.
<html data-accent="violet">Add a new route
Create the page, then register it so the sidebar and route metadata pick it up.
src/app/(app)/<area>/<page>/page.tsx
# then add it to:
src/lib/shell/route-meta.ts
src/lib/shell/nav.tsEdit the seed data
Each table is one JSON file. Edit it and rebuild (or just save, under next dev) to see the change everywhere that table is used.
src/data/products.json
src/data/orders.json
src/data/customers.jsonSwap the mock API for a real one
This is the one file the whole app depends on for data. Replace its loaders with real requests; the store and query hooks above it don't need to change.
src/lib/store/seed.tsAI assistants
AGENTS.md describes the architecture, data flow, styling rules and checks for any AI coding agent; CLAUDE.md imports it and adds Claude Code specific notes. Keep both up to date when the structure changes.
Troubleshooting
Common issues and the fastest way past them.
The page looks unstyled after I build
Open the build through a server (npm run dev or by serving out/), not by double-clicking a file, and make sure npm install finished without errors.
The built pages 404 or show no styling at all on my host
next build bakes the configured basePath into every asset URL. Serve out/ at that exact sub-path, or delete the basePath line in next.config.ts and rebuild for a root deployment.
My edits do not show up
Edit files in src/ only, never in out/, which is replaced on every build.
The dashboard shows stale or broken data after a schema change
Use Settings → reset to restore the seed, or bump the persist version in src/lib/store/store.ts so old localStorage data for atlas:v2 is discarded instead of reused.
Does it work with AI coding assistants?
Yes. The project root includes CLAUDE.md and AGENTS.md with the stack, exact commands, folder structure and do-not rules, so tools such as Claude Code, Cursor, Codex and Copilot work with the template out of the box.
Credits and support
Atlas is built on Next.js, React, Tailwind CSS and shadcn/ui's Base UI — thank you to those projects and their maintainers. For support, open the live preview first to confirm the behaviour you're seeing, then get in touch at hello@atlas-admin.example.com.