Next.js v15 & Tailwind CSS
Next.js v15 & Tailwind CSS guide for Trezo.
Overview
Next.js v15 paired with MUI (Material-UI) React offers a powerful setup for building scalable, responsive web applications with a smooth developer experience. Here’s an overview of what makes this combination effective:
- Next.js v15 Enhancements
- App Router: Streamlined routing for easier page and component structure, allowing nested layouts and API routes to be managed in one framework.
- Performance Optimizations: Includes optimizations like faster page transitions, automatic image optimization, and built-in caching, making apps load faster.
- React Server Components: Supports seamless server and client-side rendering, with reduced loading times and lower data transfer requirements.
- Incremental Static Regeneration (ISR): Enables pages to update without requiring a full rebuild, enhancing flexibility for content-heavy apps.
- Enhanced TypeScript Support: First-class TypeScript integration for type-safe code, minimizing runtime errors.
Tailwind CSS
Tailwind CSS is a modern utility-first CSS framework designed to streamline front-end development by providing a vast library of low-level, customizable utility classes. Unlike traditional CSS frameworks that come with predefined components, Tailwind offers a more flexible approach, allowing developers to style elements directly in HTML. Each utility class in Tailwind serves a single purpose, such as setting colors, padding, margins, shadows, and typography, enabling fast prototyping and consistent, responsive designs.
With a focus on efficiency and ease of customization, Tailwind encourages developers to create unique interfaces without writing extensive custom CSS. Its utility-based approach minimizes CSS bloat, while configuration options and plugins allow seamless theming, dark mode support, and integration with other tools like PostCSS or PurgeCSS for optimal performance in production.
Tailwind CSS is perfect for building modern, responsive websites with minimal styling overhead and full design control right in your markup.
Main Features
Some of the main Next.js features include:
Feature | Description |
---|---|
Routing | A file-system based router built on top of Server Components that supports layouts, nested routing, loading states, error handling, and more. |
Rendering | Client-side and Server-side Rendering with Client and Server Components. Further optimized with Static and Dynamic Rendering on the server with Next.js. Streaming on Edge and Node.js runtimes. |
Data Fetching | Simplified data fetching with async/await in Server Components, and an extended fetch API for request memoization, data caching and revalidation. |
Styling | Support for your preferred styling methods, including CSS Modules, Tailwind CSS, and CSS-in-JS |
Optimization | Image, Fonts, and Script Optimizations to improve your application's Core Web Vitals and User Experience. |
TypeScript | Improved support for TypeScript, with better type checking and more efficient compilation, as well as custom TypeScript Plugin and type checker. |
Setup Development Environment
To kickstart the development of the web app with Trezo, at first need to setup the react development environment.
- Node.js and NPM: If NodeJS is not installed then download it from https://nodejs.org. NPM comes bundled with Node.js
NPM Packages
- Before proceding you'll need to install npm packages. You can do this by running
npm install
from the root of your project to install all the necessary dependencies.
Development Server
- Run
npm run dev
for a dev server. Navigate to http://localhost:3000. The app will autometically reload if you change any of the source files.
Building
-
Run npm run
build to build
the project. The build artifacts will be stored in the.next/
directory. More Help: Deploying -
For Static Exports: Run
npm run build
to build the project. The build artifacts will be stored in theout/
directory. More Help: Static Exports
Local Environment Installation
Open the react-nextjs-tailwindcss
folder in Visual Studio Code
and open a terminal on that folder and run these commands one by one.
1. npm install
2. npm run dev
3. Go To http://localhost:3000
4. Done
Pages and Components Info
- eCommerce dashboard (/src/app/dashboard/ecommerce/page.tsx)
- CRM dashboard (/src/app/dashboard/crm/page.tsx)
- Project Management dashboard (/src/app/dashboard/project-management/page.tsx)
- LMS dashboard (/src/app/dashboard/lms/page.tsx)
- Help Desk dashboard (/src/app/dashboard/helpdesk/page.tsx)
- Front page (/src/app/page.tsx)
- Front page features (/src/app/front-pages/features/page.tsx)
- Front page team (/src/app/front-pages/team/page.tsx)
- Front page faq (/src/app/front-pages/faq/page.tsx)
- Front page contact (/src/app/front-pages/contact/page.tsx)
- To Do List (/src/app/apps/to-do-list/page.js)
- and more...
Common Components:
- Providers (/src/providers/LayoutProvider.tsx)
- TopNavbar (/src/components/Layout/TopNavbar/index.tsx)
- LeftSidebar (/src/components/Layout/LeftSidebarMenu.tsx)
- Footer (/src/components/Layout/Footer.tsx)
- Control Panel (/src/components/Layout/ControlPanel/index.tsx)
- and more...
Dependencies
Here are the dependencies list which being used in the Trezo Nextjs Template:
"dependencies": {
"@fullcalendar/daygrid": "^6.1.15",
"@fullcalendar/interaction": "^6.1.15",
"@fullcalendar/react": "^6.1.15",
"@headlessui/react": "^2.2.0",
"apexcharts": "^4.3.0",
"material-symbols": "^0.27.2",
"next": "15.1.5",
"react": "^19.0.0",
"react-apexcharts": "^1.7.0",
"react-calendar": "^5.1.0",
"react-dom": "^19.0.0",
"react-simple-wysiwyg": "^3.2.0",
"react-svg-worldmap": "^2.0.0-alpha.16",
"remixicon": "^4.6.0",
"swiper": "^11.2.1",
"tailwind-scrollbar": "^3.1.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "15.1.5",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
Credits
Note: All images are used for preview purpose only and not included in the final purchase files.
Images
Google Fonts
IconFont
Packages
Additional Notes
If you need more details, please refer to the written instructions.
Feel free to reach out to our support team if you have any questions!