- Install Docker Desktop (https://www.docker.com/products/docker-desktop/) if not installed
- Open Docker
- Add the following to your .bashrc or zshrc file to create an alias for sail:
alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)'
- From the project folder, run
sail up -d
- Run
sail cp .env.example .env
- Run
sail composer install
- Run
sail npm install
- Run
sail php artisan migrate
to migrate the database - Run
sail php artisan db:seed
to seed the database with test data - Run
sail php artisan scout:import \App\Models\Contact
to import contacts into the search database - Run
sail npm run build
- Add to
/etc/hosts
file the following entry:127.0.0.1 phonebook.test
- Access the app at
phonebook.test
- Register for an account and get access to the app
- Run
sail npm run dev
to start build with hot-module reloading via Vite
- Run
sail cp .env.example.testing .env.testing
- Run
sail phpunit
- Search is via Meilisearch set up on Sail. Go to http://localhost:7700/ to access search panel.
- Laravel for backend
- Laravel Breeze with Inertia + Vue.js as minimal starter kit to scaffold authentication, registration, components. I chose Breeze because I wanted to spend more time building the frontend than building API endpoints with associated overhead(error handling, json serialization, transformers, pagination, authentication, calling API from frontend). However, would build a full-featured REST or GraphQL API for a more complex application, especially enterprise software.
- Vue 3 for frontend, data is passed from server to client via Inertia.
- Tests with PHPunit - only feature tests that test for right HTTP status code right now. Would build out more robust test suite over time.
- Meilisearch for fast, full-text search of contacts. Try searching with small typos to see matches.
- Tailwind CSS via Laravel Breeze for CSS styling,