This is a Next.js project for Rantale, a novel reading platform built with modern React patterns and shadcn/ui components.
- Node.js 18+
- npm, yarn, pnpm, or bun
- A running Laravel backend API
-
Clone and install dependencies:
npm install
-
Environment setup:
cp .env.example .env.local
Edit
.env.localwith your backend API URL:NEXT_PUBLIC_API_BASE_URL=http://localhost:8000/api/v1 NEXT_PUBLIC_APP_URL=http://localhost:3000
-
Run the development server:
npm run dev
Open http://localhost:3000 with your browser.
-
🔐 Complete Authentication System
- Email/password registration and login
- Google OAuth integration
- Email verification
- JWT token management
- Protected routes
-
🎨 Modern UI Components
- shadcn/ui component library
- Dark/light theme support
- Responsive design
- OKLCH color system
-
📡 API Integration
- Type-safe API client
- React hooks for data fetching
- Error handling
- Loading states
- Pagination support
src/
├── app/ # Next.js 15 App Router
│ ├── auth/ # Authentication pages
│ │ ├── login/ # Login page
│ │ ├── register/ # Registration page
│ │ └── google/callback/ # OAuth callback
│ ├── layout.tsx # Root layout with theme provider
│ └── page.tsx # Home page
├── components/ # React components
│ ├── ui/ # shadcn/ui components
│ └── navbar.tsx # Navigation with auth integration
├── hooks/ # Custom React hooks
│ ├── use-auth.ts # Authentication state management
│ ├── use-api.ts # Generic API hooks
│ └── use-novels.ts # Novel-specific data hooks
├── lib/ # Utilities
│ ├── api-client.ts # Centralized API client
│ ├── env.ts # Environment validation
│ └── utils.ts # Utility functions
├── services/ # API service layers
│ ├── auth.ts # Authentication services
│ ├── novels.ts # Novel services
│ └── reading.ts # Reading progress services
└── types/ # TypeScript interfaces
└── api.ts # API response types
npm run dev- Development server with Turbopacknpm run build- Production build with Turbopacknpm run start- Start production servernpm run lint- Run ESLint
Add shadcn/ui components:
npx shadcn@latest add [component-name]Components auto-configure with New York style and CSS variables.
- User Registration/Login → JWT token stored
- Protected API Calls → Token automatically included
- Profile Management → Real-time sync with backend
- Email Verification → Handled via backend routes
- API Integration Guide - Complete API setup and usage
- PWA Ready: PWA_READY.md
- PWA Quick Start: PWA_QUICKSTART.md
- PWA Offline Guide: PWA_OFFLINE_GUIDE.md
- PWA Test Checklist: PWA_TEST_CHECKLIST.md
- Diagnostics page (run app): /pwa-diagnostics
- Copilot Instructions - AI coding assistant guidelines
This frontend connects to a Laravel backend with Sanctum authentication. Required API routes:
POST /auth/register- User registrationPOST /auth/login- User loginGET /auth/me- Get user profilePOST /auth/logout- User logoutGET /auth/google- Google OAuthGET /auth/google/callback- OAuth callback
# Connect your repo to Vercel
# Add environment variables in dashboard
# Deploy automatically on pushnpm run build
npm run start- Next.js 15 - React framework with App Router
- TypeScript - Type safety
- Tailwind CSS v4 - Styling with OKLCH colors
- shadcn/ui - Component library
- Radix UI - Headless components
- Lucide React - Icons
- next-themes - Theme management
This project is private and proprietary.