Skip to content

NadeeshaNJ/Database-Back

Repository files navigation

SkyNest Hotel Management - Backend API

RESTful API backend for the SkyNest Hotel Management System, built with Node.js, Express, and PostgreSQL.

🚀 Live Production

🛠️ Tech Stack

  • Runtime: Node.js
  • Framework: Express.js
  • Database: PostgreSQL
  • ORM: Sequelize
  • Authentication: JWT (JSON Web Tokens)
  • Password Hashing: bcrypt
  • Deployment: Render

📋 Features

  • User authentication and authorization (Admin, Manager, Receptionist, Accountant, Customer)
  • Branch management (Colombo, Kandy, Galle)
  • Room and booking management
  • Guest management
  • Service usage tracking
  • Payment processing
  • Billing and adjustments
  • Comprehensive reporting and analytics
  • Pre-booking system

🔧 Local Development

Prerequisites

  • Node.js 14+
  • PostgreSQL (or use Render cloud database)

Installation

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your configuration

# Start development server
npm start

Environment Variables

PORT=5000
NODE_ENV=development
DATABASE_URL=your_postgresql_connection_string
JWT_SECRET=your_jwt_secret
JWT_EXPIRES_IN=24h
FRONTEND_URL=http://localhost:3000

📚 API Documentation

Authentication

  • POST /api/auth/login - User login
  • POST /api/auth/register - User registration
  • GET /api/auth/profile - Get user profile

Bookings

  • GET /api/bookings - Get all bookings
  • POST /api/bookings - Create new booking
  • GET /api/bookings/:id - Get booking details
  • PUT /api/bookings/:id - Update booking
  • DELETE /api/bookings/:id - Cancel booking

Guests

  • GET /api/guests/all - Get all guests
  • POST /api/guests - Add new guest
  • GET /api/guests/:id - Get guest details
  • PUT /api/guests/:id - Update guest

Rooms

  • GET /api/rooms - Get all rooms
  • GET /api/rooms/available - Get available rooms
  • POST /api/rooms - Add new room
  • PUT /api/rooms/:id - Update room

Payments

  • GET /api/billing/payments - Get all payments
  • POST /api/billing/payments - Process payment
  • GET /api/billing/adjustments - Get adjustments

Reports

  • GET /api/reports/dashboard-summary - Dashboard statistics
  • GET /api/reports/revenue - Revenue reports
  • GET /api/reports/occupancy - Occupancy reports

🔐 Default Credentials

Username: admin
Password: password123

Note: Change default passwords in production!

🧪 Testing

npm test

📦 Deployment

Automatically deployed to Render on push to main branch via GitHub Actions CI/CD.

📝 License

Proprietary - Database Project

👥 Authors

Database Project Team

About

SkyNest Hotel Management System - Backend API Visibility: Public (or Private, your choice)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •