This is a demo application built with Laravel (API) and Vue.js, showcasing a basic scheduler for future data changes. The main feature allows users to schedule updates—such as changing an employee's address—that will automatically take effect on a specified future date.
The system uses the Laravel Scheduler with a cron job running every 5 minutes to check and apply scheduled changes. The project is containerized using Docker and uses MySQL for data storage.
- Docker and Docker Compose
- Git
- MySQL Server
- Clone the repository:
git clone https://github.com/sudan94/employee-scheduler-laravel-vue.git
cd employee-scheduler-laravel-vue
- Create Laravel environment file:
Copy .env.example
to .env
in the backend directory:
cp backend/.env.example backend/.env
NOTE: The database connection settings in
.env
should match your MySQL server configuration. If you have MySQL already running locally, update the credentials for (DB_USERNAME and DB_PASSWORD) accordingly.
# Database Configuration
DB_CONNECTION=mysql
DB_HOST=laravel-vue-db
DB_PORT=3306
DB_DATABASE=hrpuls_test
DB_USERNAME=root
DB_PASSWORD=
- Build and start the containers:
cd employee-scheduler-laravel-vue
docker-compose up -d --build
- Run the migration
docker-compose exec server php artisan migrate
NOTE: If the database 'hrpuls_test' does not exist, you will be prompted with: "The database 'hrpuls_test' does not exist on the 'mysql' connection. Would you like to create it?". You can either enter 'yes' to create it automatically or create it manually in MySQL.
- Run the Database seeder
docker-compose exec server php artisan db:seed --class=EmployeeSeeder
- Access the frontend application:
- Frontend:
http://localhost:3000
- Access the backend API:
- Backend API:
http://localhost:8000
The application includes scheduled tasks that run daily. These are managed by the Laravel scheduler and Docker cron jobs.
docker-compose exec server php artisan schedule:run