{"id":18463747,"url":"https://github.com/commandstring/cmdmicro","last_synced_at":"2025-04-08T07:32:46.693Z","repository":{"id":65073532,"uuid":"581525924","full_name":"CommandString/cmdMicro","owner":"CommandString","description":"A PHP microframework for building websites","archived":true,"fork":false,"pushed_at":"2023-02-11T02:58:15.000Z","size":113,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T16:57:58.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"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/CommandString.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":"2022-12-23T12:53:21.000Z","updated_at":"2023-04-30T05:19:06.000Z","dependencies_parsed_at":"2023-02-05T03:01:00.835Z","dependency_job_id":null,"html_url":"https://github.com/CommandString/cmdMicro","commit_stats":null,"previous_names":[],"tags_count":10,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommandString%2FcmdMicro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommandString%2FcmdMicro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommandString%2FcmdMicro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommandString%2FcmdMicro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CommandString","download_url":"https://codeload.github.com/CommandString/cmdMicro/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247796338,"owners_count":20997553,"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","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":[],"created_at":"2024-11-06T09:07:50.376Z","updated_at":"2025-04-08T07:32:46.388Z","avatar_url":"https://github.com/CommandString.png","language":"PHP","readme":"# cmdMicro\n\nA PHP microframework for building websites\n\n# Table of Contents\n- [Requirements](#requirements)\n- [Getting started](#getting-started)\n- [Environment Configuration](#environment-configuration)\n- [Creating Routes](#creating-routes)\n- [Cookie Manipulation](#cookie-manipulation)\n- [Database Interaction](#database-interaction)\n- [File Structure](#file-structure)\n- [Developing](#developing)\n- [Final Notes](#final-notes)\n\n# Requirements\n* PHP 8.1\u003c=\n* Composer\n* nodemon (recommended for development)\n* Basic understanding of MVC\n\n# Getting started\n\n1. [Create a repository from the template](https://github.com/CommandString/cmdmicro/generate) or [download the latest release](https://github.com/CommandString/cmdmicro/releases)\n2. `composer install \u0026\u0026 php index.php`\n3. Goto http://localhost:8000 and viola the website is alive\n\n# Environment Configuration\n\nYou can change or add your own configuration options to `/env.json`. Below is an explanation for each configurable option.\n\n```js\n{\n    \"server\": {\n        \"ip\": \"127.0.0.1\", // the IP address the server should be binded to\n        \"port\": 8000, // The port the server will be binded to\n        \"dev\": true // Whether exceptions should be shown as a webpage, disable in production\n    },\n    \"twigConfig\": { \n        \"cache\": \"./cache\", // Where cache files are stored\n        \"views\": \"./views\", // Where views are stored\n        \"cache_templates\": false // Whether to cache templates, enable in production\n    },\n    \"cookies\": {\n        \"enabled\": false, // Create commandstring/cookies instance\n        \"encryption_passphrase\": \"\", // 32+ character alphanumeric key to encrypt cookies with\n        \"encryption_algo\": \"\" // an openssl algo to encrypt cookies with\n    },\n    \"database\": {\n        \"enabled\": false, // Create commandstring/pdo instance \n        \"username\": \"\", // username used for connecting to db\n        \"password\": \"\", // password used for connect to db\n        \"name\": \"\", // the name of the database to connect to\n        \"host\": \"\", // the host of the db (e.g. 127.0.0.1)\n        \"port\": \"\" // port of the db (e.g. 3306)\n    }\n}\n```\n\n*Note: When `env.json` does not exist `/env.example.json` will be copied to `/env.json` automatically*\n\nYou can read more on how to utilize this by checking out the README for [CommandString/Env](https://github.com/commandstring/env)\n\n# Creating Routes\n\nRoute Controllers should be stored inside `/routes`. For actually creating routes read through [CommandString/Router](https://github.com/commandstring/router#routing) for a more in-depth explanation on how to create routes.\n\nFor creating views I would recommend checking out the documentation for [BladeOne](https://github.com/EFTEC/BladeOne) as well as [Blade](https://laravel.com/docs/9.x/blade) by default all views are stored in `/views` and all public assets (e.g. css, js, and images) are stored inside `/public`\n\n# Cookie Manipulation\n\nCheckout the README for [CommandString/ReactPHP-Cookies](https://github.com/commandstring/reactphp-cookies) for on how to manipulate cookies.\n\n# Database Interaction\n\nIf you know PDO then you know how to use 99% of my PDO driver you can read more on that here [CommandString/PDO](https://github.com/commandstring/pdo#executing-a-query)\n\n# File Structure\n| Folder Path | Description |\n|:-| :-|\n| /public               | Files that can be accessed directly by the client\n| /public/assets        | Public assets\n| /public/assets/img \t| Images\n| /public/assets/css \t| Cascading Style Sheets\n| /public/assets/js  \t| Javascript\n| /routes \t\t        | Route controller storage\n| /views  \t\t        | Blade template storage\n| /compiled\t\t        | Compiled view storage\n| /common               | Common class storage\n\n# Developing\n\nI highly recommend installing nodemon from npm when developing. This is because by default you have to restart the script everytime you make modifications, which can be a huge waste of time. So you'll need nodejs and npm to install nodemon, after verifying you have those two installed on your system you can do...`npm install -g nodemon` and then instead of starting the server with `php index.php` instead do `nodemon index.php`. Change a file and you will see it says the server has restarted. You can also invoke a restart by entering `r` into the console.\n\n# Final Notes\n\nIf you have any questions on how to use this microframework or have any issues setting it up feel free to join my [discord server](https://discord.gg/TgrcSkuDtQ) and ask there.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommandstring%2Fcmdmicro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommandstring%2Fcmdmicro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommandstring%2Fcmdmicro/lists"}