@peakiq/hotel-admin-panel
v1.0.1
Published
Reusable hotel admin panel for Next.js App Router. Includes rooms, bookings, gallery, CMS, SEO, users, and more.
Downloads
313
Maintainers
Readme
@peakiq/hotel-admin-panel
Reusable hotel admin panel for Next.js App Router. Includes rooms, bookings, gallery, CMS, SEO, users, and more.
Quick Start
# 1. Create a new Next.js project
npx create-next-app my-hotel
cd my-hotel
# 2. Install the package
npm install @peakiq/hotel-admin-panel
# 3. Run the setup CLI (copies all admin files, installs deps, sets up database)
npx hotel-admin-setup .
# 4. Start the dev server
npm run devVisit http://localhost:3000/admin
The setup CLI will:
- Copy admin pages, API routes, and lib files into your project
- Install all required dependencies
- Prompt for
DATABASE_URLif not in.env - Create database tables
- Create a super admin user
- Print your login credentials
What Gets Installed
After setup, your project will have:
app/
admin/ ← 26 admin pages (generated)
api/ ← 41 API routes (generated)
actions/ ← 2 server actions (generated)
globals.css ← yours
layout.tsx ← yours
page.tsx ← yours
lib/ ← 16 re-export files (generated)
config.ts ← yours (hotel configuration)
middleware.ts ← yours (auth gate)All generated files import from the package — edit them to customize.
Environment Variables
The CLI creates a .env file with DATABASE_URL and SESSION_SECRET automatically.
| Variable | Required | Description |
|----------|----------|-------------|
| DATABASE_URL | Yes | PostgreSQL connection string (get free at neon.tech) |
| SESSION_SECRET | Yes | Auto-generated by CLI |
| HOTEL_NAME | No | Hotel display name (default: "My Hotel") |
| NEXT_PUBLIC_SITE_URL | No | Full site URL |
| CLOUDINARY_CLOUD_NAME | No | For image uploads |
| CLOUDINARY_API_KEY | No | For image uploads |
| CLOUDINARY_API_SECRET | No | For image uploads |
| SMTP_HOST | No | For email notifications |
| SMTP_PORT | No | For email notifications |
| SMTP_USER | No | For email notifications |
| SMTP_PASS | No | For email notifications |
Programmatic Usage
import { setConfig, getConfig } from "@peakiq/hotel-admin-panel";
setConfig({
hotelName: "My Hotel",
siteUrl: "https://myhotel.com",
cloudinaryPrefix: "my-hotel",
contactEmail: "[email protected]",
});
const config = getConfig();
console.log(config.hotelName);Features
- Rooms — CRUD with drag-and-drop reorder, image galleries, amenities
- Bookings — Channel manager with status workflow, inventory view
- Gallery — Image management with bulk upload
- Media — Cloudinary media library
- Pages — CMS page editor with markdown
- Experiences — Hotel experience cards
- Nearby Places — Attraction management
- Amenities — Amenity management
- Testimonials — Guest review management
- Offers — Package/pricing management
- SEO — Meta tags, OG images, canonical URLs
- Users — Role-based access control (super_admin, admin, manager)
- Settings — Site config, 2FA, backups
- Authentication — Email/password + TOTP 2FA
- Cloudinary — Image upload/delete
- Email — Booking notifications, contact form
- OTA Updates — Over-the-air package updates with rollback
- Config Validator — Setup wizard ensures all config is complete
License
MIT
