Code Monkey home page Code Monkey logo

inmana-php's Introduction

Inmana PHP

๐Ÿš€ Developing Rocketseat 's Next Level Week (NLW#05) Application using Swoole + Hyperf.

This is the app of the Elixir track.

I know PHP/Swoole I know NLW#5
The Next Level Week is a sprint promoted by the education company Rocketseat to help in the learning of new technologies. Unfortunately they don't officially support a PHP track, but we love PHP specially when it comes with Swoole. This is the following of the Elixir track, but using Swoole (instead of regular PHP-FPM), a high-performance server for PHP applications inspired on Erlang, and Hyper, a MVC framework analog to Phoenix, that supports Coroutines as first-class.

Comparison table

Language Runtime Framework ORM
From Elixir Processes (Tasks/GenServer) Phoenix Ecto
To PHP Swoole Coroutines/Fibers Hyperf Hyperf-Eloquent

For the REPL (iex) you can use gokure/hyperf-tinker.

The mail component for Elixir was based on the third-party Bamboo project, same here, it uses hyperf-ext/mail (both running locally with logs, but with a wide range of transports/adapters available).

Check /runtime/logs/hyperf.log for sent emails.

Trying out

Up development environment

docker compose run --rm --service-ports app

This will start an interactive shell inside a container-based development environment.
The following commands should be executed inside this shell session.

If you don't want to use Docker you can skip this step, just make sure you have a running MySQL server, PHP 7.4 and Swoole 4.6.

Install dependencies

composer install

Configure

Make sure to change .env for proper values (like setting DB_HOST to db if in Docker) and adding passwords.

Run migrations

php bin/hyperf.php migrate

Start the server (and watch for changes)

php bin/hyperf.php server:watch

Trigger expiring emails

php bin/hyperf.php mail:expiring

After that, see runtime/logs/hyperf.log

inmana-php's People

Contributors

leocavalcante avatar

Stargazers

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

Watchers

 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.