A simple task management application built with Laravel, Inertia.js, React, and TypeScript. This application allows users to create, view, and mark tasks as completed through a beautiful user interface.
- PHP 8.1 or higher
- Composer
- Node.js 16 or higher
- NPM or Yarn
- MySQL, PostgreSQL, or SQLite
- Clone the repository:
git clone https://github.com/luis0antonio55/to-do-list.git
cd to-do-list- Install PHP dependencies:
composer install- Install JavaScript dependencies:
npm install- Copy the environment file:
cp .env.example .env- Generate application key:
php artisan key:generate- Configure your database in the
.envfile:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_database_username
DB_PASSWORD=your_database_password
You can also use SQLite by setting:
DB_CONNECTION=sqlite
And creating an empty file:
touch database/database.sqlite- Run migrations to create necessary tables:
php artisan migrate- Seed the database with sample data:
php artisan db:seedOr specifically seed the tasks:
php artisan db:seed --class=TaskSeeder- Start the Laravel development server:
php artisan serve- In another terminal, compile and watch the frontend assets:
npm run dev- Access the application in your browser:
http://localhost:8000
- Login with the test user:
- Email:
[email protected] - Password:
password
- Email:
If the default user doesn't work, create a new user:
php artisan tinker\App\Models\User::create([
'name' => 'Test User',
'email' => '[email protected]',
'password' => bcrypt('password')
]);- Navigate to the tasks page:
http://localhost:8000/tasks
The application provides the following RESTful API endpoints:
-
List all tasks
- URL:
/api/tasks - Method: GET
- Response: JSON array of task objects
- URL:
-
Create a new task
- URL:
/api/tasks - Method: POST
- Headers:
Content-Type: application/jsonX-CSRF-TOKEN: [token]
- Body:
{ "title": "Task title", "description": "Task description", "due_date": "YYYY-MM-DD HH:MM:SS" } - Response: JSON object of the created task
- URL:
-
Mark a task as completed
- URL:
/api/tasks/{id} - Method: PUT
- Headers:
Content-Type: application/jsonX-CSRF-TOKEN: [token]
- Response: JSON object of the updated task
- URL: