This is a simple Task API project built with Laravel 10, MySQL, Pest, and utilizing the Service Repository Pattern. This project provides a RESTful API for managing tasks.
- PHP 8.1 or higher
- Composer
- MySQL
- Node.js (for Laravel Mix)
-
Clone the repository:
git clone https://github.com/andynur/rapid-task.git cd rapid-task
-
Install the dependencies:
composer install npm install
-
Copy the
.env.example
file to.env
and configure the database connection:cp .env.example .env
Update the database credentials in the
.env
file:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database DB_USERNAME=your_username DB_PASSWORD=your_password
-
Generate the application key:
php artisan key:generate
-
Run the database migrations:
php artisan migrate
-
(Optional) Seed the database:
php artisan db:seed
-
Serve the application:
php artisan serve
The application will be accessible at
http://localhost:8000
.
This project uses Pest for testing. To run the tests, use the following command:
./vendor/bin/pest
The project follows the Service Repository Pattern. Here's a brief overview of the structure:
- app/Http/Controllers: Contains the controllers for handling HTTP requests.
- app/Models: Contains the Eloquent models.
- app/Repositories: Contains the repository classes.
- app/Services: Contains the service classes.
- database/migrations: Contains the database migration files.
- tests: Contains the test cases.
Here are some of the main API endpoints:
GET /api/tasks
: Retrieve a list of tasks.GET /api/tasks/{id}
: Retrieve a specific task.POST /api/tasks
: Create a new task.PUT /api/tasks/{id}
: Update an existing task.DELETE /api/tasks/{id}
: Delete a task.
Contributions are welcome! Please submit a pull request or open an issue to discuss any changes.
This project is open-source and licensed under the MIT License.