Giter Club home page Giter Club logo

lanuel's Introduction

Lanuel

A Laravel - Nuxt 3 - Element Plus starter kit.

Installation

Clone this repository

git clone https://github.com/micrapi/lanuel.git

cd lanuel

Laravel

composer install

cp .env.example .env

php artisan key:generate --ansi

Edit .env file depend on your environment (Required: APP_URL, DB_*, NUXT_PUBLIC_API_URL).

NuxtJs

yarn install

Developer

Open 2 terminal tab for Laravel and NuxtJs server

php artisan serve
yarn dev

Production

Use nginx as reverse proxy to run PHP and NodeJs. Use PM2 to manage NodeJs process.

Config nginx

map $sent_http_content_type $expires {
    "text/html"                 epoch;
    "text/html; charset=utf-8"  epoch;
    default                     off;
}

server {
    listen 80;

    # For https
    # listen 443 ssl;
    # ssl_certificate /etc/nginx/ssl/default.crt;
    # ssl_certificate_key /etc/nginx/ssl/default.key;

    server_name lanuel.dev;
    root /var/www/lanuel/public;
    index index.php index.html index.htm;

    location / {
        try_files $uri @proxy;
    }

    location @proxy {
        expires $expires;

        proxy_redirect                      off;
        proxy_set_header Host               $host;
        proxy_set_header X-Real-IP          $remote_addr;
        proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto  $scheme;
        proxy_read_timeout          1m;
        proxy_connect_timeout       1m;
        proxy_pass                          http://127.0.0.1:3003;
    }

    location ~ ^/(api|broadcasting) {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_pass fastcgi_backend;
        fastcgi_index index.php;
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_read_timeout 600;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }

    location /.well-known/acme-challenge/ {
        root /var/www/letsencrypt/;
        log_not_found off;
    }

    error_log /var/log/nginx/lanuel_error.log;
    access_log /var/log/nginx/lanuel_access.log;
}

Install and run PM2

npm install -g pm2

pm2 start

lanuel's People

Contributors

buihanh2304 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ryuchix

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.