Giter Club home page Giter Club logo

message-board's Introduction

Message Board

PHP application using Laravel Framework that works like a simple message board. This app exposes a REST interface that allows an anonymous user to submit messages and to retrieve a list of the submitted messages.

Time Box - 1 hour

Installation

Clone Repository

git clone https://github.com/AdrianHL/message-board.git

Access Project path

cd message-board

Copy .env file

cp .env.example .env

Install Dependencies

composer install

Generate App Key

php artisan key:generate --ansi

Create a sqlite (empty) file for storing the database (other driver requires additional set up); by default it has to be create in the following relative path database\database.sqlite.

Then run migrations

php artisan migrate

Then serve the project

php artisan serve

Which output a URL as follows

Starting Laravel development server: http://127.0.0.1:8000
[Fri Oct 23 21:00:07 2020] PHP 7.4.11 Development Server (http://127.0.0.1:8000) started

Optional - Seed Database

Run the following command to seed the messages board with 50 new messages per run

php artisan db:seed

API

  • Get Messages: GET request tp /api/messages.
  • Create Message: POST request to /api/message including message data in the payload, for example:
{'message': 'this is an example'}

Tests

Run the following command in order to run the tests

php artisan test

Trade Offs

Taking into account the time box here are some trade offs

  • The messages board response is not paginated but it could with some more time; see Resource Collection.
  • There is no extra features in the project such as reply to, delete, vote or anything that could be expected in a messages board.
  • There is no CI/CD setup.
  • Security has not been evaluated.

License

This project is open-sourced software licensed under the MIT license.

message-board's People

Watchers

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