Skip to content

smart-cine/smartcine-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Cine

Description

The Booking Cinema Ticket System allows cinema providers to register branches and manage ticket bookings, schedules, movies, and customers. Each branch can handle ticket sales, view statistics, and manage screenings.

Table of Contents

Project Structure

  |-exception
  |  |-ErrorMessage.java
  |  |-GlobalExceptionHandler.java
  |-model
  |  |-Ranking.java
  |  |-CinemaRoom.java
  |  |-Cinema.java
  |  |-BusinessBank.java
  |  |-Film.java
  |  |-CinemaLayoutSeat.java
  |  |-Perform.java
  |  |-PickSeat.java
  |  |-UserAccount.java
  |  |-Payment.java
  |  |-Account.java
  |  |-Comment.java
  |  |-BusinessAccount.java
  |  |-CinemaLayoutGroup.java
  |  |-BankCinema.java
  |  |-OwnerShip.java
  |  |-OwnerShipTree.java
  |  |-CinemaLayout.java
  |  |-VnPayModel.java
  |  |-BusinessProvider.java
  |  |-CinemaProvider.java
  |  |-BusinessOwnership.java
  |  |-Item.java
  |  |-Tag.java
  |-CinemaManagementApplication.java
  |-pagination
  |  |-PagingModel.java
  |  |-CursorBasedPageable.java
  |  |-PageSpecificationTag.java
  |  |-PageSpecificationPerform.java
  |  |-PageSpecificationCinemaLayout.java
  |  |-PageSpecification.java
  |-mapper
  |  |-JpaConverterJson.java
  |  |-PerformMapper.java
  |  |-CinemaProviderMapper.java
  |  |-MapperConfig.java
  |  |-AccountMapper.java
  |  |-FilmMapper.java
  |  |-TagMapper.java
  |  |-CinemaLayoutMapper.java
  |  |-PickSeatMapper.java
  |  |-CinemaMapper.java
  |  |-CinemaRoomMapper.java
  |  |-JsonToMapConverter.java
  |-service
  |  |-CommentService.java
  |  |-PickSeatService.java
  |  |-JwtService.java
  |  |-PaymentService.java
  |  |-PerformService.java
  |  |-CinemaRoomService.java
  |  |-TagService.java
  |  |-CinemaLayoutService.java
  |  |-CinemaProviderService.java
  |  |-BusinessBankService.java
  |  |-impl
  |  |  |-SocketIOServiceImpl.java
  |  |  |-CommentServiceImpl.java
  |  |  |-UserService.java
  |  |  |-PickSeatServiceImpl.java
  |  |  |-GetPaymentStatusService.java
  |  |  |-VNPayServiceImpl.java
  |  |  |-FilmServiceImpl.java
  |  |  |-BusinessBankServiceImpl.java
  |  |  |-CinemaProviderServiceImpl.java
  |  |  |-TagServiceImpl.java
  |  |  |-OrderPaymentService.java
  |  |  |-CinemaRoomServiceImpl.java
  |  |  |-CinemaServiceImpl.java
  |  |  |-RedisServiceImpl.java
  |  |  |-CinemaLayoutServiceImpl.java
  |  |  |-JwtServiceImpl.java
  |  |  |-PerformServiceImpl.java
  |  |-SocketIOService.java
  |  |-CachingService.java
  |  |-FilmService.java
  |  |-CinemaService.java
  |  |-FilmPriceService.java
  |-auth
  |  |-RegisterRequest.java
  |  |-AuthenticationResponse.java
  |  |-AuthenticationRequest.java
  |  |-AuthenticationController.java
  |  |-AuthorizationService.java
  |  |-AuthenticationService.java
  |-repository
  |  |-CinemaRepository.java
  |  |-PickSeatRepository.java
  |  |-BusinessOwnershipRepository.java
  |  |-CinemaLayoutRepository.java
  |  |-CinemaRoomRepository.java
  |  |-CinemaProviderRepository.java
  |  |-CinemaLayoutSeatRepository.java
  |  |-CommentRepository.java
  |  |-OwnerShipTreeRepository.java
  |  |-AccountRepository.java
  |  |-BusinessAccountRepository.java
  |  |-CinemaLayoutGroupRepository.java
  |  |-PaymentRepository.java
  |  |-PerformRepository.java
  |  |-FilmRepository.java
  |  |-BusinessBankRepository.java
  |  |-BusinessRepository.java
  |  |-TagRepository.java
  |-dto
  |  |-UserDTO.java
  |  |-payment
  |  |  |-BusinessBankDTO.java
  |  |  |-BusinessBankDTOItem.java
  |  |-RankingDTO.java
  |  |-film
  |  |  |-FilmDTO.java
  |  |-TranslateTypeDTO.java
  |  |-FilmPriceDTO.java
  |  |-CommentDTO.java
  |  |-PickSeatDTO.java
  |  |-cinema
  |  |  |-CinemaRoomDTO.java
  |  |  |-CinemaManagerDTO.java
  |  |  |-CinemaDTO.java
  |  |  |-CinemaProviderDTO.java
  |  |  |-item
  |  |  |  |-CinemaRoomDTOItem.java
  |  |  |  |-CinemaLayoutDTOItem.java
  |  |  |  |-CinemaLayoutSeatDTOItem.java
  |  |  |  |-CinemaLayoutGroupDTOItem.java
  |  |  |-CinemaLayoutDTO.java
  |  |-BusinessOwnerShipDTO.java
  |  |-SeatPriceDTO.java
  |  |-perform
  |  |  |-PerformDTOItem.java
  |  |  |-PerformDTO.java
  |  |-TagDTO.java
  |  |-PaymentDTO.java
  |-controller
  |  |-ManagerCinemaController.java
  |  |-OrderPaymentController.java
  |  |-PaymentController.java
  |  |-FilmController.java
  |  |-PickSeatController.java
  |  |-PerformController.java
  |  |-GetPaymentStatusController.java
  |  |-CallbackPaymentController.java
  |  |-cinema
  |  |  |-CinemaProviderController.java
  |  |  |-CinemaRoomController.java
  |  |  |-CinemaController.java
  |  |  |-CinemaLayoutController.java
  |  |-CommentController.java
  |  |-TagController.java
  |  |-BusinessBankController.java
  |-configuration
  |  |-RedisConfiguration.java
  |  |-SecurityConfiguration.java
  |  |-KeyExpiredListener.java
  |  |-JwtAuthenticationFilter.java
  |  |-Subcriber.java
  |  |-ApplicationConfig.java
  |-utils
  |  |-ConvertJsonNameToTypeName.java
  |  |-VnPayHelper.java
  |-common
  |  |-TranslateType.java
  |  |-ErrorKey.java
  |  |-ViewType.java
  |  |-RoomType.java
  |  |-Role.java
  |  |-Status.java
  |  |-LayoutType.java
  |  |-CommentType.java
  |  |-RoleCinema.java
  |  |-RoleProvider.java
  |  |-BusinessRole.java
  |  |-BankType.java
  |  |-VnPayConstant.java
  |  |-SeatStatus.java
  |-payload
  |  |-request
  |  |  |-AddCommentRequest.java
  |  |  |-AddCinemaRequest.java
  |  |  |-OrderRequestDTO.java
  |  |  |-AddOrUpdateCinemaRoom.java
  |  |  |-AddFilmPriceRequest.java
  |  |  |-AddSeatPaymentRequest.java
  |  |  |-CloneLayoutCinemaRequest.java
  |  |  |-AddPerformRequest.java
  |  |  |-AddBusinessBankRequest.java
  |  |  |-PickSeatRequest.java
  |  |  |-DeletePickSeatRequest.java
  |  |  |-AddFilmRequest.java
  |  |  |-AddOrDeleteTagRequest.java
  |  |  |-AddAndDeleteManagerRequest.java
  |  |  |-AddCinemaLayoutRequest.java
  |  |  |-AddOrDeletePickSeatRequest.java
  |  |  |-StatusRequestDTO.java
  |  |  |-AddPaymentRequest.java
  |  |-response
  |  |  |-DataResponse.java
  |  |  |-PagingResponse.java
  |  |  |-SocketResponse.java
  |  |  |-PickSeatResponse.java
  |  |  |-PageResponse.java
  |  |  |-CommentResponse.java
  |-output.txt

