# Draydex RMS API

Welcome to the Laravel project! This repository contains a Laravel application that provide the Rate management system APIs.

## Getting Started

These instructions will help you get a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

Make sure you have the following software installed:

- PHP 8.1
- Composer 2.5
- PostgreSQL 15.2

### Installing

Follow these steps to install and set up the project:

1. Clone this repository: `git clone https://gitlab.com/draydex/draydex_app_be.git`
2. Navigate to the project directory: `cd draydex_app_be`
3. Install the dependencies: `composer install`
4. Copy the example environment file: `cp .env.example .env`
5. Generate the application key: `php artisan key:generate`
6. Configure the database connection in the `.env` file
7. Migrate the database: `php artisan migrate`
8. (Optional) Seed the database with sample data: `php artisan db:seed`
9. Generate JWT secret key: `php artisan jwt:secret`
10. Start the development server: `php artisan serve`

Now you should be able to access the application at `http://localhost:8000` in your browser.

### API Authentication with JWT

This Laravel project utilizes JSON Web Tokens (JWT) for API authentication. To use JWT for API authentication, follow these steps:

1. Install the `tymon/jwt-auth` package: `composer require tymon/jwt-auth`
2. Publish the JWT configuration file: `php artisan vendor:publish --provider="Tymon\JWTAuth\Providers\LaravelServiceProvider"`
3. Generate JWT secret key: `php artisan jwt:secret`
4. Configure the JWT settings in the `.env` file. Set the following variables: Adjust the `JWT_TTL` and `JWT_REFRESH_TTL` values according to your requirements.
5. Implement authentication endpoints and token generation logic in your API controllers. You can refer to the [official documentation of JWT-Auth](https://jwt-auth.readthedocs.io/) for detailed instructions and examples.

## Contributing

Contributions are welcome! If you'd like to contribute to this project, please follow these guidelines:

1. Fork the repository
2. Create a new branch: `git checkout -b feature/your-feature`
3. Make your changes and commit them: `git commit -am 'Add your feature'`
4. Push the branch: `git push origin feature/your-feature`
5. Submit a pull request

