The purpose of this project is to provide a standard REST JSON-API that would allow a mobile application or a full frontend website to display a mini site.
Made with PHP 8, Symfony 6, REST, DDD, SOLID and Hexagonal Architecture.
This project uses Hexagonal Architecture.
This project uses Swagger for the API documentation.
-
clone the project :
[email protected]:kdakhli/api_rest_sf6.git
-
inside the project folder run :
composer install
-
setup your database by changing this line in
.env
fileDATABASE_URL=mysql://db_user:[email protected]:3306/db_name
-
connect the db by running the following command at the root of the project :
php bin/console doctrine:database:create
-
run this command in order to create the database schema :
php bin/console doctrine:schema:create
-
just start the build-in symfony server to begin exploring the api :
symfony serve -d
then go to http://localhost:8000 to use the API Sandbox
====> Enjoy :)
├── src
├── Application
│ ├── Command
│ └── Service
│
├── Domain
│ ├── Entity
│ ├── Exception
│ └── Repository
│
├── Infrastructure
│ ├── Exception
│ ├── Persistence
│ │ ├── Doctrine
│ │ │ └── Repository
│ │ └── Exception
│ └── Request
│
├── UI
│ └── Rest
│ ├── Action
│ ├── DTO
│ └── Exception
└── Utils
├── Exception
├── Serializer
└── Validation