© Copyright preoiT .
Created : 9 Oct 2025
Last Update : 9 Oct 2025
By :
preoiT
Email : preoitinfo@gmail.com
Thank you for purchasing our **Eduan** - School, University &
Online Education Next.js Template
This document provides a comprehensive guide to setting up,
understanding, and customizing the template. It covers the file
structure, how to configure settings, work with components and
styles, manage state, deploy your project, and find support.
We've built this template using modern Next.js features (App
Router) and best practices to provide a performant and
developer-friendly experience.
If you have any questions or encounter any issues, please don't
hesitate to reach out for support.
Before you begin working with the Eduan Next.js template, ensure you have the following software installed on your system:
npm install -g yarnnpm install -g pnpmFollow these simple steps to get the template running on your local machine:
cd path/to/your/eduan-template
npm install
or
yarn install
or
pnpm install
This will install all the necessary libraries and packages
listed in the `package.json` file.
npm run dev
or
yarn dev
or
pnpm dev
You are now ready to start customizing the template!
The template follows a standard Next.js App Router structure, making it easy to navigate and modify. All files are well-organized for developer convenience.
After unzipping, you will find several files and folders in the root directory:
/src: This is the main source directory containing
your application code.
/public: This folder is for static assets like
images, fonts, and favicons that need to be served directly.
.gitignore: Specifies intentionally untracked files
that Git should ignore.
next-env.d.ts: TypeScript declaration file for
Next.js environment variables.
tsconfig.json: Configuration file for TypeScript.
next.config.js: Next.js configuration file for
advanced settings.
package-lock.json or yarn.lock or
pnpm-lock.yaml: Locks dependencies to specific
versions.
package.json: Lists project dependencies and
available scripts.
README.md: General information about the template
(often includes basic setup).
/src Folder:This is where the core of your application resides. Key subdirectories include:
/app: Contains all your pages and route-related
files (following the App Router convention).
/components: Houses reusable React components used
across different pages or sections.
/context: Contains files related to React Context
API for state management.
/data: Stores static data (like demo content) used
in the template.
/styles: Contains CSS and SCSS files for styling
the template.
/types: Defines TypeScript types and interfaces
used throughout the project for type safety.
/app**: This folder is central to Next.js App
Router. Any folder created here defines a route. For instance,
/app/about/page.tsx creates the `/about` route. The
page.tsx file acts as the index page for a
directory.
/components**: Components here are modular pieces
of UI. They are designed for reusability and can be modified
here according to your needs. Components are imported and used
within `app/` pages or other components.
/public**: Static assets placed here are served
from the root of your site (e.g.,
/public/img/logo.png is accessible at
/img/logo.png).
/data**: The index.ts file in this
folder is where you can find and modify the placeholder data
used in the demo (e.g., list of courses, instructors, etc.).
Updating this file will update the content displayed by the
components that consume this data.
/styles**: This folder contains all styling
assets. You'll find your core SCSS files here, along with any
included fonts or standard CSS files.
/types**: Using TypeScript types defined here
helps maintain consistency and type safety throughout the
project, reducing potential errors during development.
Beyond the initial installation, here are key areas you might want to configure:
The template comes with demo data for elements like course lists,
testimonials, etc. This data is typically stored in the
/src/data/index.ts file. To use your own content,
simply edit the data arrays and objects within this file. Ensure
you maintain the expected data structure (types) as defined in the
/src/types folder.
The next.config.js file in the root directory allows
for advanced Next.js configuration, such as setting up redirects,
modifying headers, enabling experimental features, or configuring
image optimization domains. Refer to the official Next.js
documentation for full details on options available here.
For sensitive information or variables that change between
development and production environments (like API keys, database
URLs, etc.), use environment variables. Create a
.env.local file in the root directory of your
project. Variables defined here will be available in your Next.js
code. For client-side variables, they must be prefixed with
NEXT_PUBLIC_.
# Example .env.local file
NEXT_PUBLIC_API_URL=https://your-api-url.com/api
SECRET_KEY=your_secret_api_key # Server-side only
Access them in your code using
process.env.NEXT_PUBLIC_API_URL (client/server) or
process.env.SECRET_KEY (server-side only).
The template is built using reusable React components, organized
for clarity and maintainability in the
/src/components folder.
Components are typically organized into sub-folders based on their purpose or the section they belong to (e.g., `Header`, `Footer`, `Sections`, `UI`).
These components are then imported and assembled within the page
files located in the
/src/app directory. Many components accept `props` to
allow for dynamic content and configuration. Reviewing the
component files will show you which props are expected and how the
data from index.ts is consumed.
You can easily modify existing components or create new ones following the same structure.
The template uses SCSS (Sass) for styling, providing features like
variables, nesting, mixins, and functions to write more
maintainable and organized CSS. The SCSS files are located in the
/src/styles folder.
The organization within the /scss sub-folder likely
follows a convention (e.g., 7-1 pattern, ITCSS) to structure
styles for different purposes (settings, tools, generic, elements,
objects, components, utilities).
SCSS modules are typically imported directly into the components that use them, leveraging Next.js's built-in support for CSS Modules or global SCSS imports.
The template utilizes React's Context API, managed within the
/src/context folder (specifically
context.tsx), for global state management.
This approach helps avoid "prop drilling" (passing props down through many nested components) by making certain state values and functions available directly to any component that needs them, regardless of how deep they are in the component tree.
The context.tsx file contains the provider component
and defines the state and functions shared across the app. To
access this shared state or functions within any component, you'll
use a custom hook provided by the context, likely named
useCustomContext (as mentioned).
// Example of consuming context in a component
import { useCustomContext } from '@/context/context'; // Adjust import path if needed
const MyComponent = () => {
const { sharedState, updateStateFunction } = useCustomContext();
// Use sharedState and updateStateFunction here
return (
<div>
<p>Shared State Value: {sharedState}</p>
<button onClick={() => updateStateFunction('new value')}>Update State</button>
</div>
);
};
Review the context.tsx file for details on what state
is managed and the available functions. The functions are
documented within the file for your better understanding.
The /src/app directory uses Next.js's App Router,
which provides a file-system based routing mechanism.
To define a route, you create a folder inside the
/app directory. For example, creating a folder named
`about` (`/src/app/about`) will create the `/about` route.
Inside a route folder, the `page.tsx` file acts as the index page for that route. So, `/src/app/about/page.tsx` handles the content for the `/about` URL.
This folder-based structure makes it intuitive to create nested routes as well (e.g., `/src/app/dashboard/settings/page.tsx` for the `/dashboard/settings` route).
Layouts and loading states can also be defined within this structure using `layout.tsx` and `loading.tsx` files, respectively, providing powerful control over UI rendering per route segment.
* Page-Level Component Returns a Single Main Component
* Main Component That Combines All Page Sections as Reusable Components
In the project directory, you can run the following standard Next.js scripts using your package manager:
npm run dev or yarn dev or
pnpm dev
Runs the application in development mode with hot-reloading. Opens [http://localhost:3000](http://localhost:3000) by default.
npm run build or yarn build or
pnpm build
Builds the application for production to the
.next folder. Optimizes the build for the best
performance.
npm run start or yarn start or
pnpm start
Starts the production server. You must run
npm run build first. Opens
[http://localhost:3000](http://localhost:3000) by default.
npm run lint or yarn lint or
pnpm lint
Runs ESLint to check for code quality and potential errors.
Consult the package.json file for any additional
custom scripts that might be included.
Here are some common customization tasks you might perform:
The main color palette and typography settings are defined using
SCSS variables. Look for files like
/src/styles/scss/abstracts/_colors.scss (path may
vary slightly) to modify global color schemes, font families, font
sizes, etc.
Replace placeholder images (located in the
/public/assets/img folder) with your own assets.
Ensure images are optimized for web performance. For images used
within components, you can also place them elsewhere in
/public or import them directly into components
depending on Next.js Image component usage.
As mentioned in the
Configuration section,
modify the data in /src/data/index.ts to change the
content displayed in various sections like courses, testimonials,
etc.
Customize the structure and appearance of individual sections or
UI elements by editing the relevant component files in the
/src/components folder.
Modify the SCSS files in /src/styles/scss to adjust
specific styles. Follow the existing SCSS structure and
methodology for consistency.
Deploying your Next.js application is straightforward. Vercel, created by the creators of Next.js, is a popular and recommended hosting platform, but other options are available.
Follow these steps to deploy your template to Vercel:
Vercel supports **Continuous Deployment**. Once set up, any changes you push to the linked Git branch (usually `main` or `master`) will automatically trigger a new build and deployment on Vercel.
You can also deploy Next.js applications to other platforms like Netlify, AWS, or by running your own Node.js server.
For the most up-to-date and detailed deployment instructions, please refer to the official Next.js Deployment Documentation.
This template utilizes the following libraries, fonts, and assets:
Thank you for choosing our Eduan template! We strive to provide high-quality products and support.
If you have carefully read through this documentation and still have questions, encounter bugs, or need assistance with specific issues related to the template's code and features as advertised, please reach out to us via the ThemeForest support channel.
You can contact us through our profile page: preoiT on ThemeForest.
We aim to provide timely and helpful support to ensure you have a smooth experience using our template.