This is a CRUD project regarding messages with e-mail notifications, created with Laravel, Vue.js and Bootstrap.
It's required to have git, composer and npm installed to follow these steps:
- Clone this repository with
git clone https://github.com/Romanti-Ezer/MyMessage.git
- Enter in the folder of the project
cd MyMessage
- Install dependencies and generate build
- Install composer dependencies with
composer install
- Install npm dependencias and generate build with
npm install && npm run dev
- Install composer dependencies with
- Create a database
- You can give any name you want
- Database collation can be
latin1_swedish_ci
- Configure
.env
file- Copy the
.env.example
and rename to.env
- In this file configure the database connection
- Configure SMTP to send notifications. I recommend mailtrap for testing without problems
- Copy the
- Generate an application key running
php artisan key:generate
- Migrate database
- Run
php artisan migrate
to create the tables in the database
- Run
- Configure task manager to run Laravel Schedule
- If using crontab, you can execute
0 0 * * * /path/to/project/artisan schedule:run >/dev/null 2>&1
to run Laravel Schedule every day - if you want to test this task in the moment, change App/Console/Kernel.php to
everyMinute()
in line 30, and runphp artisan schedule:run
to execute the task and verify the messages - To send a message, don't forget to create a message with valid start and expiration dates
- The task outputs some lines to
storage/logs/send_message_output.log
- If using crontab, you can execute
- Run tests
- Run
vendor/bin/phpunit
to execute all tests - Run
vendor/bin/phpunit --filter name_of_test
to execute a single test
- Run
- Configure virtual host if necessary
- Here I have a configuration that can help.
<VirtualHost mymessage.backoffice:80> ServerAdmin [email protected] DocumentRoot "E:/Projetos/mymessage/public" <Directory "E:/Projetos/mymessage/public"> Options All AllowOverride All Order Allow,Deny Allow from all Require all granted </Directory> ServerName mymessage.backoffice ServerAlias mymessage.backoffice ErrorLog "logs/mymessage.backoffice.log" </VirtualHost>
- If you create a virtual host, don't forget to change the APP_URL in the
.env
file
- Access the app url and create an account to use the system