This guide provides the necessary steps to run a Next.js 14 application locally.
Ensure you have the following installed:
-
Clone the Repository
git clone https://github.com/fadeladen/nabitu-assesment.git cd nabitu-assesment
-
Install Dependencies Using npm:
npm install
Or using Yarn:
yarn install
Start the development server:
npm run dev
or
yarn dev
The app will be available at http://localhost:3000
by default.
Build and start the production server:
npm run build
npm run start
or
yarn build
yarn start
-
Linting:
npm run lint
or
yarn lint
-
Formatting (Prettier):
npm run format
or
yarn format
- Library:
react-hook-form
for handling form state and submission. - Validation:
Zod
is used for schema validation, ensuring data integrity and reducing manual validation logic.
- Material UI (
@mui/material
) is used for a modern and accessible UI design. - Provides pre-built components like buttons, inputs, and tables, making the UI development process faster and more consistent.
- The app uses localStorage to persist invoice data, ensuring that information is retained even after a page refresh.
- This approach eliminates the need for a backend database for this assessment while still providing a functional user experience.
- Invoice Management:
- Create a new invoice.
- List all invoices in a data table.
- Edit and update existing invoices.
- Delete invoices.
- Navigation:
- A responsive sidebar for seamless navigation between pages.
- Using react-hook-form reduces unnecessary re-renders, making form interactions more efficient.
- Material UI’s built-in styling system (
sx
prop and theme provider) optimizes the rendering of UI elements.
- The default port is
3000
, but you can specify a different port using:PORT=4000 npm run dev