Coder Social home page Coder Social logo

sample's Introduction

Sample Code

Laravel 5.6 (MariaDB, PHP7.1 and Nginx)

How to run (using Docker)

Make sure you have already installed Docker and Docker Compose.

# Download Repository
git clone https://bitbucket.org/lkmadushan/medi.git
cd medi
cp .env.example .env

# Start Laravel application (Once done you can access application through http://localhost)
docker-compose up -d
docker-compose exec app sh -c "cd /var/www/html && composer install"
docker-compose exec app sh -c "cd /var/www/html && php artisan key:generate"

# Run migrations and seeds
docker-compose exec app sh -c "cd /var/www/html && php artisan migrate --seed"

# Run unit tests
docker-compose exec app sh -c "cd /var/www/html && ./vendor/bin/phpunit"

Includes

  • Paginated users, create, show a user, update a user using TDD
  • Relationships between models
  • ER diagram (in database directory)
  • Sample frontend design using TailwindCSS
  • Vue component to fetch and render List of Users
  • Migrations, Seeds and Model Factories
  • Docker based development environment

Notes

  • Since this is a small application I didn't use Fractal or API Resource to transform Eloquent models (but it's a good practise to use in complex applications)
  • Didn't use repository pattern since this is small application but we can consider it using more complex applications.
  • I would like to keep my code as simple as possible and I will refactor my code when things getting complex. Unit Tests help me a lot at this moment to validate implemented features are still working.

sample's People

Contributors

lkmadushan avatar

Watchers

James Cloos 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.