GithubHelp home page GithubHelp logo

demo_api's Introduction

demo_api

Credits

  1. Docker Image for local testing: https://hub.docker.com/r/mattrayner/lamp#introduction
  2. Laravel Starter Project via Heroku: https://devcenter.heroku.com/articles/getting-started-with-laravel
  3. MySQL provider on Heroku (KiteFin free plan) : https://elements.heroku.com/addons/jawsdb

Public URLs

https://string-checker-demo-api.herokuapp.com/

APIs

  1. GET message/list

  2. POST message/add

'text': nullable | max:255 | string

  1. DELETE message/delete

'text': nullable | max:255 | string

  1. POST message/edit

'text': nullable | max:255 | string 'newText': nullable | max:255 | string

  1. POST message/check

'text': nullable | max:255 | string

Unit Tests

php artisan test

TO DOs

  1. Deploy the project to heroku done
  2. Connect to MySQL database locally and remotely done
  3. Implement APIs done
  4. Design FE page
  5. User authentication

Dev Notes

  1. Setup the git repo for lavarel example project on Heroku: https://devcenter.heroku.com/articles/getting-started-with-laravel

  2. Setup the free tier MySQL DB with JawsDB: https://elements.heroku.com/addons/jawsdb

heroku addons:create jawsdb:kitefin -a string-checker-demo-api --version=8.0

  1. Run the Lavarel DB migration to test live DB connection and create the tables required

heroku run php artisan migrate

Local environment

https://hub.docker.com/r/mattrayner/lamp#introduction

docker run -i -t -p "80:80" -p 3306:3306 -v ${PWD}/demo_api:/app -v ${PWD}/demo_api/mysql:/var/lib/mysql mattrayner/lamp:latest

PostMan export

Exported Json file of PostMan requests collections

LightSpeedDemoApi.postman_collection.json

Post updates

  1. Avoid using verb in api endpoint - let http method explain
  2. Patch VS put - partial content update VS replacing whole object
  3. Using unique Id instead of text
  4. Remove check endpoint and add panlindrome check in add and update
  5. Make text unique column
  6. Refactor string check into its own service class

demo_api's People

Contributors

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