Download the PHP package khomsiadam/stacksync without Composer
On this page you can find all versions of the php package khomsiadam/stacksync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download khomsiadam/stacksync
More information about khomsiadam/stacksync
Files in khomsiadam/stacksync
Package stacksync
Short Description StackSync is a fullstack PHP mini framework, with an MVC structure, custom API system with a Middleware and JWT authentication, components based views, flexible routing, PSR4 autoloading. Essential files generation (migrations, seeders, controllers and models) and other operations can be executed through custom commands.
License MIT
Homepage https://github.com/KhomsiAdam/StackSync
Informations about the package stacksync
Introduction
StackSync is a simple, lightweight and native fullstack PHP mini-framework.
It is not a fully fledged framework and does not have all the complex features and the level of polish of other frameworks that are built by communities of professionals, therefore it is not suitable for big commercial projects or for other compagnies to use.
But it can still create powerful applications, and is more destined to be used by beginners and other developpers for personal projects.
Designed to be easy of use while having a strong foundation of the web stack of PHP, MySQL, HTML, JavaScript and CSS (or SASS/SCSS).
Requires basic knowledge of APIs, JSON, Object Oriented Programming.
The code is heavily commented and provides some examples and explanations, for a more detailed rundown, make sure to read through the documentation that covers every aspect of the mini-framework and get started.
Table of Contents
- Setup
- Installation
- Configuration
- Directory Structure
- Advanced
- Commands
- Contributions
Setup
Installation
Composer is required.
StackSync is available as a composer package, you can create a new StackSync project by running the command below in your terminal while defining the targeted folder:
Alternatively, you can download or clone the repository, then open the project and run the following command in your terminal:
This installs the dependencies for php-jwt and phpdotenv which are the only required packages.
Back to top
Configuration
After creating your database, in your root directory, you will find a .env.example
file. Copy and rename to .env
and start filling in your database informations:
Opening your terminal, navigating to your project folder:
Then running this command:
Will run PHP's built in development server on your local machine and browsing to http://localhost:8080
will show a welcome homepage.
Back to top
Directory Structure
For a more detailed view on the directory structure be sure to check it's section in the documentation as it also provides some basic insights.
Back to top
Advanced
This section dives deepers and covers all the important aspects and features.
API: The mini-framework's custom API system and the Middleware.
Controllers & Models: How controllers and models are setup.
Routing: Routing configuration for both Web routes and API endpoints.
Views: Views are managed with a Components Views System.
Migrations: A simple migrations system.
Seeding: Seed pre-defined data to your tables.
Back to top
Commands
With the help of composer, there are a multiple of useful custom commands to execute in your terminal.
-
Run PHP's own development server on your local machine (
localhost:8080
): - Run PHP's own development server on your local network. The address is your local IP address in your network and it can accessed by any device in the same network (ex:
192.168.1.2:8080
):
*The :8080
is the default port but it can be modified in composer.json
.
-
Apply the current migrations in
app/migrations
folder in the defined sequencing order: -
Drop the current applied migrations in your database. Only tables applied through the migrations system will be dropped. Any table created normally won't be affected:
-
Run all seeders defined in
app/seeders/DatabaseSeeder.php
: - Run the
app/seeders/UserSeeder.php
for seeding theuser
table:
*Any created seeder can be added in app/seeders/DatabaseSeeder.php
and/or have a custom script added for it under the scripts
section in composer.json
to be run individually.
-
Alternatively, you can apply current migrations then run all seeders defined:
-
Create a migration file while asking for it's order (that defines it's prefix and id), type (create or update), table name, auto-incremented or generated id, foreign key references and constraints:
-
Create a seeder file while asking for the targeted table name, is the id auto-incremented or generated, import of column names as keys with empty values to be filled:
-
Creates both a controller and a model since they rely on each other while asking for the targeted table name, is the id auto-incremented or generated. Everything is setup automatically based on the tables columns and basic CRUD methods are defined by default for a quick start and as a base for custom methods:
-
Enables / disables error handling:
- Enables / disables responses from the API:
Back to top
Contributions
Contributions are welcome. To discuss any bugs, problems, fixes or improvements please refer to the discussions section.
Before creating a pull request, make sure to open an issue first.
Committing your changes, fixes or improvements in a new branch with documentation will be appreciated.
Back to top