Giter VIP home page Giter VIP logo

laranuxt's Introduction

Laravel + Nuxt.js Boilerplate

What is included

Installation

  • clone from github
  • run composer storage to create all the needed storage folders
  • run yarn and composer install to install all of your deps
  • copy .env.example to .env and configure it to your likings
    • i do this to speed up reactivity and compilation time
  • running yarn mdi will copy all the fonts and css to resources/static/
  • run yarn logs to create laravels needed storage logs folders
  • TL;DR git clone [email protected]:acidjazz/laranuxt.git; cd laranuxt; yarn; composer install; yarn mdi; cp .env.example .env; yarn logs;

Local environment

  • run yarn api (alias for ./artisan serve) in another terminal for our laravel API
  • run yarn dev in one terminal for our nuxt dev setup
  • I've also included a simple byobu script that starts everything up, just change PROJECT to your project folder name

AWS configuration (WIP)

This boilerplate also includes scripts to help you use it as an Auto Scaling Group with a Launch Configuration

  • You can find cloudinit-ami.sh in config/ which when configured and used as user-data will fire up an instance w/ the latest and all its dependencies to make an AMI
  • You can find cloudinit-delploy.sh in config/ which when configured can be used with a Launch Configuration to spin up more instances when needed
  • The following are stipulations for these scripts to work functionality
    • You start with the Amazon Linux 2 AMI
    • You have an s3 bucket holding your deploy keys and .env files, default to ${PROJECT}-vault
      • key would be in s3://${project}-vault/keys/ as id_rsa
      • envs would be in s3://${project}-vault/envs/ as env-${branch} (env-staging, env-master, etc)
  • Using these configs nuxt.js will run on port 3000 and then Laravel will run on port 8000, you can make a Target Group for each of these sending 80 and/or 443 to 3000

CircleCI Testing and Deployment

This boilerplate also includes a sample starter script to run tests and then deploy to your group of instances

  • This configuration works assuming your setup matches the above AWS config
  • Your EC2 group must have a tag key of ssm and value of your branch/environment, either staging or master
  • You can find, tweak, and use config/circleci-config.yml and move it to .circleci/config.yml when ready
  • Upon successful tests, this will use the AWS SSM Agent to run yarn ${branch} on each instance which will:
    • Grab the latest code
    • Re-download your .env from the s3 bucket
    • Refresh the icons file
    • Re-generate the nuxt.js static files
    • Restart the pm2 server with the newer static files
    • Via composer, run artisn migrate, artisan config:clear, artisan cache:clear and composer install

laranuxt's People

Contributors

acidjazz avatar dependabot[bot] 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.