Skip to content

codewizard0803/laravel-vue-real-estate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real estate backendb

Develop a simple real estate application with Laravel and Vue.js.

The task is separated into two subtasks.

  • The first task is to create the admin panel where the user can filter and add a new real estate item. The app should be implemented with Vue.js on the frontend and Laravel on the backend. Points:
    • Listing the real estate entries (2 points)
    • Showing details of a real estate entry (2 points)
    • Filtering the real estate entries based on criteria (2 points)
    • Adding a new real estate entry that uses an API endpoint – see below (2 points)
    • Bonus task: Add validation to the form for adding new real estate entries (2 points)
  • The second task is to create an API backend which we will expose all the real estate data to other applications. We need these endpoints:
    • listing real estate entries with possibility to filter based on criteria – like in the UI (2 points)
    • listing countries (2 points)
    • listing developers (2 points)
    • adding a real esate entry (2 points)
    • retrieving details of a real estate entry (2 points)
  • Please make an example cURL request or export a Postman/Insomnia collection so we're able to test the API
  • Bonus task: write an integration test for a single API endpoint (2 points)

In total you can receive 22 points for completing this task.

See the running application we expect you to build here: https://youtu.be/wEdtx1H284U

It's critical that you provide clear instructions on running the code, so we can test it. If that's at all different from the instructions below

Requirements

Installing docker

Instalation for mac

Instalation for windows

Database schema

alt text

Running docker container

The default database configuration for running locally is already configured, so just run:

docker-compose up

After running the docker compose setup you should run the commands below to set up the project.

Installing Composer packages

docker-compose exec app composer install

Generating key and optimizing app

# needed for generating application app key 
docker-compose exec app php artisan key:generate
docker-compose exec app php artisan optimize

Running laravel and nodejs commands in docker

docker-compose exec app php artisan migrate
docker-compose exec app npm install

Set correct permisions if api router is not working

 docker-compose exec app chmod -R 777 storage

Seeding initial data

docker-compose exec app php artisan db:seed

Use

Auth

login: [email protected]
password: secret

Tests

touch database/test.sqlite
docker-compose exec app vendor/bin/phpunit

Postman endpoint collection

Is in repo https---github.com-jedrzejczak-laravel-vue-real-estate.postman_collection.json

What can be done better / should be done?

  • there should be unit tests for ListSearch (now ListIndexTest tests it)
  • adding new List item should be realized via some service
  • some data are unnecessarily exposed via api
  • code formatting (eslint, prettier)
  • clear form after adding item
  • clear filters after adding item
  • error handling
  • validation (api returns validation messages, but frontend does nothing with it)
  • remove unused files created by laravel
  • frontend tests
  • loaders / spinners

What I did to make the initial code executable?

Before running migrations make a change in app/Providers/AppServiceProvider.php

public function boot()
{
    \Schema::defaultStringLength(191);
}

or update MySQL to at least v5.7.7

source: https://laravel-news.com/laravel-5-4-key-too-long-error

Tests

@maksymilian-majer removes some Laravel test classes, so I added them from https://github.com/laravel/laravel/tree/5.4/tests

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published