This is a RESTful API for a Task Management System built using Laravel 11. It provides various functionalities such as task creation, updates, task dependencies, filtering tasks, and role-based access control (RBAC). The API uses Laravel Sanctum for stateless authentication and Spatie Laravel Permission package for role-based permissions.
This appliction features stateless authentication using Laravel Sanctum, RBAC using Spatie Laravel Permission package, API Versioning, API Resource classes, Resource Collection classes, Database Transactions, PHP Enums, Design Patterns (Repository pattern, Service pattern, etc.), Factories & Seeders, Form Request classes, Laravel Custom Validation Rules, Exception & Error Handling, Policy classes, Logging, clean Git branching and commit messages, Docker containerization, Unit Tests, and Task Filtering, Task Dependencies management. API endpoints tested using Postman.
Follow the steps below to set up and run the application locally.
-
Clone the repository:
git clone https://github.com/AhmedYahyaE/softxpert-task-management-rest-api.git cd softxpert-task-management-rest-api-main
-
Install dependencies:
composer install
-
Set up the environment file: Copy
.env.example
to.env
:cp .env.example .env
-
Generate the application key:
This step generates a unique application key for encryption:php artisan key:generate
-
Configure the database: Open the
.env
file and set your database credentials:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database_name DB_USERNAME=your_database_user DB_PASSWORD=your_database_password
-
Migrate the database: Run the migrations to create the necessary tables:
php artisan migrate
-
Seed the database:
php artisan db:seed
-
Install frontend dependencies:
npm install
-
Build Vite assets (for frontend):
npm run build
-
Start the Laravel development server:
php artisan serve
Now, your application should be running locally at http://localhost:8000
. To experiment with the application, login through the POST /api/v1/login endpoint using the two (different) role users:
- A 'manager' role user: Email: ahmed.yahya@email.com, Password: 123456
- A 'user' role user: Email: ayman.fathy@email.com, Password: 123456
Note : Make sure to include the "Accept: application/json" Header with all your requests.
Check my Postman Collection of the API on: https://www.postman.com/ahmed-yahya/my-public-portfolio-postman-workspace/collection/yb4gae4/softxpert-task-management-rest-api
Check the ERD of the database file, API Postman Collection files in Task Attachments directory.
N.B. Initial Docker containerization is implemented in Docker Containerization directory.