https://github.com/sci3ma/demo-sf-layered-shop
https://github.com/sci3ma/demo-sf-layered-shop
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/sci3ma/demo-sf-layered-shop
- Owner: sci3ma
- Created: 2021-04-01T14:13:10.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-25T16:33:23.000Z (about 5 years ago)
- Last Synced: 2025-02-02T09:46:06.714Z (over 1 year ago)
- Language: PHP
- Size: 103 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Assumptions
- users in memory
- few random unit tests
- docker
- symfony with twig
- no API
- DDD
- layered architecture
- SOLID
- MailHog (https://github.com/mailhog/MailHog) for email testing
- view product and view list of products routes are open
- add new product route needs authentication
- minimal html/twig views, no css and js
- ADR (Action-Domain-Responder) pattern approach
- no leaks outside domain layer
- framework-agnostic approach
## Possible improvements
- signed/encrypted transaction emails
- more unit tests
- more DDD approach (like ProductId objects, https://msgphp.github.io/)
- better framework-agnostic approach
- doctrine entities mapping in xml files
- API instead of symfony+twig+forms
- CQRS
- Money PHP lib (https://github.com/moneyphp/money) instead string
## Used helpers
- https://github.com/sci3ma/symfony-docker
- https://github.com/sci3ma/symfony-grumphp
## Installation
To install project, clone this repository then build containers:
```shell
$ docker-compose build
```
run containers:
```shell
$ docker-compose up -d
```
install composer dependencies:
```shell
$ docker exec -it php composer install
```
run doctrine migrations:
```shell
$ docker/console doctrine:migrations:migrate
```
## Usage
### Authentication
```
email: admin@example.com
password: test
```
### Add new product
`http://127.0.0.1:8000/product/add`
### View product
`http://127.0.0.1:8000/product/view/{id}`
### View list of products
`http://127.0.0.1:8000/product/list`