Pet shop API is a project designed to test candidates experience in backend development. On this part of the test, I showcased my knowledge, skills, and detail-oriented Backend experience.
This application is a replica to the existing PetShop API made by Buckhill to test candidates.
This project was created using the following technologies and tools:
This project was scaffolded with Laravel. It sets up a standard directory structure, enabling you to begin development and build things quickly. Feel free to check Laravel full documentation
If you are using windows you can download XAMPP + Composer and you are ready to go.
- Open your terminal and run the following command to clone the project:
git clone https://github.com/Sami-21/pet-shop-api.git
- Enter project directory:
cd pet-shop-api
- Install dependencies:
composer install
- Copy .env.example to .env
cp .env.example .env
fill database credentials in your .env file to link it with laravel application.
- Generate app key
php artisan key:generate
- Generate private and public keys for asymmetric encryption with lcobucci/jwt , the command below with generate a private key within yout root directory:
openssl genpkey -algorithm RSA -out private.key -pkeyopt rsa_keygen_bits:4096
Now for the public key:
openssl rsa -pubout -in private.key -out public.key
Et voila you have your keys ready , the next step is to create a folder called keys in storage directory move them to it.
mkdir storage/keys
mv private.key storage/keys/private.key
mv public.key storage/keys/public.key
Add those keys to your .gitignore file (you can exclude the public key) if it not there already.
7. Run your migrations and seeders :
php artisan migrate --seed
8. Finally run your project:
php artisan serve
9. You can generate Swagger docs by running :
php artisan l5-swagger:generate
10. You can also run tests :
php artisan test
- Log in
- Create user account
- Logout
- View user details
- View user orders
- User endpoints (excluding password-reset/change-password)
- Brand endpoints
- Category Endpoints
- Product Endpoints
- User password reset / password change