riipandi/altstack

Alpine.js, Laravel, and Tailwind. An alternative full-stack development solution.

Installs: 37

Dependents: 0

Suggesters: 0

Security: 0

Stars: 39

Watchers: 0

Forks: 5

Language:Blade

Type:project

v8.4 2021-02-06 12:59 UTC

README

Build Status StyleCI Total Download Latest Stable Version License

Introduction

AltStack is a boilerplate meant to standardize much of the setup that almost every web application needs. Reclaim your first few hours of development on every new project by allowing AltStack to give you a little speed boost.

This is the Laravel template use Tailwind and Alpine.js as default preset and ships with some features like user management with UUID for primary key, and Two Factor Authentication. I'm using this template for (nearly) all my personal projects and professional projects, but you may use my template but please notice that we offer no support whatsoever.

We don't follow semver for this project and won't guarantee that the code (especially the master branch) is stable.

In short: when using this, you're on your own.

Quick Start

At least you will need PHP >= 7.4 and Nodejs >= 12.16. For database backend, you can choose between PostgreSQL >= 9.6 or MySQL >= 5.7 or MariaDB >= 10.3 or any other database engine that supported by Laravel. Also, you maybe want to use Redis >= 3.2 for session store and or caching storage.

By default I'm using PostgreSQL for main database. But, you can change it via .env configuration file.

Prepare the database

-- If using PostgreSQL: sudo -u postgres psql
DROP DATABASE IF EXISTS "homestead"; DROP ROLE IF EXISTS "homestead";
CREATE ROLE "homestead" SUPERUSER CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD 'securepwd';
CREATE DATABASE "homestead"; GRANT ALL PRIVILEGES ON DATABASE "homestead" TO "homestead";

-- If using MariaDB 10.x: mysql -uroot -p
DROP USER IF EXISTS `homestead`@`localhost`;
DROP DATABASE IF EXISTS `homestead`; CREATE DATABASE `homestead`;
GRANT ALL PRIVILEGES ON `homestead`.* TO `homestead`@`localhost` 
  IDENTIFIED BY 'securepwd' WITH GRANT OPTION;

Create New Project

# Use latest version:
composer create-project riipandi/altstack <app_name>

# If you want to use spesific version:
composer create-project riipandi/altstack <app_name> <version>

Change <app_name> with your own and <version> with release version. See release page for the version number.

Package Version

The versioning number will follow the release of the Laravel version, followed by the package release number:

x.y  =>  x is Laravel version, y are AltStack version.
7.5  =>  Laravel 7.x.x, AltStack revision 5.

Local Installation

Edit or create .env file and then execute:

# Composer dependencies
composer install --no-suggest

# Scaffolding application
php artisan key:generate --force
php artisan migrate:fresh --seed
php artisan vendor:publish --tag=blade-heroicons --force

# Compiling resources
npm install --no-optional --no-audit
npm run development

# Then, initiate database migration
php artisan migrate:fresh --seed

Default username is admin and password is secret.

Example Deployment

# Clone the project
sudo mkdir -p /srv/altstack ; cd $_
sudo chown -R $(whoami): /srv/altstack
git clone git@github.com:riipandi/altstack.git current

# Fix folder permissions
find /srv/altstack/. -type d -exec sudo chmod 0775 {} \;
find /srv/altstack/. -type f -exec sudo chmod 0644 {} \;
sudo chown -R $(whoami): /srv/altstack/current/.git
sudo chmod -R 0777 /srv/altstack/current/{bootstrap/cache,storage}
sudo chown -R webmaster:webmaster /srv/altstack
sudo chmod 0777 /srv/altstack

# Nginx virtualhost
sudo touch /etc/nginx/vhost.d/altstack.conf
cat /srv/altstack/current/stubs/vhost.nginx.stub | sudo tee /etc/nginx/vhost.d/altstack.conf > /dev/null
sudo systemctl restart nginx && sudo systemctl status nginx

# Supervisor daemon
sudo touch /etc/supervisor/conf.d/altstack.conf
cat /srv/altstack/current/stubs/supervisor.stub | sudo tee /etc/supervisor/conf.d/altstack.conf > /dev/null
sudo supervisorctl reread && sudo supervisorctl update
sudo supervisorctl restart altstack
sudo systemctl status supervisor

Contributing

Current state we won't accept any PR requests to this project. If you have discovered a bug or have an idea to improve the code, contact us first before you start coding.

Security Issue

If you discover any security related issues, please send an e-mail to riipandi@gmail.com instead of using the issue tracker.

Thanks To...

In general, I'd like to thank every single one who open-sources their source code for their effort to contribute something to the open-source community. Your work means the world! 🌍 ❤️

Copyright

This project is licensed under ISC: https://aris.mit-license.org/

Copyrights in this project are retained by their contributors. See license file for details.