Giter VIP home page Giter VIP logo

laravel-boilerplate's Introduction

Main stack

  • PHP 8.2.6
  • XDebug latest
  • Composer latest
  • Laravel 10.12.0
  • Nginx 1.25.0
  • PostgreSQL 15.3
  • Redis 7.0.11

Requirements

  • Ubuntu-based distribution, recommends latest LTS version
  • Docker < 24
  • Docker compose < 2.3

Run Development environment

# Creates config for dev environment.
make env-dev

# Build dev environment.
make build

# Start dev environment.
make start

# Installs composer dependencies.
make composer-install

# Runs migrations.
make migrate

# Runs seeds.
make seed

# Available commands.
make help

Frontend

# Open Laravel container.
make shell

# Install js packages and dependencies.
yarn install

# Build assets (it's works for prod too).
yarn build

# Runs dev mode.
yarn dev

Welcome: http://localhost.

Backend

Go to: http://localhost/admin/login

Login: admin@localhost
Password: password

Api

Boilerplate uses GraphQL for API implementation.

GraphQL endpoint: http://localhost/graphql

GraphQL Playground: http://localhost/graphiql

Schema: graphql/schema.graphql

XDebug

In order to enable Xdebug

PHPStorm:

  • Start listening for PHP Debug connection.
  • Go to Setting -> PHP -> Debug. Click Validate add select Local Web Server or Shared Folder. Add public in Path to create validation script and run Validation. Everything must be success.
  • Also disable Break at first line in PHP scripts in Debug section.
  • Go to Settings -> PHP -> Server. Use path mappings for default server 0.0.0.0. In Project File section specified the Absolute path on the server - /var/www/html which corresponds to project root.
  • Apply remote configuration that stored in .run/remote.run.xml.
  • Set Breakpoints.
  • Start debugging.

VSCode:

  • Install and enable PHP Debug, Docker and Remote Explorer extensions.
  • Just set Breakpoints and run Debugging (F5).
  • VSCode configuration in .vscode/launch.json.

That's all.

In both cases XDebug helper need to be installed and enabled.

Customize the configuration you may in docker/php/dev/xdebug.ini. Available only in dev and test environments.

Nginx

PostgreSQL

# Run shell in container.
make shell-pgsql

# Show postgresql logs.
make logs-pgsql

Redis

  • Customize the configuration you may in docker/redis/redis.conf

Packages

License

The MIT License (MIT)

laravel-boilerplate's People

Contributors

kalitvyan avatar

Stargazers

 avatar

Watchers

 avatar

laravel-boilerplate's Issues

Update PostgreSQL container

  • Mount volume into storage
  • Deal with .env vars
  • Fixed version
  • Create Dockerfile
  • Create commands (logs, exec, ssh, etc)

Auto-creating .env file for dev environment

Something like this:

#entrypoint.sh
if [ ! -f ".env" ]; then
    echo "Creating env file for env $APP_ENV"
    cp .env.example .env
else
    echo "env file exists."
fi
# Dockerfile
ENTRYPOINT [ "entrypoint.sh" ]

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.