Salvo Agency Technical Test | Live Demo

Introduction

This is a technical test for Salvo Agency. The test is to create a simple web application that implements multi-tenancy level of authorization. The application is a simple CRUD application that allows users to create, read, update and delete a list of post. The application is built using the Laravel with Breeze scaffolding. The application is deployed on Heroku and can be accessed at Heroku.

Demo Account

The application has a demo account that can be used to test the application.

Email Role Password
support@demo.com Support password
developer@demo.com Developer password
superadmin@demo.com Super Admin password

Permission Graph

graph TD
  subgraph Permissions
    create_post[Create Post]
    edit_post[Edit Post]
    delete_post[Delete Post]
    view_post[View Post]
  end

  subgraph Roles
    developer[Developer]
    support[Support]
    super_admin[Super Admin]
  end

  subgraph Users
    developer -- Has Permission --> create_post
    developer -- Has Permission --> view_post
    developer -- Has Permission --> edit_post
    support -- Has Permission --> view_post
    super_admin -- Has Permission --> create_post
    super_admin -- Has Permission --> edit_post
    super_admin -- Has Permission --> delete_post
    super_admin -- Has Permission --> view_post
  end

Installation

Install using Local Environment

  1. Clone the repository
git clone https://github.com/hendurhance/salvo-crud.git
  1. Go to the project directory
cd salvo-crud
  1. Install the dependencies Run the script below to install the dependencies
scripts/dependencies.sh
  1. Create a copy of the .env.example file and rename it to .env
cp .env.example .env
  1. Generate the application key
php artisan key:generate
  1. Setup the database
    • Create a new database
    • Update the database credentials in the .env file
  2. Run the database migration
php artisan migrate
  1. Run the database seeder
php artisan db:seed
  1. Run the application
php artisan serve

Install using Docker

  1. Clone the repository
git clone https://github.com/hendurhance/salvo-crud.git
  1. Go to the project directory
cd salvo-crud
  1. Create a copy of the .env.example file and rename it to .env
cp .env.example .env
  1. Build the docker image
docker-compose up -d
  1. Run the container
docker exec -it salvo-app-1 bash

Make sure you are inside the container before running the next commands.

cd /var/www/html
  1. Install the dependencies
scripts/dependencies.sh

If you are getting an error, run the command below to fix the permission.

chmod +x scripts/dependencies.sh
  1. Run the database migration
php artisan migrate
  1. Run the database seeder
php artisan db:seed
  1. Run the test
php artisan test

Technologies

The application is built using the following technologies:

  • Laravel 10.10
  • Laravel Breeze 1.23
  • Spatie Laravel Permissions 5.11
  • Heroku
  • MySQL
  • Docker
  • Docker Compose
  • PHP 8.1
  • Composer
  • NPM
  • Tailwind CSS
  • Alpine JS

Features

The application has the following features:

  • Multi-tenancy level of authorization
  • CRUD Post
  • User Management
  • User Profile

Testing

The application has the following tests:

  • Unit Test
  • Feature Test A complete list of 40 tests assertion can be found in the tests directory.