{"id":21506540,"url":"https://github.com/khomsiadam/stacksync","last_synced_at":"2025-09-10T02:34:21.991Z","repository":{"id":57006275,"uuid":"429088876","full_name":"KhomsiAdam/StackSync","owner":"KhomsiAdam","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.","archived":false,"fork":false,"pushed_at":"2021-11-23T14:04:08.000Z","size":1306,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-23T04:44:16.103Z","etag":null,"topics":["api","commands","components","environment-variables","framework","jwt-authentication","middleware","migrations","mvc","php","psr-4","routing","scripts","seeding"],"latest_commit_sha":null,"homepage":"https://stacksync.netlify.app/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KhomsiAdam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-17T14:56:26.000Z","updated_at":"2024-09-18T19:41:28.000Z","dependencies_parsed_at":"2022-08-21T12:40:40.125Z","dependency_job_id":null,"html_url":"https://github.com/KhomsiAdam/StackSync","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/KhomsiAdam/StackSync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhomsiAdam%2FStackSync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhomsiAdam%2FStackSync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhomsiAdam%2FStackSync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhomsiAdam%2FStackSync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KhomsiAdam","download_url":"https://codeload.github.com/KhomsiAdam/StackSync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhomsiAdam%2FStackSync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274402060,"owners_count":25278334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","commands","components","environment-variables","framework","jwt-authentication","middleware","migrations","mvc","php","psr-4","routing","scripts","seeding"],"created_at":"2024-11-23T19:41:16.637Z","updated_at":"2025-09-10T02:34:21.718Z","avatar_url":"https://github.com/KhomsiAdam.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://stacksync.netlify.app/\"\u003e\n    \u003cimg width=\"790\" height=\"157\" src=\"https://user-images.githubusercontent.com/9354045/142086641-ab6b172e-194b-4d1e-9f0a-f1f94a42a353.png\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT--Clause-brightgreen.svg?style=flat-square\" alt=\"Software License\"\u003e\u003c/img\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/KhomsiAdam/StackSync/releases\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/release/KhomsiAdam/StackSync.svg?style=flat-square\" alt=\"Latest Version\"\u003e\u003c/img\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n  \n# Introduction\n\n[StackSync](https://stacksync.netlify.app/) is a simple, lightweight and native fullstack PHP mini-framework.\n\nIt 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.\n\nBut it can still create powerful applications, and is more destined to be used by beginners and other developpers for personal projects.\n\nDesigned to be easy of use while having a strong foundation of the web stack of PHP, MySQL, HTML, JavaScript and CSS (or SASS/SCSS).\n\nRequires basic knowledge of APIs, JSON, Object Oriented Programming.\n\nThe code is heavily commented and provides some examples and explanations, for a more detailed rundown, make sure to read through the [documentation](https://stacksync.netlify.app/) that covers every aspect of the mini-framework and get started.\n\n# Table of Contents\n\u003c!--ts--\u003e\n* [Setup](#setup)\n  * [Installation](#installation)\n  * [Configuration](#configuration)\n* [Directory Structure](#directory-structure)\n* [Advanced](#advanced)\n* [Commands](#commands)\n* [Contributions](#contributions)\n\u003c!--te--\u003e\n\n# [Setup](https://stacksync.netlify.app/setup.html)\n\n## [Installation](https://stacksync.netlify.app/setup.html#install)\n\n[Composer](https://getcomposer.org/) is required.\n\nStackSync 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:\n\n```bash\ncomposer create-project khomsiadam/stacksync project-name\n\n```\n\nAlternatively, you can download or clone the repository, then open the project and run the following command in your terminal:\n\n```bash\ncomposer install\n\n```\n\nThis installs the dependencies for [php-jwt](https://github.com/firebase/php-jwt) and [phpdotenv](https://github.com/vlucas/phpdotenv) which are the only required packages.\n\n[Back to top](#table-of-contents)\n\n## [Configuration](https://stacksync.netlify.app/setup.html#config)\n\nAfter 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:\n\n```\n# Database Credentials: *fill with your proper database information\nDB_HOST=\nDB_NAME=\nDB_USER=\nDB_PASS=\n\n# Data Source Name: *do not modify! $_ENV['DSN'] is used as first argument for your PDO connection\nDSN=mysql:host=${DB_HOST};dbname=${DB_NAME}\n\n# Errors and responses status for error handling for the API:\nERRORS=ON\nRESPONSES=ON\n\n# Database User Table:\nUSER_TABLE=user\n\n# Database User Columns (add any needed variable for every column added in user table):\nUSER_ID=user_id\nUSER_EMAIL=email\nUSER_PASSWORD=password\n\n# Database Audience Table: *The recipient table for account for 'aud' in JWT token payload\nAUDIENCE_TABLE=\n# Database Other Tables: *Other tables you may need, as argument for your CRUD operations in controller methods\nEXAMPLE_TABLE=\n\n# API Token Authentication Secret Keys: *fill with your own key or add new keys as needed\nSECRET_KEY=\n```\n\nOpening your terminal, navigating to your project folder:\n\n```bash\ncd project-name\n```\n\nThen running this command:\n\n```bash\ncomposer serve:local\n```\n\nWill run PHP's built in development server on your local machine and browsing to `http://localhost:8080` will show a welcome homepage.\n\n[Back to top](#table-of-contents)\n\n# [Directory Structure](https://stacksync.netlify.app/directories.html)\n\n```\napp/                            # The app folder is your backend folder with the main structure\n|\n|– config/                      # Folder containing your database, constants configuration along with the Middleware\n|\n|– controllers/                 # Folder containing all your controllers\n|\n|– core/                        # Contains the core of the mini-framework: Router, Component View system, File generation\n|   |\n|   |– templates/               # Folder that contains templates for file creation\n|\n|– migrations/                  # Any generated migration file will be here\n|\n|– models/                      # Folder containing all your models\n|\n|– seeders/                     # Any generated seeder file will be here\n|\n|– views/                       # Contains all files that forms a view. The content files are in the root of this folder\n|   |\n|   |– components/              # For view components (dynamic/static)\n|   |   |\n|   |   |- dynamic              # Dynamic components: part of the content\n|   |   |\n|   |   |- static               # Static components: part of the layout\n|   |\n|   |– layouts/                 # Layouts for views containing static components and the content\n|\n|– Application.php              # The main file that runs the application \n|\npublic/                         # The public folder is your frontend folder where all your assets are with the index.php file\n|\n|– css/                         # Folder to contain stylesheets\n|\n|– fonts/                       # Folder for hosting your fonts to be used with @font-face rule\n|\n|– icons/                       # Contains your icons\n|\n|– images/                      # Contains your images\n|\n|– js/                          # Folder for all your javascript files, libraries, modules\n|\n|– scss/                        # Folder to contain your SASS/SCSS files or the architecture included if used\n|\n|– index.php                    # Where the requests are redirected to. Routes are defined here.\n|\nvendor/                         # Packages folder\n|\n.env                            # Environement variables\n|\ncomposer.json                   # Project properties, meta data and dependencies\n```\n\nFor a more detailed view on the directory structure be sure to check it's [section](https://stacksync.netlify.app/directories.html) in the documentation as it also provides some basic insights.\n\n[Back to top](#table-of-contents)\n\n# [Advanced](https://stacksync.netlify.app/advanced.html)\n\nThis section dives deepers and covers all the important aspects and features.\n\n[API](https://stacksync.netlify.app/advanced.html#api): The mini-framework's custom API system and the Middleware.\n\n[Controllers \u0026 Models](https://stacksync.netlify.app/advanced.html#controllers): How controllers and models are setup.\n\n[Routing](https://stacksync.netlify.app/advanced.html#routing): Routing configuration for both Web routes and API endpoints.\n\n[Views](https://stacksync.netlify.app/advanced.html#views): Views are managed with a Components Views System.\n\n[Migrations](https://stacksync.netlify.app/advanced.html#migrations): A simple migrations system.\n\n[Seeding](https://stacksync.netlify.app/advanced.html#seeding): Seed pre-defined data to your tables.\n\n[Back to top](#table-of-contents)\n\n# [Commands](https://stacksync.netlify.app/commands.html)\n\nWith the help of [composer](https://getcomposer.org/), there are a multiple of useful custom commands to execute in your terminal.\n\n- Run PHP's own development server on your local machine (`localhost:8080`):\n\n```bash\ncomposer serve:local\n```\n\n- 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`):\n\n```bash\ncomposer serve:remote\n```\n\n*The `:8080` is the default port but it can be modified in `composer.json`.\n\n- Apply the current migrations in `app/migrations` folder in the defined sequencing order:\n\n```bash\ncomposer migrate:apply\n```\n\n- 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:\n\n```bash\ncomposer migrate:drop\n```\n\n- Run all seeders defined in `app/seeders/DatabaseSeeder.php`:\n\n```bash\ncomposer seed:all\n```\n\n- Run the `app/seeders/UserSeeder.php` for seeding the `user` table:\n\n```bash\ncomposer seed:user\n```\n\n*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.\n\n- Alternatively, you can apply current migrations then run all seeders defined:\n\n```bash\ncomposer migrate:apply:seed\n```\n\n- 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:\n\n```bash\ncomposer make:migration\n```\n\n- 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:\n\n```bash\ncomposer make:seeder\n```\n\n- 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:\n\n```bash\ncomposer make:controller\n```\n\n- Enables / disables error handling:\n\n```bash\ncomposer errors:on\n```\n```bash\ncomposer errors:off\n```\n\n- Enables / disables responses from the API:\n\n```bash\ncomposer responses:on\n```\n```bash\ncomposer responses:off\n```\n\n[Back to top](#table-of-contents)\n\n# Contributions\n\nContributions are welcome. To discuss any bugs, problems, fixes or improvements please refer to the discussions section.\n\nBefore creating a pull request, make sure to open an issue first.\n\nCommitting your changes, fixes or improvements in a new branch with documentation will be appreciated.\n\n[Back to top](#table-of-contents)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhomsiadam%2Fstacksync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhomsiadam%2Fstacksync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhomsiadam%2Fstacksync/lists"}