A minimal viable product (MVP) for a hostel booking platform focused on Portugal, built with modern web technologies for streamlined hostel management and room inventory.
- Frontend: Next.js 14 (App Router) with React 18
- Backend: Next.js API routes with Prisma ORM
- Database: SQLite (development) with PostgreSQL migration path
- Styling: Tailwind CSS v3.4.0 (minimal implementation)
- Authentication: JWT-based with middleware protection
- β Property Management: Create and manage hostel properties
- β Room Inventory: Add/edit/delete room types with bed counts
- β Admin Dashboard: Simple room management interface
- β Authentication: Login/logout with protected routes
- β API Layer: RESTful endpoints for properties and rooms
- β Responsive Design: Mobile-first with Tailwind CSS
β οΈ No User Registration: Admin access only (no public booking)β οΈ Single Property: MVP assumes one property per deploymentβ οΈ No Payments: Booking requests only (no payment processing)β οΈ No Reviews: Basic functionality without user feedbackβ οΈ Demo Mode: Changes may not persist in preview environments
- Vercel account connected to your GitHub repository
- Environment variables configured in Vercel dashboard
# Push to main branch for automatic deployment
git add .
git commit -m "Deploy minimal MVP"
git push origin main
- Build Command:
prisma generate && next build
- Install Command:
npm ci
- Node Version: 18.x
- Database: SQLite (automatically created on first deploy)
DATABASE_URL="file:./dev.db"
JWT_SECRET="your-secure-jwt-secret-here"
NEXTAUTH_SECRET="your-nextauth-secret-here"
NEXTAUTH_URL="https://your-app.vercel.app"
- Database Setup: Run
npx prisma db push
in Vercel functions - Seed Data: Run
npx prisma db seed
for sample data - Admin Access: Create admin user via API or database
- Login URL:
/login
- Admin Dashboard:
/admin
(protected route) - Dashboard:
/dashboard
(after login)
- Navigate to
/login
- Enter admin credentials
- Redirected to
/dashboard
on success - Access
/admin
for room management
- β Middleware Protection: Dashboard routes require authentication
- β JWT Tokens: Secure session management
β οΈ No Registration: Admin users must be created manuallyβ οΈ i18n Issue: Login page may show translation errors (fix needed)
-- Manual database entry (SQLite)
INSERT INTO User (email, password, role)
VALUES ('admin@example.com', '$2b$10$hashedpassword', 'admin');
- Navigate to
/admin
- Fill room details:
- Room Name: e.g., "6-Bed Mixed Dorm"
- Total Beds: 1-24 beds
- Bathroom: Private or shared
- Click "Create Room"
- Room List: Shows all created rooms
- Details: Name, bed count, bathroom type
- Actions: Delete rooms (with confirmation)
- β Create Rooms: Add new room types
- β Delete Rooms: Remove unwanted rooms
- β Real-time Updates: Changes reflect immediately
β οΈ Single Property: All rooms belong to one propertyβ οΈ No Editing: Rooms can only be created/deleted
// Get all rooms
GET /api/rooms
// Create room
POST /api/rooms
{
"propertyId": "property-uuid",
"name": "6-Bed Mixed Dorm",
"bedsTotal": 6,
"hasBathroom": false
}
// Delete room
DELETE /api/rooms/{roomId}
-- Key tables
Property (id, name, location, createdAt)
Room (id, propertyId, name, bedsTotal, hasBathroom, createdAt)
User (id, email, password, role, createdAt)
# Install dependencies
npm install
# Start development server
npm run dev
# Database operations
npx prisma generate
npx prisma db push
npx prisma db seed
# Build for production
npm run build
app/
βββ layout.tsx # Root layout (minimal, no i18n)
βββ page.tsx # Home page with search
βββ admin/page.tsx # Room management interface
βββ login/page.tsx # Authentication (has i18n issues)
βββ api/
β βββ properties/ # Property CRUD
β βββ rooms/ # Room CRUD
β βββ admin/ # Admin utilities
lib/
βββ prisma.ts # Database client
βββ auth-context.tsx # Authentication context
βββ services/ # Business logic services
# Test properties endpoint
curl http://localhost:3000/api/properties
# Test rooms endpoint
curl http://localhost:3000/api/rooms
# Test admin setup (requires auth)
curl -X POST http://localhost:3000/api/admin/setup
- Fix Login i18n: Remove
useTranslations
from login page - Add Auth API: Create
/api/auth/login
endpoint - User Registration: Implement admin user creation flow
- Property Management: Multiple properties support
- Public Booking: User registration and booking flow
- Payment Integration: Stripe/PayPal integration
- Reviews System: User feedback and ratings
- Email Notifications: Booking confirmations
- PostgreSQL Migration: Replace SQLite for production
- Environment Config: Proper env variable management
- Error Handling: Comprehensive error boundaries
- Security Audit: JWT and API security review
# Install dependencies
npm install
# Setup database
npx prisma generate
npx prisma db push
# Seed with sample data (optional)
npx prisma db seed
# Start development server
npm run dev
Visit http://localhost:3000 to see the application.
- Database: Schema is automatically created
- Admin Access: Create admin user in database or via API
- Room Setup: Use
/admin
to add room types - Testing: Use
/
to view public interface
This MVP provides a solid foundation for a hostel booking platform with core room management functionality, ready for deployment and further development.