Git Product home page Git Product logo

automated-valet-car-parking-backend's Introduction

Automated Valet Car Parking Backend

Assumptions

  • Timestamp inside input.txt are always arranged in a chronologically manner (top-down)
  • There will only be two types of events input, i.e. Enter or Exit

Design

  • Observer Pattern
  • With this design pattern, can easily perform additional operations such as sending a notification upon Vehicle entry, sends a Slack message, send information to our monitoring system etc. Making the system more extensible.

Hosted Demo

  1. Go to https://replit.com/@JerryNg1/automated-valet-car-parking-backend.
  2. Hit the "Play/Run" button & wait a couple of seconds for dependency installation.
  3. Observe the output.
  4. Update input.txt accordingly. i.e. vim input.txt
  5. Hit the "Play/Run" button again.
  6. Repeat.

Local

Requirement

This project uses Python 3.9. You may install Python 3.9 on Ubuntu 16.04 using the steps below:

# 1. Update the apt package list
apt-get update

# 2. Refresh local apt keys from Ubuntu key server
apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com

# 3. Install software-properties-common to be able to add 3rd party repositories to apt
apt-get -y install software-properties-common

# 4. Add deadsnakes repository to apt, then run update
add-apt-repository ppa:deadsnakes/ppa
apt get update

# 5. Now that apt is ready, install python3.9
apt-get -y install python3.9

Installation (Optional)

This step is required only for local development to ensure code quality.

We use poetry to manage our dependencies.

Though, there isn't any third party dependencies required for the project to work properly. We merely use pre-commit, flake8, and autopep8 to improve code quality.

poetry install
pre-commit install

Usage

  1. Make sure you have Python3.9 installed on your local machine (see Requirement].

  2. Clone this repository.

  3. Optional: Update input.txt accordingly.

  4. Run the python3 main.py

  5. Output will be printed in your terminal.

    # Example output in your terminal using the default `input.txt`.
    
    > python3 main.py
    Accept MotorcycleLot1
    Accept CarLot1
    MotorcycleLot1 2
    Accept CarLot2
    Accept CarLot3
    Reject
    CarLot3 6

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Setup Pre-commit Hooks

Before you begin your development work, make sure you have installed pre-commit hooks.

Some example useful invocations:

  • pre-commit install: Default invocation. Installs the pre-commit script alongside any existing git hooks.
  • pre-commit install --install-hooks --overwrite: Idempotently replaces existing git hook scripts with pre-commit, and also installs hook environments

Steps

  1. Fork this
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

automated-valet-car-parking-backend's People

Contributors

ngshiheng avatar

Stargazers

 avatar  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.