Core Features

Authentication

  • Secure user registration and login for providers, branch managers, and customers using JWT (JSON Web Tokens).
  • Each time a request is made, database will check existing the credentials of its token.
  • Redis is used to enhance authentication performance by caching credentials with a time-to-live (TTL). This reduces database load and speeds up the authentication process, ensuring quick access to user sessions.

Authorization - RBAC + hierarchy of ownership

image

  • RBAC (Role-Based Access Control) is used to determine permissions for Business Accounts and Customer Accounts.

  • Business Account just have permissions on own their Cinema provider or cinema branches:

    • Business Accounts: Can access resources associated with their own cinema provider or cinema branches.
    • Customer Accounts: Have access to booking and ticket management features.
  • Ownership Validation Using DFS concept:

    • The system checks whether the provider account or branch account is directly linked to the cinema branch.
    • If not directly linked, the DFS algorithm traverses up the ownership hierarchy to check if the provider account is associated with the parent provider of the cinema.
    • If a link is found, the request continues to role validation. If no link is found, access is denied.
    • Code: image
    • Table Database: To optimize searching, used NoSQL concept, create just only one table for link child entity to parent entity via ID image
  • Role Permission Check:

    • Once ownership is verified, the system checks the role associated with the account to determine if it has the necessary permissions for the requested API.
    • If the role has permission, access is granted. Otherwise, access is denied.
    • Code: image
    • Table Database: image

Booking Handle

  • Implementing booking for screenings and managing seat status (e.g., pending, booked) with Nodejs (is pending).
  • Caching pending seat selections in Redis to optimize database writes.
  • Ensuring seats marked as pending can be resolved in case the server is terminated by CronJob (is pending).

Payment

  • The application features a scalable design that allows providers to easily add multiple types of wallets (VNPAY, MOMO, ZALOPAY) to enhance payment flexibility. Currently supported wallet types include: VNPay image

Database Design

LINK: https://dbdiagram.io/d/Trat-DJien-ITMC-Solution-65bf2fc6ac844320ae6458be image

Installation

  • Prerequisite: Docker with latest version
  • Clone this repository, move to its directory on your device and run
docker compose up

Structure of Application

image

Progress

In progress

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages