Todolist Backend Laravel

Back-end application for Todolist Web application built with Laravel 5.8 and Vue.js
Alternatives To Todolist Backend Laravel
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Todolist Frontend Vuejs115
3 years ago1mitJavaScript
Front-end application for Todolist Web application built with Laravel and Vue.js
Todolist Backend Laravel67
3 years ago6mitPHP
Back-end application for Todolist Web application built with Laravel 5.8 and Vue.js
Simple Tasklist32
5 years ago2mitPHP
Simple Task List app made with Laravel, Vue and Tailwindcss
Todolist Frontend Nuxt21
3 years ago2mitVue
Front-end application for Todolist Web application built with Laravel and Nuxt.js
Todolist Angular5
2 years ago14TypeScript
Front-end application for Todolist Web & Mobile application built with Laravel and Angular
Laravel Todo List Api4
a year agoPHP
A simple API to manage todo lists built with Laravel.
Livewire Todo4
a year agomitPHP
A simple TODO list app built with Laravel Livewire.
Todolist Ajax Laravel3
8 years agoPHP
A To Do List Using Laravel & Ajax .
Laravel Vuejs Todolist3
a year ago19PHP
A Simple Todolist application using Laravel and Vue.js
Kingtodo3
6 years agoPHP
A todolist application with laravel and vuejs
Alternatives To Todolist Backend Laravel
Select To Compare


Alternative Project Comparisons
Readme

Todolist-backend Application

pipeline status Donate

Backend for guillaumebriday/todolist-frontend-vuejs app, built for a serie of articles on my blog.

The purpose of this repository is to provide API with Laravel 5.8 and connecting JavaScript front-end frameworks like Vue.js 2 or other clients to them.

Beside Laravel, this project uses other tools like :

Installation

Development environment requirements :

Setting up your development environment on your local machine :

$ git clone https://github.com/guillaumebriday/todolist-backend-laravel.git
$ cd todolist-backend-laravel
$ cp .env.example .env
$ docker-compose run --rm --no-deps todolist-server composer install
$ docker-compose run --rm --no-deps todolist-server php artisan key:generate
$ docker-compose run --rm --no-deps todolist-server php artisan jwt:secret
$ docker-compose up -d

Before starting

You need to run the migrations :

$ docker-compose run --rm todolist-server php artisan migrate

Seed the database :

$ docker-compose run --rm todolist-server php artisan db:seed

This will create a new user that you can use to sign in :

Email : [email protected]
Password : 4nak1n

Useful commands

Running tests :

$ docker-compose run --rm todolist-server ./vendor/bin/phpunit --cache-result --order-by=defects --stop-on-defect

Running php-cs-fixer :

$ docker-compose run --rm --no-deps todolist-server ./vendor/bin/php-cs-fixer fix --config=.php_cs --verbose --dry-run --diff

Generating backup :

$ docker-compose run --rm todolist-server php artisan backup:run --only-db

Discover package

$ docker-compose run --rm --no-deps todolist-server php artisan package:discover

Generating fake data :

$ docker-compose run --rm todolist-server php artisan db:seed --class=DevDatabaseSeeder

Accessing the API

Clients can access to the REST API. API requests require authentication via JWT. You can create a new one with you credentials.

$ curl -X POST http://localhost:8000/api/v1/auth/login -d "email=your_email&password=your_password"

Then, you can use this token either as url parameter or in Authorization header :

# Url parameter
curl -X POST http://localhost:8000/api/v1/auth/me?token=your_jwt_token_here

# Authorization Header
curl -X POST --header "Authorization: Bearer your_jwt_token_here" http://localhost:8000/api/v1/auth/me

API are prefixed by api and the API version number like so v1.

Do not forget to set the X-Requested-With header to XMLHttpRequest. Otherwise, Laravel won't recognize the call as an AJAX request.

To list all the available routes for API :

$ docker-compose run --rm --no-deps todolist-server php artisan route:list

You can import my Insomnia workspace configured to work with the API : .insomnia/todolist-backend-laravel.json.

Broadcasting & WebSockets

Before using WebSockets, you need to set the PUSHER related keys in your .env file.

You could find this keys on https://pusher.com/.

You also need to set the BROADCAST_DRIVER key :

BROADCAST_DRIVER=pusher

Deploy in production

You can serve your application with nginx in production.

You can deploy this application with Ansible.

Copy the hosts example file and change the values to your needs :

$ cp hosts.example hosts

Setup your variables in the playbook.yml.

And then run :

$ ansible-playbook -i hosts playbook.yml

Build the images :

$ docker build -f .cloud/docker/Dockerfile.prod --target application -t todolist-backend-laravel-application .

$ docker build -f .cloud/docker/Dockerfile.prod --target nginx -t todolist-backend-laravel-nginx .

Run the containers :

$ docker run --rm -it --name todolist-server --link some-mysql:mysql --env-file .env --network todolist-backend todolist-backend-laravel-application

$ docker run --rm -it -p 8000:8000 --network todolist-backend todolist-backend-laravel-nginx

Consume the API

The application is available on https://todolist-api.guillaumebriday.me/api/v1/.

The documentation is available in the docs folder or on https://todolist-docs.guillaumebriday.me.

You can consume the API with any client.

Some examples of projects who use this API:

Don't forget to let me know if you want to add your project to this list !

More details

More details are available on my blog post : https://guillaumebriday.fr/laravel-vuejs-faire-une-todo-list-partie-1-presentation-et-objectifs (French).

Contributing

Do not hesitate to contribute to the project by adapting or adding features ! Bug reports or pull requests are welcome.

License

This project is released under the MIT license.

Popular Laravel Projects
Popular Todolist Projects
Popular Frameworks Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Php
Docker
Vue
Laravel
Rest
Nginx
Websocket
Jwt
Docker Compose
Single Page Applications
Todolist
Capistrano
Pusher