This is one of my E-commerce API app implementations. It is written in Php using Laravel framework. This is not a finished project by any means, but it has a valid enough shape to be git cloned and studied if you are interested in this topic. If you are interested in this project take a look at my other server API implementations I have made with:
- Node Js + Sequelize
- Node Js + Bookshelf
- Node Js + Mongoose
- Python Django
- Python Flask
- Golang go gonic
- Java EE Spring Boot and Hibernate
- Ruby on Rails
- AspNet Core
The next projects to come will be:
- Elixir with phoenix and Ecto
- AspNet MVC 6
- Java EE with Jax RS with jersey
- Java EE with Apache Struts 2
- Spring Boot with Kotlin
- Go with Gorilla and Gorm
- Go with Beego
- Laravel with Fractal and Api Resources
- Flask with other Rest Api frameworks such as Flask-Restful, flask-apispec
- NodeJs with Knex (without Bookshelf, this one is already done, see above links)
- Git clone the project
- Rename .env.example to .env and change the values as needed
- Migrate
php artisan migrate
- Seed the database
php artisan db:seed
- Launch with php artisan serve --port=8080
- Import api.postman.json into postman and begin issuing requests
- Laravel
- Middlewares
- Authentication
- Authorization
- Eloquent ORM
- associations: hasMany, belongsTo, belongsToMany
- scopes
- complex queries
- paging
- eager loading, select columns
- Authentication / Authorization
- Paging
- Products, Orders, OrderItems, Addresses, Custom User model, Tags, Categories, Comments, TimestampedModel, FileUpload(Polymorphic)
- Products associated to images, file upload without any 3party package
- CRUD operations on products, comments, tags, categories
- Orders, guest users may place an order
composer dump-autoload
php artisan migrate:reset
php artisan migrate
php artisan migrate:refresh --seed
php artisan help make:model
- Scaffold with -a option: migration, controller and model
php artisan make:model Model/Product -a
php artisan route:list``
php artisan make:migrate
- Improve the seeding logic, there are orders with no order item.
- Security, File upload validations
- Unit testing
- Improve performance, improve database queries, they are fetching just everything now
-
Set a link from public/storage to storage, that way uploaded files can be accessible
php artisan storage:link
-
This is needed for the migration rename_name_column where I rename name to username
composer require doctrine/dbal