Giter VIP home page Giter VIP logo

parkinglot's Introduction

Parking Lot

Parking Lot is sample boilerplate usecase for workshop tokopedia academy.

Configuration & Dependency

How to run the project

Initial config docker env configuration

# Copy the config env
parkinglot$ cp .env.sample .env

# Change password default mysql root on .env
MYSQL_ROOT_PASSWORD=sample

# Run docker for installation
docker-compose up

Initial config docker env configuration

# Copy the config env
parkinglot/files/etc/parkinglot$ cp parkinglot.development.yaml.sample parkinglot.development.yaml

# Change the config parkinglot.development.yaml
version: "0.0.1"

server: 
  name: "parkinglot"
  http: 
    address: ":8080"
    write_timeout: 1
    read_timeout: 2
    max_header_bytes: 500000
    enable: true


database:
  testing: true
  dsn: "root:sample@tcp(127.0.0.1:3306)/test_parking_lot?charset=utf8mb4&parseTime=True&loc=Local"
  max_conns: 15
  max_idle_conns: 5
  max_retry: 5

new_relic:
  app_name: "Parking Lot"
  secret: "this_secret_generated" #generated from one.newrelic.com
  
# Change the config newrelic-infra.yml
license_key: this_secret_generated #generated from one.newrelic.com

Running golang apps

parkinglot$ make app

The endpoint list

Get Parking List

{
    "data": [
        {
            "plat_no": "DA123DEF",
            "slot_number": 1,
            "registration_date": "2022-03-12T01:49:41+08:00"
        }
    ]
}

Get Nearest Empty Parking Spot

{
    "data": 1
}

Get Parking location by Plat Number

{
    "data": 11
}

Get Parking History by Date

{
  "data": [
    {
      "history_id": 1321,
      "plat_no": "O135509SOU",
      "slot_number": 983,
      "registration_date": "2020-01-01T22:56:27Z"
    },
    {
      "history_id": 1706,
      "plat_no": "N922759HQR",
      "slot_number": 941,
      "registration_date": "2020-01-01T18:54:55Z"
    }ß
  ]
}

Get Report Number of Vehicles ßPer Day

{
  "data": {
    "total_days": 367,
    "reports": [
      {
        "date": "2020-01-01",
        "total_vehicle": 113
      },
      {
        "date": "2020-01-02",
        "total_vehicle": 303
      }
  }
}

Get Country Information (Upstream)

{
  "data": [
    {
      "name": {
        "common": "Indonesia",
        "official": "Republic of Indonesia",
        "nativeName": {
          "ind": {
            "official": "Republik Indonesia",
            "common": "Indonesia"
          }
        }
      },
      "tld": [
        ".id"
      ],
      "cca2": "ID",
      "ccn3": "360",
      "cca3": "IDN",
      "cioc": "INA",
      "independent": true,
      "status": "officially-assigned",
      "unMember": true,
    }
  ]
}

parkinglot's People

Contributors

firdasafridi avatar fazzrin avatar idoej135 avatar yusufardho avatar ahmadfaisholhuda-tkp avatar dicky-kesuma 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.