Skip to content

curychris/lks-serverless

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ticketing System

This is a ticket application for selling concert tickets to the public, organized by SoundWave Productions. The repository contains two folders: front-end and service. The front-end folder contains the source code for the web application, while the service folder contains the source code for the backend API, which is implemented using a serverless architecture.

TechStack

Ticketing System uses a number of technology stack to work properly:

  • node.js - Runtime for the lambda function
  • Vue - Progressive, incrementally-adoptable JavaScript framework
  • Vite - Fast and modern bundler for building frontend apps.
  • Vuetify - Material Design for Vue
  • dynamodb - Fast, flexible NoSQL database service for single-digit millisecond performance at any scale by AWS
  • PostgresQL - Powerful, open-source, relational database.
  • S3 - Scalable, durable, secure object storage

Font-End Setup

The root folder for Front-End projects is front-end.

Front-End Environment Variable

VITE_BASE_API_URL=YOUR_API_ENDPOINT
VITE_WEBSOCKET_URL=YOU_WEBSOCKET_ENDPOINT
VITE_API_TOKEN=YOUR_AUTH_TOKEN
VITE_DEVICE_ID=YOUR_AUTH_DEVICEID

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Type-Check, Compile and Minify for Production

npm run build

Backend - API Setup (Serverless)

The root folder for backend projects is service.

Lambda Setup

All dependencies required by each Lambda function are located in the service/layer folder and are bundled into a layer with name lks-layer, dont forget to attach the layer into lambda function.

Name Code Source Environment Description
lks-auth src/auth.js - This function is used as a middleware to handle custom authorization on API Gateway. It uses a maximum of 128MB of memory and has a maximum execution time of 3 seconds.
lks-token src/token.js - This function is used to generate Authorization token and deviceid. It uses a maximum of 128MB of memory and has a maximum execution time of 5 seconds.
lks-read-event src/lib, src/eventRead.js - This function is used to display event data from the database. It uses a maximum of 128MB of memory and has a maximum execution time of 5 seconds.
lks-write-event src/lib, src/eventWrite.js - This function is used to save, update and delete event data to the database.It uses a maximum of 256MB of memory and has a maximum execution time of 5 seconds.
lks-ticket src/lib, src/ticket.js - This function is used to save and delete ticket of the event data to the database. It uses a maximum of 128MB of memory and has a maximum execution time of 5 seconds.
lks-read-order src/lib, src/orderRead.js - This function is used to display order data from the database. It uses a maximum of 128MB of memory and has a maximum execution time of 5 seconds.
lks-write-order src/lib, src/orderWrite.js SQS_QUEUE_URL, WEBSOCKET_ID This function is used as a SQS consumer to proccess order from SQS and save data to the database. It uses a maximum of 256MB of memory and has a maximum execution time of 10 seconds.
lks-queue-order src/lib, src/OrderQueue.js SQS_QUEUE_URL, WEBSOCKET_ID This function is used to send request data to SQS. It uses a maximum of 128MB of memory and has a maximum execution time of 3 seconds.
lks-queue-payment src/lib, src/paymentQueue.js SQS_QUEUE_URL This function is used send S3 metadata to SQS. It uses a maximum of 128MB of memory and has a maximum execution time of 3 seconds.
lks-payment src/lib, src/payment.js SQS_QUEUE_URL This function is used as a SQS consumer to process payment. It uses a maximum of 256MB of memory and has a maximum execution time of 10 seconds.
lks-websocket src/websocket.js - This function is used handle websocket. It uses a maximum of 256MB of memory and has a maximum execution time of 5 seconds.

API Endpoint

You can check the API endpoint documentation in here

Websocket Setup

The websocket in this project is used to provide asynchronous responses to the front-end when messages on SQS have been successfully processed by the lambda consumer. The websocket has six routes: $connect, $disconnect, $default, sendMessage, getConnectionId, and broadcastMessage. The route selection expression for each route is $request.body.action. Each route invokes the lambda function that contains the websocket.js file. Don’t forget to use prod stage as a production stage name.

License

MIT

Free Software, Hell Yeah!

About

Repositori Untuk Modul 2 LKS Dikmen Kota Malang 2025

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 47.7%
  • JavaScript 28.6%
  • SCSS 23.0%
  • Other 0.7%