Skip to content

Laravel Backend for CSS Dictionary. Under development (em desenvolvimento).

Notifications You must be signed in to change notification settings

rapha-developer/laravel-backend-for-css-dictionary

Repository files navigation

Laravel Backend For CSS Dictionary Logo

The Laravel Backend for CSS Dictionary is an API that brings together all the css properties, functions, effects and animations. Each collected code snippet has definition and examples for unique possible contexts.

"O Laravel Backend para dicionário CSS é uma API que reúne todas as propriedades, funções, efeitos e animações css. Cada trecho de código coletado possui definição e exemplos para singulares contextos possíveis.

Laravel version: v10.11.0 Language most used: 76% of PHP Click to check demo online Made with love License MIT

Why (por que?)  |  Demo  |  How to use? (Como usar)  |  Overview (Visão geral)  |  About laravel  |  License

🧑‍🎓 Why?

API: Application programming interface.
To learn how to create a web API with Laravel, with the basic functionalities of a CRUD (store, show, update and delete an element) for different css properties and their particular examples.


API: Interface de programação de aplicações.
Para aprender a criar uma API web com Laravel, com as funcionalidades básicas de um CRUD (armazenar, mostrar, atualizar e deletar um elemento) para diferentes propriedades css e seus particulares exemplos.


🖥️ To use

Mysql version: 10.2.28 PHP version: 8.2.4 Apache version: 2.4.56


1. Clone and open this project

1.1 Clone this repository (Clone este repositório)
  git clone https://github.com/rapha-developer/laravel-backend-for-css-dictionary.git
1.2 Go to the project directory (Vá para o diretório do projeto)
 cd laravel-backend-for-css-dictionary

2. Install dependencies and start the server

2.1 Install dependencies with Composer
  composer install 
2.2 Run serve with this command:
  php artisan serve

📋 Overview

Overview

Root Endpoint

The (Laravel Backend for CSS Dictionary) API root endpoint have only welcome's response for user. Please refer to the table below for the appropriate endpoint.

"A (Laravel Backend for CSS Dictionary) API endpoint raiz possui apenas uma resposta de boas vindas para o usuário. Por favor, consulte a tabela abaixo para obter o endpoint apropriado."

Route name Method Endpoint
API Root GET /

Notes

Complete Endpoint
  GET {website}/
Demo onlive (demonstração ao vivo)
  https://rapha-developer-laravel.000webhostapp.com

👉 Ou click here


Authentication

Public Routes

All public requests to the API can be accessed by any user. Even without needing any authentication. (Please, refer to the table below for the proper link).

Todas as solicitações públicas para a API podem ser acessadas por qualquer usuário. Inclusive, sem precisar de qualquer autenticação. (Por favor, consulte a tabela abaixo para obter o endpoint apropriado).

Route name Visibility Method Endpoint Description
Register user public POST /register Creates a user in database and generate a token for access protected routes.
Login user public POST /login Make login with the credentials {email, password} created by registered user

Notes

Complete Endpoint
  POST {website}/register
Demo online (demonstração ao vivo)
  https://rapha-developer-laravel.000webhostapp.com/register

AND

Complete Endpoint
  POST {website}/login
Demo onlive (demonstração ao vivo)
  https://rapha-developer-laravel.000webhostapp.com/login

Protected Routes

All protected requests to the API need an API token. Generate a token using public routes from API. (Please, refer to the table below for the proper link).

Todas as solicitações protegidas para a API precisam de um token de API. Gere um token usando rotas públicas da API. (Por favor, consulte a tabela abaixo para obter o endpoint apropriado).

Properties routes
Route name Visibility Method Endpoint
Properties.index protected GET /properties
Properties.store protected POST /properties
Properties.show protected GET /properties/:id
Properties.update protected PATCH /properties/:id
Properties.delete protected DELETE /properties/:id
Samples routes
Route name Visibility Method Endpoint
Samples.index protected GET /samples
Samples.store protected POST /samples
Samples.show protected GET /samples/:id
Samples.update protected PATCH /samples/:id
Samples.delete protected DELETE /samples/:id

Notes

The bearer token is sent in the Authorization header.
  Authorization: Bearer 4|ViZeL2NUDQ3o9mbNCQPpGy7q0ZrHAjc2TNHEUcex 

👀 Not use this token above, it just example! 👀

For example, using Thunder Client (VS Code extension) it would be:
make-request-from-api.mp4

Content-Type: JSON

Our REST API only supports JSON content for requests with a body and for responses. For each request containing a body with JSON, you will need to attach the header options below:

Nossa API REST suporta apenas conteúdo JSON para solicitações com um corpo e para respostas. Para cada requisição contendo corpo com JSON, você precisará anexar as opções de cabeçalho abaixo:

Header Value
Accept application/json
Content-Type application/json

Notes

For example, using Thunder Client (VS Code extension) it would be:

