{"id":27719414,"url":"https://github.com/ma1ko0/lightfulrest-php","last_synced_at":"2025-04-27T07:47:18.221Z","repository":{"id":286895229,"uuid":"962754890","full_name":"Ma1ko0/lightfulrest-PHP","owner":"Ma1ko0","description":"This project is an ultra-lightweight PHP framework designed to provide only the essential building blocks for web applications. It serves as an alternative to heavier frameworks by focusing on simplicity and minimalism, giving developers just enough to build web applications without unnecessary complexity","archived":false,"fork":false,"pushed_at":"2025-04-24T07:49:26.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-27T07:47:06.256Z","etag":null,"topics":["php","php-framework","php8","rest-api","restful-api","template-project"],"latest_commit_sha":null,"homepage":"","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/Ma1ko0.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-08T16:14:07.000Z","updated_at":"2025-04-24T07:49:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"81a2b0ad-8f44-4f25-8e3a-4110b89b54f0","html_url":"https://github.com/Ma1ko0/lightfulrest-PHP","commit_stats":null,"previous_names":["ma1ko0/lightfulrest-php"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ma1ko0%2Flightfulrest-PHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ma1ko0%2Flightfulrest-PHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ma1ko0%2Flightfulrest-PHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ma1ko0%2Flightfulrest-PHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ma1ko0","download_url":"https://codeload.github.com/Ma1ko0/lightfulrest-PHP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251106450,"owners_count":21537168,"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":["php","php-framework","php8","rest-api","restful-api","template-project"],"created_at":"2025-04-27T07:47:17.519Z","updated_at":"2025-04-27T07:47:18.204Z","avatar_url":"https://github.com/Ma1ko0.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom PHP Lightweight Framework\n\nThis project is an ultra-lightweight PHP framework designed to provide only the essential building blocks for web applications. It serves as an alternative to heavier frameworks by focusing on simplicity and minimalism, giving developers just enough to build web applications without unnecessary complexity.\n\n## Why This Framework?\n\nThe goal of this framework is to create a minimalist, easy-to-understand PHP framework for small to medium-sized projects. It's perfect for developers who want to avoid the overhead of full-fledged frameworks and need only the most basic features to get started quickly.\n\nThis framework includes:\n- A custom routing system.\n- Simple PDO-based database interaction.\n- Basic error handling.\n- Environment configuration with `.env` files.\n\nIf you need a lightweight foundation to build your project, this framework will give you the flexibility to add just what you need without the bloat.\n\n## Features\n\n- **Minimalist Design**: A lightweight framework with only the essential features.\n- **Custom Routing**: A simple and flexible routing system to handle HTTP requests.\n- **PDO Database Interaction**: Basic database operations using PDO for secure and efficient database access.\n- **Environment Configuration**: Supports `.env` files to manage environment-specific settings (e.g., database credentials).\n- **Error Handling**: Basic error handling with appropriate HTTP status codes.\n- **PSR-4 Autoloading**: Automatically loads classes based on the PSR-4 autoloading standard.\n- **Logging**: Built-in logging for tracking application events and debugging.\n\n## Installation\n\n### 1. Clone the repository\n\nClone the repository to your local machine:\n```bash\ngit clone https://github.com/Ma1ko0/lightfulrest-PHP.git\n```\n\n### 2. Set up the environment\n\nCopy the `.env.example` file to `.env` and configure your environment variables (e.g., database credentials):\n```bash\ncp .env.example .env\n```\n\nUpdate the `.env` file with your database details, such as:\n```\nDB_HOST=localhost\nDB_NAME=mydatabase\nDB_USER=root\nDB_PASSWORD=12345678\n```\n\n### 3. Start the application (with Docker)\n\nIf you're using Docker, you can start the application by running:\n```bash\ndocker-compose up\n```\n\nAlternatively, you can run the application locally using a web server like Apache or Nginx.\n\n### 4. Access the application\n\nThe application will be accessible at:\n```\nhttp://localhost:8080\n```\n\n## Usage\n\nThis framework provides a basic structure for handling HTTP requests. Below are some examples of how to use it.\n\n### Routes\n\n- **GET** `/your-endpoint`: Handle GET requests to fetch data or perform actions.\n- **POST** `/your-endpoint`: Handle POST requests to submit data or perform actions.\n\n### Example Code for Adding a New Route:\n\n1. Create a controller class that extends the base controller.\n2. Define methods to handle GET or POST requests.\n3. Add your logic to process the request and return a response.\n\n```php\nnamespace App;\n\nclass ExampleController extends Controller\n{\n    public function processRequest(): void\n    {\n        if ($this-\u003egetMethod() === 'GET') {\n            echo 'Hello, world!';\n        }\n    }\n}\n```\n\n## Future Features\n\n- **Authentication**: Implement token-based authentication or session management.\n- **Logging Improvements**: Enhanced logging features and logging levels.\n- **Advanced Database Helpers**: Implement more advanced database operations like query builders.\n- **Unit Testing**: Add test cases for better test coverage.\n- **Expanded Documentation**: Provide more detailed usage examples and documentation.\n\n## Contributing\n\nFeel free to fork the repository and submit pull requests if you'd like to contribute! This project is open to contributions, whether it's adding new features, improving documentation, or fixing bugs.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fma1ko0%2Flightfulrest-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fma1ko0%2Flightfulrest-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fma1ko0%2Flightfulrest-php/lists"}