A full-stack task management application built with Laravel (backend) and React (frontend). This application allows users to register, authenticate, and manage their personal tasks with features like creating, editing, deleting, and filtering tasks.
- User registration and login
- JWT-based authentication
- Protected routes and API endpoints
- User profile management
- Secure logout functionality
- Create, read, update, and delete tasks (CRUD operations)
- Task status management (pending/completed)
- Bulk delete functionality
- Search tasks by title
- Filter tasks by status
- Sort tasks by creation date
- Pagination support
- Real-time task statistics dashboard
- Responsive design with Tailwind CSS
- Modern React components with hooks
- Toast notifications for user feedback
- Loading states and error handling
- Clean and intuitive dashboard layout
- Framework: Laravel 12.0
- Language: PHP 8.2+
- Authentication: JWT (tymon/jwt-auth)
- Database: MySQL (configurable)
- API: RESTful API with Laravel's built-in routing
- Validation: Laravel Form Requests
- Testing: PHPUnit
- Framework: React 19.2.5
- State Management: Redux Toolkit
- Routing: React Router DOM 7.14.2
- Styling: Tailwind CSS 3.4.19
- HTTP Client: Axios 1.15.2
- Icons: Heroicons React 2.2.0
- Notifications: React Hot Toast 2.6.0
- Testing: Jest and React Testing Library
- Package Manager: Composer (PHP), npm (JavaScript)
- Build Tool: Create React App
- Code Quality: ESLint, Pint (PHP)
Before running this application, ensure you have the following installed:
- PHP 8.2 or higher
- Composer (PHP package manager)
- Node.js 16+ and npm (or yarn)
- MySQL database server (or any supported database)
- Git for version control
git clone <repository-url>
cd Task-ManagerNavigate to the backend directory:
cd task-manager-backendInstall PHP dependencies:
composer installCreate environment file:
cp .env.example .envGenerate application key:
php artisan key:generateConfigure your database in the .env file:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=task_manager_backend
DB_USERNAME=your_database_username
DB_PASSWORD=your_database_passwordRun database migrations:
php artisan migrate(Optional) Seed the database with sample data:
php artisan db:seedThis will create a test user with the following credentials:
- Email:
jonedeo@example.com - Password:
123456
The seeder also creates 25 sample tasks for testing purposes.
Start the Laravel development server:
php artisan serveThe backend API will be available at http://localhost:8000
Navigate to the frontend directory (in a new terminal):
cd task_manager_frontendInstall Node.js dependencies:
npm installConfigure the API base URL in the .env file:
REACT_APP_API_BASE_URL=http://localhost:8000/apiStart the React development server:
npm startThe frontend application will be available at http://localhost:3000
Task-Manager/
βββ task-manager-backend/ # Laravel Backend
β βββ app/
β β βββ Http/
β β β βββ Controllers/ # API Controllers
β β β βββ Requests/ # Form Request Validation
β β β βββ Providers/ # Service Providers
β β βββ Models/ # Eloquent Models
β β βββ Providers/ # Additional Providers
β βββ bootstrap/ # Bootstrap Files
β βββ config/ # Configuration Files
β βββ database/
β β βββ factories/ # Model Factories
β β βββ migrations/ # Database Migrations
β β βββ seeders/ # Database Seeders
β βββ routes/ # API Routes
β βββ .env.example # Environment Template
β βββ composer.json # PHP Dependencies
β
βββ task_manager_frontend/ # React Frontend
β βββ public/ # Static Assets
β βββ src/
β β βββ components/
β β β βββ auth/ # Authentication Components
β β β βββ common/ # Shared Components
β β β βββ dashboard/ # Dashboard Component
β β β βββ tasks/ # Task Components
β β βββ context/ # React Context
β β βββ pages/ # Page Components
β β βββ services/ # API Services
β β βββ store/ # Redux Store
β β β βββ slices/ # Redux Slices
β β βββ utils/ # Utility Functions
β β βββ App.js # Main App Component
β β βββ index.js # Entry Point
β βββ .env # Environment Variables
β βββ package.json # Node Dependencies
β
βββ README.md # This File
POST /api/auth/login- User loginPOST /api/auth/register- User registrationPOST /api/auth/logout- User logout (requires authentication)POST /api/auth/refresh- Refresh JWT token (requires authentication)GET /api/auth/my-account- Get user profile (requires authentication)
GET /api/tasks- Get user's tasks (with pagination, filtering, and search)POST /api/tasks- Create new task (requires authentication)GET /api/tasks/{id}- Get specific task (requires authentication)PUT /api/tasks/{id}- Update task (requires authentication)DELETE /api/tasks/{id}- Delete task (requires authentication)POST /api/tasks/update-status/{id}- Toggle task status (requires authentication)DELETE /api/tasks/bulk-delete- Bulk delete tasks (requires authentication)
search- Search tasks by titlefilter- Filter by status (pending/completed)sort- Sort by creation date (asc/desc)limit- Number of tasks per pagepage- Page number for pagination
- Visit
http://localhost:3000 - Click on "Register" to create a new account
- After registration, you'll be automatically logged in
- Use your credentials to login on subsequent visits
- Create Task: Click the "Create Task" button on the dashboard
- Edit Task: Click the edit icon on any task card
- Delete Task: Click the delete icon on any task card
- Toggle Status: Click the checkbox to mark tasks as complete/incomplete
- Search: Use the search bar to find tasks by title
- Filter: Use the filter dropdown to show pending/completed tasks
- Bulk Delete: Select multiple tasks and use the bulk delete option
Run PHPUnit tests from the backend directory:
cd task-manager-backend
php artisan testRun React tests from the frontend directory:
cd task_manager_frontend
npm test- JWT-based authentication with token expiration
- Password hashing using Laravel's built-in security
- Protected API routes with middleware
- Input validation and sanitization
- CORS configuration for API security
- SQL injection prevention through Eloquent ORM
- Set up a production server with PHP 8.2+ and required extensions
- Configure your production database
- Set environment variables for production
- Run
composer install --optimize-autoloader --no-dev - Run
php artisan config:cache - Run
php artisan route:cache - Run
php artisan migrate --force
- Build the production version:
npm run build - Deploy the
buildfolder to your web server - Configure your web server to serve the React app
- Update the API base URL in production environment
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- CORS Errors: Make sure the backend CORS configuration allows requests from your frontend URL
- JWT Token Issues: Clear browser storage and re-authenticate
- Database Connection: Verify your database credentials in
.envfile - Port Conflicts: Change the default ports if 8000 or 3000 are already in use
- Use
php artisan tinkerfor debugging database queries - Check Laravel logs in
storage/logs/laravel.logfor backend errors - Use browser developer tools for frontend debugging
- Run
php artisan migrate:fresh --seedto reset database with seed data
If you encounter any issues or have questions, please:
- Check the troubleshooting section above
- Review the code comments and documentation
- Create an issue in the repository with detailed information
Happy Task Managing! π