A modern, production-ready full-stack web application built with Next.js, React, TypeScript, PostgreSQL, and Prisma. Features a beautiful landing page with multi-page routing, a working contact form with database persistence, Cal.com booking integration, and a password-protected admin dashboard to view submissions.
Live Demo: newbizz-react.vercel.app
Newbizz is a business landing page platform that showcases a services/SaaS company's offerings and captures leads. It combines a polished, animated frontend with a real backend infrastructure β making it a complete portfolio piece demonstrating full-stack web development skills.
- Real Database: PostgreSQL via Neon β contact submissions are persisted and queryable
- Authentication: Cookie-based session auth (no external service required)
- Admin Dashboard: Server-rendered page showing all submissions, stats, and filtering
- Mobile-First: Responsive design with hamburger menu and touch-optimized interactions
- Production-Ready: Deployed on Vercel with proper environment management and build optimization
- Animations: Framer Motion for scroll reveals, page transitions, and interactive elements
- Next.js 16 β React framework with App Router, server/client components
- React 18.3 β UI component library
- TypeScript β Type-safe code across the stack
- Tailwind CSS β Utility-first styling with custom design tokens
- Framer Motion β Declarative animations (scroll reveals, micro-interactions, transitions)
- Next.js API Routes β Serverless API endpoints for contact form & admin auth
- PostgreSQL 15 β Relational database (hosted on Neon)
- Prisma 5 β Type-safe ORM with auto-generated client
- Node.js crypto β Session token generation and HMAC signing (no external auth library)
- Neon PostgreSQL β Free serverless PostgreSQL with auto-scaling
- Prisma Migrate β Schema management and migrations
- Prisma Studio β Visual database explorer
- Vercel β Edge-optimized hosting for Next.js applications
- GitHub β Source control with auto-deploy on push
- dotenv β Environment variable management
- Cal.com β Embedded booking calendar for scheduling calls
- Node.js β Server runtime for API routes and build processes
- Home β Hero section with animated gradient orb, scroll-reveal sections, social proof stats
- Services β Tiered service offerings with descriptions and durations
- Pricing β Three pricing tiers with feature comparisons (Starter, Growth, Scale)
- Book a Call β Embedded Cal.com calendar for scheduling 30-minute intro calls
- Contact β Full-featured contact form with real-time validation and database persistence
- Admin Login β Password-protected entry point to submissions dashboard
- Client-side form validation (email format, message length, etc.)
- Server-side validation (defense-in-depth, no trusting client input)
- Real-time error messaging with smooth animations
- Success confirmation with animated checkmark
- Data persists to PostgreSQL database
- Password-protected (HTTP-only cookie session token)
- Real-time stats: total submissions, last 7 days, unique companies
- Sortable table view of all contact submissions
- Displays name, email, company, message, and received date
- Server-rendered for security (auth happens server-side)
- Log out functionality that clears session cookie
- Sticky header with scroll-aware background blur
- Desktop nav bar with animated active-link underline
- Mobile hamburger menu (three-line icon β β animation)
- Auto-closing menu on route change
- Focus-ring keyboard accessibility on all buttons/links
- Dark theme with accent orange (#ED834E)
- Next.js Turbopack for fast dev builds
- Image optimization (lazy loading, srcset)
- Semantic HTML with ARIA labels
- Keyboard navigation support
- Respects
prefers-reduced-motionfor accessibility - Mobile-responsive breakpoints (sm: 640px, md: 768px, lg: 1024px)
newbizz-react/
βββ src/
β βββ app/
β β βββ layout.tsx # Root layout with fonts & providers
β β βββ page.tsx # Home page
β β βββ globals.css # Global styles
β β βββ services/
β β β βββ page.tsx # Services page
β β βββ pricing/
β β β βββ page.tsx # Pricing page
β β βββ book/
β β β βββ page.tsx # Cal.com booking page
β β βββ contact/
β β β βββ page.tsx # Contact form page
β β βββ admin/
β β β βββ login/
β β β β βββ page.tsx # Admin login form
β β β βββ dashboard/
β β β βββ page.tsx # Admin submissions dashboard
β β βββ api/
β β βββ contact/
β β β βββ route.ts # Contact form API endpoint
β β βββ admin/
β β βββ login/
β β β βββ route.ts # Admin login API endpoint
β β βββ logout/
β β βββ route.ts # Admin logout API endpoint
β βββ lib/
β β βββ prisma.ts # Prisma client singleton
β β βββ auth.ts # Session token & password auth
β βββ components/
β β βββ Nav.tsx # Navigation with mobile menu
β β βββ Footer.tsx # Footer
β β βββ Hero.tsx # Hero section
β β βββ Reveal.tsx # Scroll-reveal animation wrapper
β β βββ ContactForm.tsx # Contact form component
β β βββ LogoutButton.tsx # Logout button for admin
β βββ middleware.ts # Edge middleware for auth guard
βββ prisma/
β βββ schema.prisma # Database schema & models
βββ public/ # Static assets
βββ .env # Environment variables (gitignored)
βββ .env.example # Template for env vars
βββ .gitignore # Git exclusions
βββ package.json # Dependencies & scripts
βββ tsconfig.json # TypeScript configuration
βββ tailwind.config.ts # Tailwind CSS configuration
βββ postcss.config.js # PostCSS configuration
βββ next.config.js # Next.js configuration
βββ vercel.json # Vercel build configuration
βββ README.md # This file
- Node.js 18.17+ (check with
node --version) - npm or yarn package manager
- Git
-
Clone the repository (or download from GitHub):
git clone https://github.com/rashi-gupta-08/newbizz-react.git cd newbizz-react -
Install dependencies:
npm install
-
Set up environment variables:
- Copy
.env.exampleto.env:cp .env.example .env
- Fill in the three required values:
DATABASE_URLβ PostgreSQL connection string from NeonADMIN_PASSWORDβ Password you'll use to log into the admin panelSESSION_SECRETβ Long random string (generate withnode -e "console.log(require('crypto').randomBytes(32).toString('hex'))")
- Copy
-
Run the database migration (creates tables):
npx prisma migrate dev --name init
-
Start the dev server:
npm run dev
Open http://localhost:3000 in your browser.
npm run dev # Start dev server (with hot reload)
npm run build # Build for production
npm start # Start production server
npm run lint # Run ESLint
npm run db:migrate # Create a new migration
npm run db:studio # Open Prisma Studio (visual database editor)- Go to neon.tech and sign up (GitHub login is fastest)
- Create a new project
- Copy your connection string (labeled "Pooled connection")
- Paste it as
DATABASE_URLin your.envfile - Run
npx prisma migrate devto create tables
Every time you update prisma/schema.prisma, create a migration:
npx prisma migrate dev --name describe_your_changeThis generates a SQL migration file and applies it to your database.
Open Prisma Studio to browse/edit data visually:
npm run db:studioCreate a .env file in the project root (see .env.example):
# PostgreSQL connection string from Neon
# Format: postgresql://user:password@host/dbname?sslmode=require
DATABASE_URL=postgresql://neondb_owner:...
# Password to log into /admin/login
ADMIN_PASSWORD=YourStrongPasswordHere
# Long random string for signing session tokens
# Generate: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
SESSION_SECRET=a3f8c2d1e9b7...64_random_characters...Important: Never commit .env to Git. It contains your database password and should stay local only.
-
Push your code to GitHub:
git add . git commit -m "Your commit message" git push
-
Import project on Vercel:
- Go to vercel.com/new
- Click "Import" next to your GitHub repository
- Vercel auto-detects Next.js β leave build settings as-is
- Click Deploy
-
Set environment variables on Vercel:
- In your project dashboard, go to Settings β Environment Variables
- Add
DATABASE_URL,ADMIN_PASSWORD, andSESSION_SECRET - Vercel will redeploy automatically
-
Your site is live!
- Vercel assigns a URL like
newbizz-react-yourname.vercel.app - Every
git pushtriggers an automatic redeploy
- Vercel assigns a URL like
- β
.envis in.gitignore(secrets never pushed) - β Environment variables set on Vercel
- β Database is live and connected
- β Form submissions persist to database
- β Admin dashboard is password-protected
- β SSL/HTTPS enabled (Vercel does this automatically)
model ContactSubmission {
id String @id @default(cuid())
name String
email String
company String?
message String
createdAt DateTime @default(now())
@@index([createdAt])
}| Field | Type | Notes |
|---|---|---|
id |
String | Unique identifier (CUID) |
name |
String | Contact's full name |
email |
String | Contact's email address |
company |
String? | Contact's company (optional) |
message |
String | Message body |
createdAt |
DateTime | Submission timestamp (auto-set) |
- User visits
/admin/loginand enters password - POST to
/api/admin/loginwith password - Server validates against
ADMIN_PASSWORDenv var - On success, server generates a signed session token:
- Token =
<timestamp>.<hmacSignature> - Signature is HMAC-SHA256 of timestamp using
SESSION_SECRET
- Token =
- Token stored in HTTP-only secure cookie
- Subsequent requests to
/admin/dashboardcheck cookie validity - Session expires after 7 days
- Client-side: Real-time error feedback as user types
- Server-side: Double-checks all inputs before database write
- Prevents malformed data and SQL injection attacks
- Background:
#0A0A0C(near-black) - Surface:
#131316(slightly lighter) - Accent:
#ED834E(warm orange) - Text:
#F5F3EF(off-white) - Muted:
#8A8782(gray for secondary text)
- Display: Space Grotesk (headings, brand)
- Body: Inter (paragraph text, form labels)
- Scroll reveals on sections (fade + slide up)
- Drifting gradient orb behind hero
- Animated hamburger menu (β° β β)
- Micro-interactions on buttons and links
- Respects
prefers-reduced-motionfor accessibility
- Core Web Vitals: Optimized for Largest Contentful Paint, First Input Delay, Cumulative Layout Shift
- Turbopack: Next.js 16 uses Turbopack for ~3x faster builds
- Database: Neon's auto-scaling handles traffic spikes
- CDN: Vercel's global edge network serves content from closest region
- Caching: Automatic caching of static pages and assets
This project is open source and available under the MIT License β feel free to use it as a template for your own projects.
This README documents the architecture, setup, and deployment of a full-stack web application suitable for production use. For questions or issues:
- Check the Next.js documentation
- Review Prisma docs
- See Vercel deployment guide
Built with Next.js, React, TypeScript, Tailwind CSS, Framer Motion, PostgreSQL, Prisma, and deployed on Vercel.
Live: newbizz-react.vercel.app