Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.
/ pokeshop-web Public archive

Online shop with API built with own framework. Made during the Nix Solutions education program.

License

Notifications You must be signed in to change notification settings

pokeshop-nix/pokeshop-web

Repository files navigation

PokéShop

PokéShop is a zero-dependency online shop built with my own Laravel-like framework. This project was made during the NIX Solutions education program.

🔮 Framework features

  • Lightweight and well-documented. The size of PokéShop is only 115KB without images. Every method is well-documented so you always will know their function.
  • Fast and smart routing. The router uses regular expressions to determine the correct controller. Simply add one line of code in routes/web.php and your new page will work just fine! Pass any parameter inside curly brackets and access it in your controller.
  • Built-in API support. Any request on the path, defined in routes/api.php will work just fine! GET, POST, PUT, PATCH, and DELETE methods are supported. Pass any parameter or/and body and access them in your controller! The API is isolated from the web application.
  • Built-in DotEnv.
  • Easy-to-manipulate database with PDO.
  • A lot of helpers such as:
    • Session helper for PHP sessions.
    • Data validation for both web and API.
    • API authorization and Bearer token generator.
    • Simple API response.
  • Custom error and exception handler with logging.
  • Models using Active Record template.
  • Testing with Codeception.

⚓ Requirements

  • PHP 8.x
  • MySQL 6.x / MariaDB 10.x
  • Composer 2.x

📥 Downloads

💿 Installation

Windows installation:

  1. Download and install the latest version of XAMPP. It will install both PHP and MariaDB. Whenever you want to use your database, open XAMPP and start the MySQL process. To access PhpMyAdmin, start both Apache and MySQL processes, click on the Admin button next to MySQL
  2. Download and install the latest version of Composer. A PHP dependency manager.

macOS installation:
You can easily install those via Homebrew:

brew install php mysql composer

📜 Scripts

Application provides scripts for an easy contol of the application, type composer run -l to see all of them.

  • Serve the application with composer run serve
  • Build zero-dependency app with composer run build
  • Run all test or specific one with composer run test
  • Other test scripts.

🔑 API Reference

Authorization module

Action Request Method Requirements
Register /auth/signup POST Data
Sign in /auth/signin POST Data
Sign out /auth/signout POST Bearer token

User module

Action Request Method Requirements
Get all users /users GET
Get user /users/{id} GET user ID

Catalog module

Actionn Request Method Requirements
Get all products /catalog GET
Get product /catalog/{id} GET product ID

Order module

Action Request Method Requirements
Get user orders /orders GET Bearer token
Get specific order /orders/{id} GET Bearer token, order ID
Create order /orders POST Bearer token, data
Delete order /orders/{id} DELETE Bearer token, order ID

🦊 Have a great day!

Don't forget to check out PokéShop with Vue.js
Also check out my other projects and visit my website!