Skip to content

ramadhanabelio/aipel-api

Repository files navigation

AIPEL API

📙 Description

AIPEL API is a RESTful API that allows users to manage customer data on PT. Central Digital Network. This API also supports user authentication using email or username through Laravel Sanctum.

API Endpoints

Below is the table of available API endpoints:

Method Endpoint Description
POST /login Authenticate user via email or username
POST /logout Logout current authenticated user
GET /customers Retrieve all customer data
POST /customers Create a new customer data
GET /customers/{id} Retrieve details of a specific data
PUT /customers/{id} Update a specific customer data
DELETE /customers/{id} Delete a specific customer data

📖 Features

  1. Login using email or username.
  2. Manage customer data (CRUD operations).
  3. Authentication is only required for login/logout.

Project Resources

  1. PHP
  2. Laravel Framework
  3. Sanctum for API Authentication

🛠️ Project Installation Guide

Here are the steps to install and run the project:

Prerequisites

  • PHP >= 8.1
  • Composer
  • MySQL or any supported database

Steps

1. Clone the repository into a local directory:

git clone https://github.com/ramadhanabelio/aipel-api.git

2. Navigate to the project directory:

cd aipel-api

3. Install Laravel dependencies using Composer:

composer install

4. Copy and configure the environment variables:

cp .env.example .env
php artisan key:generate

5. Configure your database credentials in .env, then run:

php artisan migrate

6. Serve the application:

php artisan serve

The server should now be running at http://localhost:8000.

Authentication Usage

Login:

POST /login
Body: {
    "login": "admincdn",
    "password": "magangcdn25"
}

Logout:

POST /logout
Header: Authorization: Bearer {your_token}

About

AIPEL, Aplikasi Informasi Pelanggan (PT. Central Digital Network)

Topics

Resources

Stars

Watchers

Forks