Here's a sample README.md file for your NAMO PHP framework:
# 🧩 NAMO - Lightweight PHP API Framework
**NAMO** is a lightweight and powerful PHP micro-framework built on top of [Slim 4](https://www.slimframework.com/) designed specifically for building robust, secure, and scalable APIs. It comes pre-integrated with essential features like **JWT authentication**, **input validation**, **middleware support**, **logging**, and a **PDO wrapper** for database operations — everything you need to get started with your next API project quickly.
---
## ✨ Features
- 🔐 **JWT Authentication** out of the box
- 🧰 **Validation** powered by Rakit\Validation
- ⚙️ **Middleware** for auth, CORS, etc.
- 📦 **PDO Wrapper** for clean and easy DB access, powered by Medoo
- 📝 **Monolog Logger** for debugging and application logs
- 🔄 Sample codes to help you bootstrap your API
---
## 🚀 Getting Started
### 1. Clone the repo
```bash
git clone https://github.com/skriptxadmin/namophp.git
cd NAMOPHP
```composer updateCopy .env.example to .env and update the variables (DB, JWT secret, etc.)
cp .env.example .envUpdate .env:
APP_ENV=local #production or local or devAll static files need to be placed in public folder
Default way of linking css file
<link rel="stylesheet" href="{$url}/styles/app.css">{css file="styles/app.css"}
{js file="scripts/app.js"}- User Registration & Login with JWT
- Protected Profile Route
- Form Validation Example
- Middleware for Logging Requests
$validator = new \App\Helpers\Validator();
$data = $request->getParsedBody();
$rules = [
'pin' => 'required|min:6|max:6|regex:/^[1-9][0-9]*$/',
];
$messages = [
];
$validationResult = $validator->make($data, $rules, $messages);
if ($validationResult !== true) {
return $this->json(['errors' => $validationResult], 422);
}
$validData = $validator->validData;
$uid = $request->getAttribute('uid'); $rows = $this->db->select('table-name', '*');
$rows = $this->db->select('table-name', ['id','name']);
$rows = $this->db->select('table-name', 'id');
$rows = $this->db->select('table-name', 'id', ['id'=> 3]);
$rows = $this->db->get('table-name', 'id', ['id'=> 3]);
$rows = $this->db->insert('table-name', $data);
$rows = $this->db->update('table-name', $data, $where);
$rows = $this->db->delete('table-name', $where); $group->get('/{slug}', [App\Controllers\Roles\IndexController::class, 'get'])->setName('roles.get'); public function get(Request $request, Response $response, array $args): Response
{
$slug = $args['slug'];
$row = $this->db->get('roles', '*' ,['slug' => $slug]);
return $this->json($row);
}Pull requests are welcome. For major changes, please open an issue first.
This project is open-source and available under the MIT License.
Alaksandar Jesus Gene AMS Entrepreneur, Developer — skriptx.com