Code Monkey home page Code Monkey logo

longfung-linehack-2023's Introduction

longfung-linehack-2023

NOTE: WARNING THIS PROJECT USES LINT

and already set GitHub action

setting

  • Line Messaging API
  • Line Beacon
  • Line Auth
  • DialogFlow (account: [email protected] (create a new email to get 300$))
  • setting GCP billing
  • setting Firebase
  • create repo
  • set NextJS
  • firebase init
  • set up Github action
  • set up liff
  • set up DialogFlow with firebase cloud function

set up .env (example)

  firebase functions:config:set line.channel_access_token="xxxxx" line.channel_secret="xxxxx" dialogflow.agent_id="xxxxx"

  # and check by

  firebase functions:config:get > functions/.runtimeconfig.json

How to run the full stack on local

  firebase emulators:start

including:

  • Authentication
  • Functions
  • Firestore
  • Hosting
  • Pub/Sub
  • Storage

How to run BE

  firebase functions:config:set line.channel_access_token="xxxxx" line.channel_secret="xxxxx" dialogflow.agent_id="xxxxx"

  # and check by

  firebase functions:config:get > functions/.runtimeconfig.json

  cd functions

  npm run serve

env for FE

  • download file .env from --> link
  • place it in the folder frontend
  • run it npm i && npm run dev

CI/CD

Open PR

Step:

  1. checkout code 2. add label UI, deploy hosting to preview 3. add label BE, if you want to deploy functions and others
  2. add UI: at the beginning of the title of the PR, deploy hosting to preview~~
  3. add BE: at the beginning of the title of the PR, if you want to deploy functions and others

Merge to main

Step:

  1. checkout code
  2. deploy hosting to live

Database Design

Entity Relationship Diagram

erd

Documentation Database

// key = name (Ly !== ly !== ลี่) no sensitive
type Band = Record<srting, {
  name: string
  image_url: string
  promoted_song_1?: string
  promoted_song_2?: string
  song_requested?: boolean
  description?: string
  social_media: {
    facebook_url?: string
    instargram_url?: string
    tiktok_url?: string
    website?: string
  }
  streaming: {
    apple_music_url?: string
    spotify_url?: string
    youtube_music_url?: string
  }
  ringtone: {
    line_melody_url?: string
  }
  payment: {
    qrcode_url?: string
    active?: boolean
  }
  line_beacon: Array<{
    hardware_id: string
    passcode: string
  }>
  updated_by: string // Line UserId
}>

// key = name
type Event = Record<srting, {
  name: string
  date: string // DD-MM-YYYY
  start_time: string // hh:mm
  end_time: string // hh:mm
  available_seats: number
  age_limitation: number
  alcohol_free?: boolean
  song_requested?: boolean
  description?: string
  poster_url?: string
  ticket_type: {
    free: boolean
    price?: number
  }
  social_media: {
    facebook_url?: string
    instargram_url?: string
    tiktok_url?: string
    website?: string
  }
  location: {
    address: string
    gmap_url?: string
  }
  line_beacon: Array<{
    hardware_id: string
    passcode: string
  }>
  line_up: Array<{
    start_time: string // hh:mm
    end_time: string // hh:mm
    band_name: string
  }>
  interested_person: Array<string> // line userid of audiance
  updated_by: string // Line UserID
}>

// key of LineBeacon is hardware_id
type LineBeacon = Record<srting, {
  event?: string // key of Event
  band?: string // key of Band
}>

// auto genarate key
type SongRequest = Record<string,  {
  song_name: string
  note?: string
  requested_by?: string // Line userid
  band_name?: string
  requested_at?: timestamp
}>

// auto genarate key
type Flex = Record<string, {
  user_id: string // Line userid
  band_name: string // Band name
  timestamp: timestamp
}>

longfung-linehack-2023's People

Contributors

kanatsanan6 avatar narawit-s avatar patorsiang avatar supermalonz avatar wasital avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.