Photo with Content-Type=application/json in thunder client


Errors

The (Laravel Backend for CSS Dictionary) API can return the following errors:

A (Laravel Backend for CSS Dictionary) API pode retornar os seguintes erros:

Status Code Description Solution
401 Unauthorized: User has no token or token is not more valid. See Authentication.
403 Forbidden: User not have authorization to make this request. See Authentication.
404 NOT FOUND.

Endpoint Reference

Register User

Register a new User

Body Parameters
Name Type Status
name string required
email email required
password string required
password_confirmation string required

Notes

  • If you use an email already registered, you will get 422 error.
  • If you have success, you will get 200 status code.
For example, using Thunder Client (VS Code extension) it would be:

Photo with response for register route

Login User

Login with the credentials of a registered user

Body Parameters
Name Type Status
email email required
password string required

Notes

  • if you enter the wrong email or password, you will get 401 error.
  • If you have success, you will get 200 status code.
For example, using Thunder Client (VS Code extension) it would be:

Photo with response for login route

All Properties

Select all properties stored by current user

Notes

  • if you enter with invalid token, you will get 401 error.
  • If you have success, you will get 200 status code.
For example, using Thunder Client (VS Code extension) it would be:

Photo with response for all properties route

Store Property

Store a new property

Body Parameters
Name Type Status
name string required
description string required
category string required

Notes

  • if you enter with invalid token, you will get 401 error.
  • If you have success, you will get 201 status code.
For example, using Thunder Client (VS Code extension) it would be:

Photo with response for store property route

Show Single Property

Show single property by id

URL Parameters
Name Type Status
id integer required

Notes

  • if you enter with invalid property id, you will get 404 error (Not found exception).
  • If you have success, you will get 200 status code.
For example, using Thunder Client (VS Code extension) it would be:

Photo with response for show single property route

Update Property

Update a property by id

URL Parameters
Name Type Status
id integer required
Body Parameters
Name Type Status
name string optional
description string optional
category string optional

Notes

  • if you enter with invalid property id, you will get 404 error (Not found exception).
  • if you enter with property id from another user, you will get 403 error.
  • If you have success, you will get 200 status code.
For example, using Thunder Client (VS Code extension) it would be:

Photo with response for update property route

Delete Property

Delete a property by id

URL Parameters
Name Type Status
id integer required

Notes

  • if you enter with invalid property id, you will get 404 error (Not found exception).
  • if you enter with property id from another user, you will get 403 error.
  • If you have success, you will get 200 status code.
For example, using Thunder Client (VS Code extension) it would be:

Photo with response for delete property route

All Samples

Select all samples stored by current user

Notes

  • if you enter with invalid token, you will get 401 error.
  • If you have success, you will get 200 status code.
For example, using Thunder Client (VS Code extension) it would be:

Photo with response for all samples route

Store Sample

Store a new Sample

Body Parameters
Name Type Status
property_id integer required
title string required
description string required
description_pt string required

Notes

  • if you enter with property id from another user, you will get 403 error.
  • If you have success, you will get 201 status code.
For example, using Thunder Client (VS Code extension) it would be:

Photo with response for store sample route

Show Single Sample

Show single sample by id

URL Parameters
Name Type Status
id integer required

Notes

  • if you enter with invalid sample id, you will get 404 error (Not found exception).
  • if you enter with id from another user, you will get 403 error.
  • If you have success, you will get 200 status code.
For example, using Thunder Client (VS Code extension) it would be:

Photo with response for show single sample route

Update Sample

Update a sample by id

URL Parameters
Name Type Status
id integer required
Body Parameters
Name Type Status
property_id integer optional
title string optional
description string optional
description_pt string optional

Notes

  • if you enter with invalid sample id, you will get 404 error (Not found exception).
  • if you enter with id from another user, you will get 403 error.
  • if you enter with property id from another user, you will get 403 error.
  • If you have success, you will get 200 status code.
For example, using Thunder Client (VS Code extension) it would be:

Photo with response for update sample route

Delete Sample

Delete a sample by id

URL Parameters
Name Type Status
id integer required

Notes

  • if you enter with invalid sample id, you will get 404 error (Not found exception).
  • if you enter with sample id from another user, you will get 403 error.
  • If you have success, you will get 200 status code.
For example, using Thunder Client (VS Code extension) it would be:

Photo with response for delete sample route

⚡ About Laravel

Laravel is a web application framework with expressive, elegant syntax. Laravel takes the pain out of development by easing common tasks used in many web projects.

Laravel é um framework de aplicações web com sintaxe expressiva e elegante. O Laravel facilita o desenvolvimento facilitando tarefas comuns usadas em muitos projetos da web.

📝 License

The Laravel framework is open-sourced software licensed under the MIT license.

About

Laravel Backend for CSS Dictionary. Under development (em desenvolvimento).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published