Saltar al contenido
← Volver a proyectos

Offerly Backend

This is the backend of the Offerly project, a marketplace application.

#Offerly Api

This is the backend of the Offerly project, a marketplace application. It was created to help people share their products or services in a more organized way.

#Requirements

if you use docker, you don't need to install any of the following requirements, but if you want to run the application locally, you need to install the following:

  • PHP 8.4
  • Composer
  • Node.js 22.x
  • NPM

#Installation

Offerly backend is a Laravel api application; it's build on top of Laravel 12 and uses a PostgreSQL database. If you are familiar with Laravel, you should feel right at home.

  1. Clone the repository:

    git clone https://github.com/aamimi/offerly-backend.git
    cd offerly-backend
    
  2. Run Sail to start the development server:

    ./vendor/bin/sail up -d
    
  3. Connect to the container:

    ./vendor/bin/sail shell
    
  4. Install PHP dependencies:

    composer install
    
  5. Install Node.js dependencies:

    npm install
    
  6. Copy the example environment file and generate an application key:

    cp .env.example .env
    php artisan key:generate
    
  7. Create the PostgreSQL database and run migrations:

    php artisan migrate
    

#Packages

#For Prod

## darkaonline/l5-swagger

L5 Swagger - OpenApi or Swagger Specification for Laravel project made easy.

## laravel-medialibrary

This package can associate all sorts of files with Eloquent models. It provides a simple API to work with.

#For dev:

## Sail

Laravel Sail is a light-weight command-line interface for interacting with Laravel's default Docker development environment.

## Pest

Pest is a testing framework with a focus on simplicity, meticulously designed to bring back the joy of testing in PHP.

## Larastan

Larastan focuses on finding errors in your code. It catches whole classes of bugs even before you write tests for the code.

## Laravel Pint

Laravel Pint is an opinionated PHP code style fixer for minimalists.

## Rector

Rector instantly upgrades and refactors the PHP code of your application.

## Telescope

Telescope provides insight into the requests coming into your application, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps, and more.

#API Documentation

The API documentation is available at /api/documentation route.

#Testing

To run all tests, use the following command:

    composer test

To run phpstan tests

    composer test:types

To run Pest tests

    composer test:unit

To run rector tests

    composer test:rector

To apply rector changes

    composer rector

To run lint tests

    composer test:lint

To fix code style

    composer lint

To run type coverage tests

    composer test:type-coverage

#License

This project is licensed under the GNU License. See the LICENSE file for details.

Nueva versión disponible.