FredZockt / laravel-ng-jwt-ws

basic Laravel / Angular project setup

Home Page:HomePage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What does this repository do?

This is a basic laravel package combined with a basic jwt-auth integration (taken from: https://www.positronx.io/laravel-jwt-authentication-tutorial-user-login-signup-api) and a simple websocket setup (taken from: https://beyondco.de/docs/laravel-websockets/getting-started/introduction)

How to make it run?

After you checked out the repo, you need to do the following steps:

  • 1. Run composer install in your root directory:
    composer install
  • 2. Create an .env file from the .env.example and adjust the database credentials to your needs
  • 3. Run the following code in the root directory to create an app key:
    php artisan key:generate
  • 4. Run the migrations:
    php artisan migrate
  • 5. Run the following code in the root directory to create an jwt secret:
    php artisan jwt:secret

How to start the applications?

  • The backend application has to be started from the root:
    php artisan serve
  • The Angular Application has to be started from the /resources/frontend/Angular directory:
    ng serve
  • The websocket application has to be started from the repository root:
    php artisan websockets:serve

How can I test the applications?

  • The backend application can be opened at http://127.0.0.1:8000
  • The angular application can be opened at http://127.0.0.1:4200
  • The websocket application can be opened at http://127.0.0.1:6001 (but it is empty for some reason :()
  • To test the websocket do the following:
    • - open http://127.0.0.1:8000
    • - have a look into the console tab in your browser
    • - open a terminal at root level of the repository and open tinker:
      php artisan tinker
    • - inside tinker type the following and press enter:
      event(new App\Events\NewMessage("hello world"))
    • - If everything works properly you should see "hello world" inside your console tab

Build Status Total Downloads Latest Stable Version License

About Laravel

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:

Laravel is accessible, powerful, and provides tools required for large, robust applications.

Learning Laravel

Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.

If you don't feel like reading, Laracasts can help. Laracasts contains over 1500 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.

Laravel Sponsors

We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the Laravel Patreon page.

Premium Partners

Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the Laravel documentation.

Code of Conduct

In order to ensure that the Laravel community is welcoming to all, please review and abide by the Code of Conduct.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via taylor@laravel.com. All security vulnerabilities will be promptly addressed.

License

The Laravel framework is open-sourced software licensed under the MIT license.

About

basic Laravel / Angular project setup

HomePage


Languages

Language:PHP 72.0%Language:Blade 12.9%Language:TypeScript 12.0%Language:HTML 2.4%Language:Shell 0.6%