Skip to content

ims-laravel-api-starter is a streamlined backend API starter application built using the powerful Laravel framework.

Notifications You must be signed in to change notification settings

Innovix-Matrix-Systems/ims-laravel-api-starter

Repository files navigation

About this project

ims-laravel-api-starter is a streamlined backend API starter application built using the powerful Laravel framework.

Our primary focus is to provide you with a hassle-free and ready-to-use local development starter project. Unlike traditional API generators or code generators, this project aims to simplify the process of setting up your local development environment quickly and efficiently.

With ims-laravel-api-starter, you can jumpstart your Laravel-based API development without unnecessary complexities, allowing you to focus on building your application logic rather than spending time on initial setup.

Explore this project and experience the convenience of a ready-made local development environment for your Laravel-based APIs.

Features

  • Authentication using Laravel Sanctum: Implement secure authentication using Laravel Sanctum.

  • Extra Security with XSECURE: IMS introduces an additional layer of security, enhancing the API's reliability and resilience XSECURE Mode.

  • Role & Permission-Based Authorization: Utilize Laravel Permission for a flexible authorization system based on roles and permissions.

  • Multiple Language Support: Provide a multilingual experience with Laravel Lang to make your application accessible to a diverse user base.

  • Application and Database Backup System: Provide an application and database backup system with laravel-backup to make your application safe and ready for quick recovery.

Getting Started

  1. Choose Your Local Development Tool:

    Select your preferred local development tool, such as Laragon,Laravel Herd, XAMPP, WAMP, or any other tool that suits your needs.

    Version Requirments

    • Node 16+
    • PHP version 8.2+
    • MYSQL version 8.0+
  2. Configure Your Environment:

    Update your .env file with the correct database credentials.

    Copy .env.example to .env:

    Before proceeding, copy the .env.example file to .env to set up your environment variables:

    cp .env.example .env
  3. Install Dependencies:

    To install local development packages, including Husky and other Laravel-specific packages, run the following commands:

    npm install #for husky and other Laravel packages
    npx husky install #only once

    Run the following command to install the required dependencies using Composer:

    composer install
  4. Migrate and Seed the Database: Initialize and seed the database with default data using:

    php artisan migrate --seed

    Now, your project is ready for use. You can use the postman collection provided in the repo to start playing with the API. If you've run the seed command, log in with the provided credentials. Customize and expand your application as needed.

XSECURE MODE

Please visit this wiki page for XSECURE guide

WIKI

Please Visit the WIKI Page for XSECURE, Docker Guide, Extra Artisan commands and much more.

Extra Artisan Commands

Generate IDE Helper Files:

Generate general IDE helper files for improved code autocompletion and navigation by running:

php artisan ide-helper:generate

Generate IDE model helper files without writing to model files using:

#use any one of this two commands
php artisan ide-helper:models -N
php artisan ide-helper:models --nowrite

Run PHP CS Fixer

php artisan csfixer:run

This command ensures that your code adheres to the predefined coding standards, making your codebase clean and readable.

Create a Service

Creating services for your application is made effortless. Use the following command to generate a service:

php artisan make:service subfolder/ServiceName

Replace subfolder and ServiceName with the actual values you need. You can also create a service without a subfolder:

php artisan make:service TestService

The newly created service will be located at app/Http/Services/TestService.php, ready to handle your application's business logic.

Create a DTO

Creating DTO(Data Transfer Object) for your application is made effortless. Use the following command to generate a service:

php artisan make:dto UserDTO

The newly created DTO will be located at app/Http/DTOs/UserDTO.php, ready to Transfer your data across the application.

Create CRUD Starter

Generate all the necessary boilerplate files for a specific entity (such as model, controller, routes, resource, request, service, etc.) using the following command:

php artisan make:crud Test

This command will create all the required boilerplate files for the Test entity.

Leverage these Artisan commands to streamline your development process and maintain a well-structured codebase.

Authors

License

This project is brought to you by Innovix Matrix System and is released as open-source software under the MIT license.

Feel free to use, modify, and distribute this starter project in accordance with the MIT license terms. We encourage collaboration and welcome contributions from the community to make this project even better.