This is a starter project for a referral website built with Laravel 9, Vue.js 3, Vite, and Laravel Queue.
Before we get started, make sure that you have the following prerequisites installed on your local machine:
- PHP (minimum version: 8.1)
- Composer
- Docker (minimum version: 20.10)
- Git
To install this project, follow these steps:
- Clone the repository to your local machine:
git clone https://github.com/subhesadek/referral_site.git
- Navigate to the project directory:
cd referral_site
- Set up the environment variables by creating a copy of the
.env.example
file and renaming it to.env
:
cp .env.example .env
4: Install Laravel Sail:
composer require laravel/sail --dev
This command will download and install Laravel Sail and its dependencies in your project's vendor directory.
Or,
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/var/www/html" \
-w /var/www/html \
laravelsail/php82-composer:latest \
composer install --ignore-platform-reqs
Note: If you encounter any issues or have any questions, feel free to check out the official Laravel Documentation.
5: Set up Laravel Sail
php artisan sail:install
6: Start Laravel Sail
./vendor/bin/sail up
- Generate the application key:
sail artisan key:generate
9: Install & setup NPM
sail npm install && sail npm run dev
To install this project, follow these steps:
- Clone the repository to your local machine:
git clone https://github.com/subhesadek/referral_site.git
- Navigate to the project directory:
cd referral_site
- Install the project dependencies:
composer install && npm install
- Set up the environment variables by creating a copy of the
.env.example
file and renaming it to.env
:
cp .env.example .env
- Generate the application key:
php artisan key:generate
- Run the database migrations:
php artisan migrate
- Compile the frontend assets:
npm run dev
- Start the Laravel development server:
php artisan serve
- Start the Laravel Queue worker:
php artisan queue:table
php artisan migrate
php artisan queue:work
- Setup your SMTP email server:
You should now be able to access the application at http://localhost:8000.
This repository contains a set of unit tests for a PHP application
- To run the tests, simply execute the following command from the root directory of the repository:
php artisan test
For laravel sail
sail artisan test
or
./vendor/bin/phpunit
The application has a simple referral system that allows users to share a referral link with their friends. When someone signs up using the referral link, the referrer earns a reward.
To test the referral system, you can create a new user account and share your referral link with another user. When the other user signs up using the referral link, you should see a reward credited to your account.
This project is licensed under the MIT License. See the LICENSE file for more information.