Skip to content

CyanFroste/smol

Repository files navigation

SMOL

A Very Minimalistic PHP Framework for prototyping with TailwindCSS and Typescript support


Getting Started

Prerequisites


Installation

  1. Clone the repo
git clone https://github.com/CyanFroste/smol.git
  1. Install PHP dependencies
composer update
  1. Install Javascript dependencies
npm i
  1. Start dev server (This will start a PHP server on http://localhost:3000)
npm start

Note: Hot reloading is absent


Usage

  • Register new routes in public/index.php

  • Add controllers inside ./controllers

  • Add views inside ./views

  • Supports minor reusable components which can be added inside ./components

  • To compile Tailwind

npm run cssw  // watch mode
npm run css   // production build
  • To compile Typescript
npm run tsw  // watch mode
npm run ts   // production build

Make

A small utility to generate boilerplate code for controllers and components

Usage - From root directory, run

node make <name> -type

Eg.
node make -r HomeController // Controller
node make -c Button         // Component