Slim 4 + Vue 3

Related tags

Build Tools skeleton
Overview

THIS PROJECT IS STILL HEAVILY A WIP

Im still pretty much learning vue and how to integrate it.

PHP

Install dependencies: composer install

"require": {
    "ext-curl": "*",
    "ext-gd": "*",
    "ext-json": "*",
    "ext-pdo": "*",
    "ext-pdo_mysql": "*",
    "intervention/image": "^2",
    "laminas/laminas-escaper": "^2",
    "php-di/php-di": "^6",
    "psr/log": "^1",
    "slim/psr7": "dev-master",
    "slim/slim": "^4",
    "slim/php-view": "^3",
    "zeuxisoo/slim-whoops": "^0.7"
  },

setup webserver to point to the root /public folder

create a config.php file in the root with the values changed. see /app/Container.php and the Settings part for the default settings. config.php returns an array.

Development

install as per above.

run npm install to install the node modules necessary for the project.

set the debug value to true in config.php for optional whoops error handling

edit the vue.config.js files

devServer: {
        // This will forward any request that does not match a static file to localhost:3000
        proxy: 'http://skeleton.localhost/'
    }

to match your environment (all api endpoints use this as their base, as well as /media etc)

the concept here is to develop the site in vuejs (/src) run npm run serve for developing on (creates a developer server with live reloading n stuff)

Production

then when you ready to publish your project run npm run build which outputs the files into the /web folder. the php /assets route points to the /web/assets directory and allows for all the restrictions and changes the php routes allow for (like limiting file types).

