A modern Next.js 15 web application for product presentation and product management with an admin dashboard.
- Technology Stack
- Features
- Project Structure
- Installation
- Development
- Database
- Authentication
- Deployment
- Environment Variables
- Code Conventions
- Framework: Next.js 15 (App Router)
- Language: TypeScript (Strict Mode)
- UI Library: React 19
- Styling: TailwindCSS + Shadcn/UI
- Database: MongoDB (via Prisma ORM)
- Authentication: NextAuth v5
- Image Management: Cloudinary
- Package Manager: pnpm
- Deployment: Vercel
- UI Components: Radix UI (Dialog, Dropdown, Select, Navigation, etc.)
- Forms: React Hook Form + Zod
- Styling Tools: class-variance-authority, clsx, tailwind-merge
- Carousel: Embla Carousel React
- Email: Nodemailer
- Password Hashing: bcryptjs
- Product Catalog: Overview of all products by category
- Product Details: Detailed view with image gallery, articles, and color variants
- Product Search: Combobox-based search across all products
- Responsive Design: Optimized for desktop and mobile
- Dark/Light Mode: Theme toggle for better user experience
- Product Management:
- Create new products
- Edit existing products
- Delete products
- Image upload via Cloudinary
- Article Management:
- Add articles to products
- Edit and delete articles
- Color Management:
- Manage color palettes
- Assign colors to products
- Admin Login: Email/password-based authentication
- Password Reset: Secure password recovery via email
- Session Management: Automatic session validation
- Protected Routes: Middleware-protected admin area
baumann/
βββ prisma/
β βββ schema.prisma # Datenbankschema (MongoDB)
βββ public/
β βββ fonts/ # Fonts
β βββ icons/ # Icons
β βββ images/ # Static images
βββ src/
β βββ app/ # Next.js App Router
β β βββ (admin)/ # Admin area (protected)
β β β βββ dashboard/ # Dashboard pages
β β βββ (auth)/ # Authentication pages
β β β βββ login/
β β β βββ password-request/
β β β βββ password-reset/
β β βββ api/auth/ # NextAuth API routes
β β βββ products/ # Public product pages
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Homepage
β βββ components/ # React components
β β βββ auth/ # Auth components
β β βββ forms/ # Form components
β β βββ layout/ # Layout components (Navbar, Theme)
β β βββ products/ # Product components
β β βββ shared/ # Shared components
β β βββ ui/ # Shadcn/UI components
β βββ constants/ # Constants and configuration
β βββ features/ # Feature modules
β β βββ article/ # Article feature
β β βββ auth/ # Auth feature
β β βββ color/ # Color feature
β β βββ product/ # Products feature
β βββ lib/ # Utilities and helpers
β β βββ helpers/ # Helper functions
β β βββ hooks/ # Custom React hooks
β βββ styles/ # Global styles
β βββ auth.ts # NextAuth configuration
β βββ middleware.ts # Next.js middleware
βββ .github/
β βββ instructions/ # Copilot instructions
βββ components.json # Shadcn/UI config
βββ next.config.ts # Next.js config
βββ tailwind.config.ts # Tailwind config
βββ tsconfig.json # TypeScript config
- Node.js 18+
- pnpm (recommended)
- MongoDB database
- Cloudinary account
- Clone repository:
git clone <repository-url>
cd baumann- Install dependencies:
pnpm install- Configure environment variables:
cp .env.example .envFill the .env file with your values (see Environment Variables).
- Generate Prisma client:
pnpm prisma generate- Initialize database:
# Optional: Open Prisma Studio
pnpm prisma studio# With Turbopack (faster)
pnpm dev
# Without Turbopack
pnpm no-turboThe application runs at http://localhost:3000.
# Production build
pnpm build
# Start production server
pnpm start
# Linting
pnpm lint
# Prisma Studio (database GUI)
pnpm prisma studioCollections:
admin- Admin users for authenticationpassword_reset- Temporary password reset tokensproducts- Product informationarticles- Article variants for productscolors- Color definitionsproduct_colors_connection- Products β Colors mapping
MongoDB automatically deletes expired password reset tokens:
db.password_reset.createIndex({ expiresAt: 1 }, { expireAfterSeconds: 0 })# Update schema and migrate
pnpm prisma db push
# Regenerate Prisma Client
pnpm prisma generate
# Open Prisma Studio
pnpm prisma studioThe app uses NextAuth v5 (Beta) with Credentials Provider.
- Email/password login for admin users
- Session-based authentication
- Password hashing with bcryptjs
- Password reset via email (Nodemailer)
- Protected routes via middleware
An admin user must be manually created in the database:
// Hash password
const hashedPassword = await bcrypt.hash("your-password", 10);
// Insert into MongoDB
db.admin.insertOne({
email: "admin@example.com",
password: hashedPassword,
});The app is optimized for Vercel.
- Connect repository with Vercel
- Set environment variables
- Deploy!
# Preview deployment
vercel
# Production deployment
vercel --prod- Turbopack for faster dev builds
- Automatic image optimization via next/image
- Server Components for better performance
- Static & Dynamic Rendering
Create a .env file in the root directory:
# Database
DATABASE_URL="mongodb+srv://..."
# NextAuth
AUTH_SECRET="<generate-with-openssl-rand-base64-32>"
AUTH_URL="http://localhost:3000"
# Cloudinary
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="your-cloud-name"
CLOUDINARY_API_KEY="your-api-key"
CLOUDINARY_API_SECRET="your-api-secret"
# Email (Nodemailer)
EMAIL_SERVER_USER="your-email@example.com"
EMAIL_SERVER_PASSWORD="your-email-password"
EMAIL_SERVER_HOST="smtp.example.com"
EMAIL_SERVER_PORT="587"
EMAIL_FROM="noreply@example.com"
# Environment
NODE_ENV="development"- Strict Mode enabled
- Explicit typing required
- No
any(unless absolutely necessary) - JSDoc for complex functions
- Server Components as default
- Client Components only when interactivity needed (
"use client") - Server Actions for mutations (no
fetchfrom client) useActionStatefor form logic- No
useEffectfor data fetching
- Only TailwindCSS (no CSS Modules, no inline styles)
- Shadcn/UI as component base
- Prettier plugin for automatic class sorting
- kebab-case for files and folders
- Components:
ComponentName.tsx - Actions:
actionName.ts - Types:
types.tsorschema.ts
Each feature (article, color, products, auth) has:
feature/
βββ actions/ # Server Actions
βββ schemas/ # Zod Schemas
βββ types/ # TypeScript Types
βββ index.ts # Public API
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is private and not intended for public use.
Note: This documentation is based on the current project structure (as of October 2025). Please update this README when changes are made.