justinbedia / lineStepBackend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub README banner_ JWT Laravel JWT REST API

License: MIT

This repository contains a Laravel 10 with JWT authentication boilerplate using the tymon/jwt-auth package, inspired by the Laravel Breeze package (API stack).

Next.js frontend

We created a dedicated frontend using Next.js, Tailwind CSS and NextAuth. You can find the repository here.

Features

  • JWT authentication (login, register, password reset, email verification)
  • Profile updating
  • Password changing
  • Tests (using Pest)
  • Laravel Telescope (disabled by default)

Installation

Note: the application does not have a package.json since this project purely a REST API that will not use any JavaScript or asset builders such as Vite.

  1. cp .env .env.example
  2. composer install
  3. php artisan jwt:secret (generate a secret key that will be used to sign your tokens)
  4. php artisan migrate:fresh --seed

Authentication

In order to authenticate, you have to log in using valid credentials. User data and an access token will be returned. You can use this access token to do subsequent requests to the API.

The access token has a TTL of 1 hour until it expires. The access token should be refreshed within this time window to avoid becoming unauthenticated.

The access token can be refreshed for two weeks. After that, the user has to log in again.

Telescope

This boilerplate comes with Laravel Telescope installed. You can access the Telescope dashboard at the /telescope URL (prefixed with your local URL).

Testing

This boilerplate comes with Pest as its testing framework. In order to run the tests, run ./vendor/bin/pest.

Contributing

Feel free to open a pull request if you want to contribute to this project. All contributions / suggestions are welcome ✨

License

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

About


Languages

Language:PHP 79.5%Language:Blade 20.5%