the /* routes point to the /web/index.html file as a "template". which in turn loads the vue stuff.

"dependencies": {
    "@fortawesome/fontawesome-svg-core": "^1.2.36",
    "@fortawesome/free-brands-svg-icons": "^5.15.4",
    "@fortawesome/free-regular-svg-icons": "^5.15.4",
    "@fortawesome/free-solid-svg-icons": "^5.15.4",
    "@fortawesome/vue-fontawesome": "^3.0.0-4",
    "@popperjs/core": "^2.9.3",
    "bootstrap": "^5.1",
    "core-js": "^3.6.5",
    "vue": "^3.0.0",
    "vue-axios": "^3.2.5",
    "vue-router": "^4.0.0-0",
    "vuex": "^4.0.0-0"
  },
  "devDependencies": {
    "@types/bootstrap": "^5.1.4",
    "@typescript-eslint/eslint-plugin": "^4.18.0",
    "@typescript-eslint/parser": "^4.18.0",
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-plugin-router": "~4.5.0",
    "@vue/cli-plugin-typescript": "~4.5.0",
    "@vue/cli-plugin-vuex": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "@vue/compiler-sfc": "^3.0.0",
    "@vue/eslint-config-prettier": "^6.0.0",
    "@vue/eslint-config-typescript": "^7.0.0",
    "eslint": "^6.7.2",
    "eslint-plugin-prettier": "^3.3.1",
    "eslint-plugin-vue": "^7.0.0",
    "prettier": "^2.2.1",
    "sass": "^1.26.5",
    "sass-loader": "^8.0.2",
    "typescript": "~4.1.5"
  },

Database (wip)


CREATE TABLE IF NOT EXISTS `system_attempts` (
  `identifier` varchar(255) DEFAULT NULL,
  `type` varchar(250) DEFAULT NULL,
  `ip` varchar(45) DEFAULT NULL,
  `agent` varchar(300) DEFAULT NULL,
  `payload` text DEFAULT NULL,
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  KEY `session_id` (`identifier`),
  KEY `ip` (`ip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `system_authentication` (
  `token` varchar(50) NOT NULL,
  `user_id` int(11) NOT NULL,
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `changed` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`token`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `system_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `version` varchar(100) DEFAULT NULL,
  `datetime` datetime DEFAULT current_timestamp(),
  `level` varchar(50) DEFAULT NULL,
  `log` text DEFAULT NULL,
  `context` text DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



CREATE TABLE IF NOT EXISTS `system_sessions` (
  `session_id` varchar(255) NOT NULL,
  `user_key` varchar(250) DEFAULT NULL,
  `data` text DEFAULT NULL,
  `ip` varchar(50) DEFAULT NULL,
  `proxy_ip` varchar(50) DEFAULT NULL,
  `agent` varchar(300) DEFAULT NULL,
  `timestamp` int(11) DEFAULT NULL,
  PRIMARY KEY (`session_id`),
  KEY `user_key` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;



CREATE TABLE IF NOT EXISTS `system_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `salt` varchar(50) DEFAULT NULL,
  `settings` text DEFAULT NULL,
  `last_active` datetime DEFAULT NULL,
  `last_page` varchar(250) DEFAULT NULL,
  `active` tinyint(1) DEFAULT 1,
  PRIMARY KEY (`id`),
  KEY `active` (`active`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
You might also like...
Public append-only ledger microservice built with Slim Framework
Public append-only ledger microservice built with Slim Framework

Chronicle is a self-hostable microservice, built with Slim Framework, which enables authorized users to commit arbitrary data to an immutable, append-only public ledger.

Slim Framework 4 Skeleton Application

Slim Framework 4 Skeleton Application Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application. This app

REST APIs using Slim framework. Implemented all CRUD operations on the MySql database
REST APIs using Slim framework. Implemented all CRUD operations on the MySql database

PHP REST API using slim framework and CRUD operations šŸ– Hi there, this is a simple REST API built using the Slim framework. And this is for the folks

A slim, lean forum package designed for quick and easy integration in Laravel projects
A slim, lean forum package designed for quick and easy integration in Laravel projects

Complete documentation is available on teamteatime.net. Installation Requires Laravel 6+ and PHP 7.4+. Step 1: Install the package Install the package

Simple skeleton for the PHP Slim framework

Simple skeleton for the PHP Slim framework

A Simple PHP Renderer for Slim 3 (or any other PSR-7 project)

PHP Renderer This is a renderer for rendering PHP view scripts into a PSR-7 Response object. It works well with Slim Framework 4. Cross-site scripting

Slim Framework custom views

Slim Views This repository contains custom View classes for the template frameworks listed below. You can use any of these custom View classes by eith

A Slim PHP MVC framework built just for fun!

Aura Framework A Slim PHP MVC framework built just for fun! en: Note: This repository only contains the core code of the Aura framework. If you want t

Slim 3 skeleton working with Google App Engine include cron configuration.

Slim3 GAE Skeleton Slim 3 skeleton working with Google App Engine include cron configuration. Demo https://slim3-gae-skeleton.appspot.com/health_check

Slim Jam is a demo application to provide examples for composer package, PHPSpreadsheet, Shopify API etc. usages.

SLIM JAM Slim Jam is a demo application to provide examples for composer package, PHPSpreadsheet, Shopify API etc. usages. This project aims to take a

A slim PHP wrapper around wkhtmltopdf with an easy to use and clean OOP interface

PHP WkHtmlToPdf PHP WkHtmlToPdf provides a simple and clean interface to ease PDF and image creation with wkhtmltopdf. The wkhtmltopdf and - optionall

A PHP boilerplate based on Slim Framework, for start projects with Eloquent ORM, Validation, Auth (JWT), Repositories and Transformers ready

A PHP boilerplate based on Slim Framework, for start projects with Eloquent ORM, Validation, Auth (JWT), Repositories and Transformers ready.

Slim Framework skeleton application with MVC Schema

Slim Framework skeleton application with MVC Schema

This repository contains a library of optional middleware for your Slim Framework application

Slim Framework Middleware This repository contains a library of optional middleware for your Slim Framework application. How to Install Update your co

Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application

Slim Framework 4 Skeleton Application Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application. This app

A curated list of awesome tutorials and other resources for the Slim micro framework

Awesome Slim A curated list of awesome tutorials and other resources for the Slim micro framework Table of Contents Essentials Tutorials Packages and

SPA Skeleton with Mithril.js and Slim Framework

A single-page application (SPA) skeleton based on Mithril.js and Slim Framework 4 trying to use good practices

Slim Framework 3 Skeleton Application + PagSeguro Lib

Slim Framework 3 Skeleton Application + PagSeguro Lib AplicaĆ§Ć£o simples para geraĆ§Ć£o do Token para pagamentos no PagSeguro (mĆ©todo transparente) e env

Slim 3 PHP micro framework MVC application boilerplate

Slim 3 PHP micro framework MVC application boilerplate

Comments
  • production build failes

    production build failes

    There is one dependency missing: "axios".

    I ran npm install --save axios to solve the issue in the current template. In the packages.json you can find "axios": "^0.21.4" then. So adding this to the skeleton-package.json could solve the problem.

    opened by svenhofrichter 2
Owner
William Stam
William Stam
AplicaĆ§Ć£o criada com Slim Framework com objetivo de criar autenticaĆ§Ć£o com JWT e aprender sobre o framework Slim

Slim JWT App Essa aplicaĆ§Ć£o tem como foco o aprendizado do Framework Slim e tambĆ©m a utilizaĆ§Ć£o de JWT. Como rodar a AplicaĆ§Ć£o A aplicaĆ§Ć£o estĆ” config

Nicolas Pereira 9 Oct 4, 2022
Slim 4 + Vue 3

THIS PROJECT IS STILL HEAVILY A WIP Im still pretty much learning vue and how to integrate it. PHP Install dependencies: composer install "require": {

William Stam 2 Oct 10, 2021
mini Project in Laravel and vue js. Real World Laravel 8x + vue js Dashboard.Task management and project management system

mini Project in Laravel and vue js. Real World Laravel 8x + vue js Dashboard.Task management and project management system. Dashboard features such as: Complete Dashboard, Custom Authentication, Email Verification, custom-login-register-forgot password (without jetstream).

Hasmukh Dharajiya 2 Sep 20, 2022
Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.

Slim Framework Slim is a PHP micro-framework that helps you quickly write simple yet powerful web applications and APIs. Installation It's recommended

Slim Framework 11.5k Jan 4, 2023
Slim Framework 4 Skeleton Application

Slim Framework 4 Skeleton Application Use this skeleton application to quickly setup and start working on a new Slim Framework 4 application. This app

Slim Framework 1.5k Dec 29, 2022
Slim Framework 2 middleware

Slim Framework Middleware This repository contains a library of optional middleware for your Slim Framework application. How to Install Update your co

Slim Framework 47 Nov 7, 2022
UserFrosting is a secure, modern user management system written in PHP and built on top of the Slim Microframework, Twig templating engine, and Eloquent ORM.

UserFrosting is a secure, modern user management system written in PHP and built on top of the Slim Microframework, Twig templating engine, and Eloquent ORM.

UserFrosting 1.6k Jan 1, 2023
Slim Framework - Prerequisite Checker

Slim Framework - Server Configuration Checker Upload the file check.php to your webserver Browse to the file: https://example.com/check.php Check the

Daniel Opitz 6 Aug 30, 2022
This is a skeleton to quickly set up a new Slim 4 application.

Slim 4 Skeleton This is a skeleton to quickly set up a new Slim 4 application. Requirements PHP 7.4+ or 8.0+ MySQL 5.7+ or MariaDB Recommended Apache

Daniel Opitz 376 Jan 2, 2023
A slim, lean forum package designed for quick and easy integration in Laravel projects

Complete documentation is available on teamteatime.net. Installation Requires Laravel 6+ and PHP 7.4+. Step 1: Install the package Install the package

TeamTeaTime 486 Dec 31, 2022