This Task Management System is a web application built using Laravel and Blade templating, with interactivity provided by jQuery. The system allows users to create, update, delete, and manage tasks efficiently. The project utilizes Docker and Laravel Sail for easy setup and deployment.
This Task Management System is a web application built using Laravel and Blade templating, with interactivity provided by jQuery. The system allows users to create, update, delete, and manage tasks efficiently. The project utilizes Docker and Laravel Sail for easy setup and deployment.
jQuery is used to handle interactive features such as toggling task status without reloading the page.
The following jQuery script is used for handling AJAX requests for toggling task status:
$(document).ready(function() {
$('.toggle-status').click(function() {
var button = $(this);
var taskId = button.data('id');
var currentStatus = button.data('status');
$.ajax({
url: '/task/' + taskId + '/toggle-status',
method: 'PATCH',
data: {
_token: '{{ csrf_token() }}'
},
success: function(response) {
var newStatus = response.status;
button.data('status', newStatus);
if (newStatus === 'completed') {
button.text('Mark as Pending');
button.removeClass('px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full');
button.addClass('px-2 py-1 font-semibold leading-tight text-red-700 bg-red-100 rounded-full');
} else {
button.text('Mark as Completed');
button.removeClass('px-2 py-1 font-semibold leading-tight text-red-700 bg-red-100 rounded-full');
button.addClass('px-2 py-1 font-semibold leading-tight text-green-700 bg-green-100 rounded-full');
}
},
error: function(xhr) {
console.log('Error', xhr.responseText);
}
});
});
});
Clone the repository:
git clone https://github.com/DannJohnrem/task-management-system.git
cd task-management-system
Install dependencies:
composer install
npm install
Set up the environment:
Copy the example .env
file and configure it:
cp .env.example .env
Generate an application key:
php artisan key:generate
Configure your database settings in the .env
file.
Run the Docker containers using Laravel Sail:
./vendor/bin/sail up -d
Run database migrations:
./vendor/bin/sail artisan migrate
(Optional) Seed the database with initial data:
./vendor/bin/sail artisan db:seed
Run the development server:
./vendor/bin/sail artisan serve
Compile assets:
npm run dev
Now you can access the application at http://localhost.
You can run basic unit tests for the Task model and related functionalities using PHPUnit.
./vendor/bin/sail test