A Next.js 15 sales management dashboard using PostgreSQL, styled with Tailwind CSS, and deployed on Vercel.
The app provides a summary dashboard, a table of invoices, and a table view of sellers, with optimized handling of large datasets. User authentication is managed by NextAuth.js, and Kysely is used for database interactions.
- Framework: Next.js 15 with App Router.
- Database: PostgreSQL (managed with Kysely).
- Authentication: NextAuth.js v5.
- UI: shadcn/ui components and Tailwind CSS.
- Testing: Cypress and Jest.
- Deployment: Vercel.
The main folders in the project structure are:
-
Root Folder:
__tests__
: Unit tests.cypress
: E2E tests.public
: Public assets.src
: Application logic and source code.
-
Inside
src
Folder:src/app
: Defines the routing structure, and layouts.src/components
: All application components.src/components/ui
: For UI components.src/hooks
: Custom hooks.src/lib
: Server actions, database access functions, and utilities.src/schemas
: Zod schemas for validation.src/types
: Type definitions.
-
Ensure Node.js (version 18.18 or above) and pnpm are installed on your system.
-
If not installed, download Node.js from nodejs.org and install pnpm globally using:
npm install -g pnpm
-
-
Clone the repository:
git clone https://github.com/MarioMS90/sales-management-dashboard
-
Install project dependencies:
pnpm install
-
Start the local development server:
pnpm run dev
-
To reset the database and seed it with new test data, visit: http://localhost:3000/seed
Default user for login:
- Email:
[email protected]
- Password:
123456
- Email:
-
To run the tests, use the following commands:
Unit tests:
pnpm run test
E2E tests:
pnpm run build && pnpm run start // In a new terminal, open Cypress: pnpm run cypress:open
The .env.local
file is included in the repository to facilitate testing without additional setup.