Skip to content

Repository files navigation

EasyHosts.Site


🇧🇷 Português

Sistema web de gerenciamento hoteleiro desenvolvido como Projeto Interdisciplinar do curso de Análise e Desenvolvimento de Sistemas da FATEC Prof. João Mod (Guaratinguetá/SP) — 2022.

Funcionalidades

  • Catálogo de quartos — listagem com fotos, tipos (Prata/Ouro/Diamante), capacidade e valor da diária
  • Reserva online — check-in/check-out, cálculo automático do valor total, geração de código de reserva
  • Cadastro e autenticação — registro com validação de CPF, confirmação por e-mail, login via FormsAuthentication
  • Perfis de usuário — Admin, Funcionário e Cliente
  • Eventos da cidade — divulgação de eventos locais (shows, esportes, cultura, etc.)
  • Segurança — CSP, anti-forgery token, headers de proteção (X-Frame-Options, X-Content-Type-Options, X-XSS-Protection, Referrer-Policy)

🇬🇧 English

A hotel management web application built as an Interdisciplinary Project for the Systems Analysis and Development program at FATEC Prof. João Mod (Guaratinguetá/SP, Brazil) — 2022.

Features

  • Room catalog — listing with photos, types (Silver/Gold/Diamond), capacity, and daily rates
  • Online booking — check-in/checkout, automatic total calculation, booking code generation
  • Registration and authentication — CPF validation, email confirmation, FormsAuthentication login
  • User profiles — Admin, Employee, and Customer
  • City events — local event listings (shows, sports, culture, etc.)
  • Security — CSP, anti-forgery tokens, protection headers (X-Frame-Options, X-Content-Type-Options, X-XSS-Protection, Referrer-Policy)

Architecture / Arquitetura

graph TB
    subgraph "Presentation Layer"
        UI["EasyHosts.Site.UI.Mvc<br/>(ASP.NET MVC 5)"]
        Views["Views (Razor)"]
        Controllers["SiteController<br/>ErrorController"]
        ViewModels["ViewModels"]
        Security["SecurityHeadersAttribute<br/>CpfValidationAttribute"]
        DI["DependencyContainer<br/>(Custom Resolver)"]
    end

    subgraph "Application Layer"
        APP["EasyHosts.Site.Application"]
        Services["UserService<br/>BookingService<br/>CryptoService<br/>EmailService"]
        AppInterfaces["IUserService<br/>IBookingService<br/>ICryptoService<br/>IEmailService"]
        Exceptions["NotFoundException<br/>DbConcurrencyException<br/>IntegrityException"]
    end

    subgraph "Infrastructure Layer"
        INFRA["EasyHosts.Site.Infrastructure.Data"]
        CTX["Context (DbContext)"]
        REPO["Repository&lt;T&gt;"]
        UOW["UnitOfWork"]
    end

    subgraph "Domain Layer"
        DOMAIN["EasyHosts.Site.Domain"]
        Entities["User<br/>Bedroom<br/>Booking<br/>Perfil<br/>Event<br/>Product<br/>TypeBedroom"]
        Enums["BedroomStatus<br/>BookingStatus<br/>EventType<br/>TypeBedroomClass"]
        DomainInterfaces["IRepository&lt;T&gt;<br/>IUnitOfWork"]
    end

    subgraph "Infrastructure"
        DB["SQL Server 2019<br/>(Docker)"]
        MONO["Mono 6.12 + xsp4"]
        DOCKER["Docker Compose"]
    end

    UI --> Controllers
    UI --> Views
    UI --> ViewModels
    UI --> Security
    UI --> DI
    Controllers --> APP
    Controllers --> DI
    APP --> DOMAIN
    APP --> INFRA
    INFRA --> DOMAIN
    INFRA --> DB
    UI --> DOCKER
    DOCKER --> MONO
    DOCKER --> DB
Loading

Project Structure / Estrutura do Projeto

EasyHosts.Site/
├── EasyHosts.Site.Domain/            # Entities, enums, and domain interfaces / Entidades, enums e interfaces do domínio
├── EasyHosts.Site.Application/       # Application services and business rules / Serviços de aplicação e regras de negócio
├── EasyHosts.Site.Infrastructure.Data/ # EF6 DbContext, Repository, UnitOfWork
├── Easy.Hosts.Site/                  # Web interface (MVC 5) / Interface web
│   ├── Controllers/
│   ├── Models/ViewModel/
│   ├── Views/
│   ├── Infrastructure/               # DI, filters, custom validation / DI, filtros, validação customizada
│   └── App_Start/                    # Routes, bundles, global filters / Rotas, bundles, filtros globais
├── Dockerfile                        # Multi-stage build (Mono + xsp4)
└── docker-compose.yml                # App + SQL Server

