Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/germondai/php-api
PHP RESTful API with Doctrine, Entities, JWT and Pre-done Auth!
https://github.com/germondai/php-api
api crud db dbal doctrine entities jwt media migrations mysql orm php rest rest-api storage template
Last synced: 1 day ago
JSON representation
PHP RESTful API with Doctrine, Entities, JWT and Pre-done Auth!
- Host: GitHub
- URL: https://github.com/germondai/php-api
- Owner: germondai
- License: mit
- Created: 2024-06-04T16:14:45.000Z (5 months ago)
- Default Branch: dev
- Last Pushed: 2024-07-01T13:06:14.000Z (5 months ago)
- Last Synced: 2024-07-05T13:49:49.471Z (4 months ago)
- Topics: api, crud, db, dbal, doctrine, entities, jwt, media, migrations, mysql, orm, php, rest, rest-api, storage, template
- Language: PHP
- Homepage: https://api.germondai.com
- Size: 947 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
PHP RESTful API
**PHP RESTful API** with **Doctrine** integration. Own **Api** & **Entity Controller** that handles routing of **Model/Action** and **Entity** with **CRUD options** based on **Request Method**. Doctrine **Console**, **Entities** and **Migrations** to create flawless **ORM Schemas**. Custom useful **Utils** like **Token** that manages **JSON Web Tokens** (JWT). Pre-done **Auth Model**, **User Entity** connected with **Media Entity** by **OneToMany Relation** to keep track of **Author** of **uploaded** media **files** (**optimize**, **resize** and **image format/type change** included). Easy **configuration** and safe **.env** variables.
## ⚡️ Features
**Overview**
- Own REST API System
- Routing
- Auth
- CRUD
- Media
- Upload
- Optimize
- Resize
- Quality
- Format
- Doctrine
- ORM
- DBAL
- Entities
- Migrations
- Annotations
- Custom Utils
- Helper
- Database
- Doctrine
- JSON Web Tokens (JWT)
- Nette
- Database Explorer
- Tracy
- Environment (.env)## 🧬 Structure
**app/** - App's Main Code (Controller, Entity, Model)\
**bin/** - Console for Doctrine\
**migrations/** - Doctrine DB Migrations\
**public/** - Accessible from Outside (Routing, Media)\
**src/** - Developer Source Files (Assets, Includes, Utils)\
**temp/** - Storage for Temporary Files and Logs## 🧠 Technologies
- PHP
- Doctrine
- Nette DB
- JSON Web Tokens (JWT)## 🛠️ Installation Instructions
Requirements
- 👨💻 Composer
**Install dependencies**
```bash
composer install
```**Setup .env**
- Database Credentials
- JWT Secret and Algorithm```bash
# to dupe example.env as .env
cp example.env .env
```## 📝 Entity Guide
Entity CRUD operations depends on Request Methods\
Entity Schema returns tables / table with columns### Routes
Operations: `/[entity]/[id]`
- GET - Read
- POST - Create
- PUT - Replace
- PATCH - Update
- DELETE - Delete
- OPTIONS - Preflight (always return 200)Schema: `/schema/[entity]`
## 📚 Doctrine Guide
The Doctrine console is in "_bin/console_"\
EntityManager config location "_src/Utils/Doctrine.php_"\
Base migrations config, which is in root "_migrations.php_"\
And migration files are stored in "_migrations/_"### Console
```bash
# To run doctrine console
php bin/console ...# if you need commands list
php bin/console list
```---
Made with ❤️ by
@germondai