GithubHelp home page GithubHelp logo

f1amy / laravel-realworld-example-app Goto Github PK

View Code? Open in Web Editor NEW
87.0 4.0 113.0 579 KB

Exemplary RealWorld backend API built with Laravel PHP framework.

Home Page: https://realworld.io

License: MIT License

PHP 92.23% Blade 7.53% JavaScript 0.24%
jwt laravel crud backend rest-api demo-app realworld ci

laravel-realworld-example-app's Introduction

Laravel RealWorld Example App

RealWorld: Backend Tests: status Coverage: percent Static Analysis: status License: MIT

Example of a PHP-based Laravel application containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld API spec.

This codebase was created to demonstrate a backend application built with Laravel framework including RESTful services, CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the Laravel framework community style guides & best practices.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

How it works

The API is built with Laravel, making the most of the framework's features out-of-the-box.

The application is using a custom JWT auth implementation: app/Jwt.

Getting started

The preferred way of setting up the project is using Laravel Sail, for that you'll need Docker under Linux / macOS (or Windows WSL2).

Installation

Clone the repository and change directory:

git clone https://github.com/f1amy/laravel-realworld-example-app.git
cd laravel-realworld-example-app

Install dependencies (if you have composer locally):

composer create-project

Alternatively you can do the same with Docker:

docker run --rm -it \
    --volume $PWD:/app \
    --user $(id -u):$(id -g) \
    composer create-project

Start the containers with PHP application and PostgreSQL database:

./vendor/bin/sail up -d

(Optional) Configure a Bash alias for sail command:

alias sail='[ -f sail ] && bash sail || bash vendor/bin/sail'

Migrate the database with seeding:

sail artisan migrate --seed

Usage

The API is available at http://localhost:3000/api (You can change the APP_PORT in .env file).

Run tests

sail artisan test

Run PHPStan static analysis

sail php ./vendor/bin/phpstan

OpenAPI specification (not ready yet)

Swagger UI will be live at http://localhost:3000/api/documentation.

For now, please visit the specification here.

Contributions

Feedback, suggestions, and improvements are welcome, feel free to contribute.

License

The MIT License (MIT). Please see LICENSE for more information.

laravel-realworld-example-app's People

Contributors

dependabot[bot] avatar f1amy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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