Tech Stack / Stack Tecnológica

Layer / Camada Technology / Tecnologia
Framework .NET Framework 4.8 / ASP.NET MVC 5
ORM Entity Framework 6.1.3 (Code-First)
Database / Banco SQL Server 2019 (Express)
Container Docker / Docker Compose
Runtime Mono 6.12 + xsp4
Front-end Bootstrap 5.3, jQuery, Font Awesome
Auth / Autenticação FormsAuthentication

Running the Application / Como Executar

docker compose up -d --build

The application will be available at http://localhost:8080 / A aplicação estará disponível em http://localhost:8080.

Database Diagram / Diagrama do Banco de Dados

erDiagram
    TB_USER {
        int ID PK
        string NAME
        string EMAIL
        string PASSWORD
        string CONFIRM_PASSWORD
        int STATUS
        string CPF
        int PERFIL_ID FK
        string HASH
    }

    TB_PERFIL {
        int ID PK
        string DESCRIPTION
    }

    TB_BEDROOM {
        int ID PK
        string NAME_BEDROOM
        decimal VALUE
        string DESCRIPTION
        binary PICTURE
        int STATUS
        int TYPE_BEDROOM FK
    }

    TB_TYPE_BEDROOM {
        int ID PK
        string NAME_TYPE_BEDROOM
        int AMOUNT_OF_PEOPLE
        int AMOUNT_OF_BED
        int APARTMENT_AMENITIES
    }

    TB_BOOKING {
        int ID PK
        string CODE_BOOKING
        int USER_ID FK
        datetime DATE_CHECKIN
        datetime DATE_CHECKOUT
        decimal VALUE_BOOKING
        int BEDROOM_ID FK
        int STATUS
    }

    TB_EVENT {
        int ID PK
        string NAME_EVENT
        string ORGANIZER
        datetime DATE_EVENT
        string EVENTS_PLACE
        binary PICTURE
        string DESCRIPTION_EVENT
        string ATTRACTIONS
        int TYPE_EVENT
    }

    TB_PRODUCT {
        int ID PK
        string NAME_PRODUCT
        decimal VALUE
        int QUANTITY_PRODUCT
    }

    TB_USER ||--o{ TB_PERFIL : "possui / belongs to"
    TB_BEDROOM ||--o{ TB_TYPE_BEDROOM : "classificado como / classified as"
    TB_BOOKING ||--o{ TB_USER : "pertence a / belongs to"
    TB_BOOKING ||--o{ TB_BEDROOM : "reserva / reserves"
Loading

Registration and Activation Flow / Fluxo de Cadastro e Ativação

sequenceDiagram
    participant U as User / Usuário
    participant S as Site
    participant DB as Database / Banco
    participant E as Email

    U->>S: Fills registration form / Preenche formulário de registro
    S->>DB: Check if email already exists / Verifica se e-mail já existe
    alt Duplicate email / E-mail duplicado
        DB-->>S: Email already registered / E-mail já cadastrado
        S-->>U: Show warning / Exibe aviso
    else New email / E-mail novo
        S->>DB: Create user (Status=0) / Cria usuário
        S->>E: Send activation link / Envia link de ativação
        E-->>U: Link in email / Link no e-mail
        U->>S: Click activation link / Clica no link de ativação
        S->>DB: Validate hash / Valida hash
        S-->>U: Show activation form / Exibe formulário de ativação
        U->>S: Confirm password / Confirma senha
        S->>DB: Activate account (Status=1) / Ativa conta
        S-->>U: Account activated successfully / Conta ativada com sucesso
    end
Loading

Booking Flow / Fluxo de Reserva

sequenceDiagram
    participant U as User / Usuário
    participant S as Site
    participant DB as Database / Banco

    U->>S: Select room + dates / Seleciona quarto + datas
    S->>DB: Check availability / Verifica disponibilidade
    DB-->>S: Room available / Quarto disponível
    S->>DB: Create booking (Status=Voucher) / Cria reserva
    S->>DB: Update room (Status=Reserved) / Atualiza quarto
    S-->>U: Booking confirmation / Confirmação da reserva
Loading

About

EasyHosts.Site — Sistema web de gerenciamento hoteleiro (reservas, catálogo de quartos, eventos). Projeto Interdisciplinar do curso de ADS da FATEC Prof. João Mod, 2022. Legacy ASP.NET MVC 5 + EF6 + SQL Server rodando em Mono/Docker.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages