@carlasanudo44/booking-app
v1.0.0
Published
Booking system library with authentication and booking management
Readme
Booking System Console App
A comprehensive console-based booking system for apartment rentals with support for clients and hosts.
Features
- User Authentication: Login and registration for both clients and hosts
- Apartment Listings: Hosts can create and manage apartment listings with pricing, amenities, and descriptions
- Calendar View: Visual calendar showing available dates for each apartment
- Booking Management:
- Clients can make bookings
- Hosts can approve or reject pending bookings
- Both can cancel bookings
- Price Calculation: Automatic price calculation based on number of nights
- Availability Checking: System prevents double-booking and checks date availability
Getting Started
Installation
npm installRunning the Application
npm startSample Accounts
The application comes with pre-configured sample accounts:
Host Account:
- Username:
host1 - Password:
host123
Client Account:
- Username:
client1 - Password:
client123
Usage Guide
For Clients
- Login with your client credentials
- Browse Apartments to see available listings
- View Apartment Calendar to check available dates
- Make a Booking by selecting an apartment and providing:
- Check-in date (YYYY-MM-DD format)
- Check-out date (YYYY-MM-DD format)
- Number of guests
- View My Bookings to see all your bookings and their status
- Cancel Booking if needed
For Hosts
- Login with your host credentials
- View My Apartments to see your listings
- Add New Apartment with details like:
- Title and description
- Location
- Price per night
- Maximum guests
- Amenities (comma-separated)
- View Pending Bookings to see bookings awaiting approval
- Approve/Reject Booking to manage booking requests
- View All Bookings to see all bookings for your apartments
Guest Access
Even without logging in, you can:
- Browse available apartments
- View apartment details and pricing
Project Structure
booking.test/
├── index.ts # Main application entry point and console interface
├── types.ts # TypeScript type definitions
├── store.ts # In-memory data store
├── auth.ts # Authentication service
├── booking-service.ts # Booking business logic
├── utils.ts # Utility functions (date formatting, calendar display, etc.)
├── package.json
└── tsconfig.jsonTechnical Details
- Language: TypeScript
- Runtime: Node.js
- Module System: ES Modules
- Data Storage: In-memory (data resets on restart)
Date Format
When making bookings, use the format: YYYY-MM-DD (e.g., 2024-12-25)
Calendar Legend
[XX]= TodayXX= Available dateX= Unavailable date
