Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Emmanuel-Mtz-777/TechStore-Explorer/llms.txt

Use this file to discover all available pages before exploring further.

TechStore Explorer exposes a REST API under /api/ that returns JSON responses and uses Laravel Sanctum Bearer token authentication. Every protected endpoint requires a token obtained from POST /api/login or POST /api/register, passed via the Authorization: Bearer {token} header. All responses — including errors — are JSON objects.

Base URL

EnvironmentBase URL
Local developmenthttp://127.0.0.1:8000/api
ProductionYour Railway-assigned URL (e.g. https://<app>.up.railway.app/api)
All example requests in this documentation use the local development base URL http://127.0.0.1:8000/api. Replace it with your Railway URL when targeting your deployed instance.

Authentication

Requests to protected endpoints must include the Authorization header with a valid Sanctum Bearer token. Tokens are issued as plain-text personal access tokens and stored in the personal_access_tokens table.
Authorization: Bearer {token}
Obtain a token by calling POST /api/login with valid credentials, or POST /api/register to create a new account and receive a token in the same response.
See the Authentication guide for step-by-step instructions on registering, logging in, and attaching tokens to requests in both curl and Postman.

Available Endpoints

Auth

Public endpoints — no token required.
MethodEndpointDescription
POST/api/registerCreate a new user account (customer role) and receive a Bearer token
POST/api/loginAuthenticate an existing user and receive a fresh Bearer token

Wishlist

Requires a valid Sanctum Bearer token (auth:sanctum middleware).
MethodEndpointDescription
GET/api/wishlistList all wishlist items for the authenticated user
POST/api/wishlistAdd a product to the authenticated user’s wishlist
DELETE/api/wishlistRemove a product from the authenticated user’s wishlist

Roles

Requires a valid Sanctum Bearer token and the admin role (auth:sanctum + admin.api middleware).
MethodEndpointDescription
GET/api/rolesList all roles
POST/api/rolesCreate a new role
GET/api/roles/{id}Retrieve a specific role by ID
PUT/api/roles/{id}Update a specific role by ID
DELETE/api/roles/{id}Delete a specific role by ID

Response Format

All endpoints return JSON. Successful responses always include a message field alongside the relevant resource payload. Error responses contain a message field describing what went wrong. Successful response structure (example):
{
  "message": "Login successful",
  "user": { ... },
  "token": "2|xyz789..."
}
Error response structure (example):
{
  "message": "Invalid credentials"
}

HTTP Status Codes

Status CodeMeaningWhen it occurs
200 OKSuccessSuccessful GET and PUT and DELETE requests
201 CreatedResource createdSuccessful POST /api/register, POST /api/wishlist, POST /api/roles
401 UnauthorizedAuthentication failedMissing or invalid token; invalid login credentials
403 ForbiddenInsufficient permissionsAuthenticated user does not have the admin role
422 Unprocessable EntityValidation failureRequest body fails Laravel validation rules (e.g. missing required field, duplicate email)

Postman Collection

An official Postman collection is available for exploring all TechStore Explorer API endpoints with pre-configured request bodies and environment variables. Open the Postman collection →
The collection is shared as read-only. Fork it into your own Postman workspace to add your own environment variables (e.g. base_url, token).

Build docs developers (and LLMs) love