Skip to content

API-related repo that is used for student data management systems, starting from student data APIs, study programs, admin authentication using Laravel JWT

Notifications You must be signed in to change notification settings

gustonecrush/api-student-data-management-system

Repository files navigation

DOCUMENTATION

PROFILE

  • Name : A Farhan Agustiansyah
  • University : Sriwijaya University, South Sumatera

START PROJECT

  • Download this project or clone this repo and save to your local
  • Run composer install to install all dependencies needed
  • Open your computer server to run your server, then create new database on your database
  • Configure your .env file, go to database section, and configure the database according to the database you are using, the user, and the password you are using as below. If you don't make database yet, so make new database in your server. Then configure in .env file.
        DB_CONNECTION=mysql
        DB_HOST=your_host
        DB_PORT=your_port
        DB_DATABASE=your_db_name
        DB_USERNAME=your_username
        DB_PASSWORD=your_password
    
  • Run command php artisan jwt:secret to generate JWT key for authentication,
        JWT_SECRET=xxxx
    
    so your jwt secret is generated in .env file
  • After that, you can run command php artisan migrate to generate all table migrations which is exist in this project
  • Then, you can run command php artisan db:seed to seed your database with default data
  • Then, you can run command php artisan serve to start your laravel server and try the endpoint has been build

AUTH ENDPOINT

Register

Request :

  • Method : POST
  • Endpoint : /api/register
  • Header :
    • Accept: application/json
  • Body :
{
    "name": "string",
    "email": "string, email",
    "password": "string",
    "password_confirmation": "string"
}

Response :

{
  "message": "string"
}

Login

Request :

  • Method : POST
  • Endpoint : /api/login
  • Header :
    • Accept: application/json
  • Body :
{
    "email": "string, email",
    "password": "string",
}

Response :

{
  "access_token": "string",
  "token_type": "string",
  "expires_in": "integer",
}

Logout

Request :

  • Method : POST
  • Endpoint : /api/logout
  • Header :
    • Accept: application/json
  • Query Param :
    • token: "string"

Response :

{
  "message": "string"
}

Me

Request :

  • Method : POST
  • Endpoint : /api/register
  • Header :
    • Accept: application/json
    • Autohorization: Bearer token

Response :

{
  "id": "integer",
  "name": "string",
  "email": "string",
  "email_verified_at": "string",
  "created_at": "string",
  "updated_at": "string"
}

API ENDPOINT

Get Mahasiswa

Request :

  • Method : GET
  • Endpoint : /api/mahasiswa
  • Header :
    • Accept: application/json
    • Autohorization: Bearer token

Response :

{
  "status": "boolean",
  "status_code": "integer",
  "message": "string",
  "data": [
    {
      "nama": "string",
      "email": "string, email",
      "NIM": "string, unique",
      "jenis_kelamin": "string",
      "semester": "integer",
      "angkatan": "year",
      "fakultas": [
        {   
            "id": "integer",
            "fakultas": "string",
        },
      ],
      "prodi": [
        {   
            "id": "integer",
            "program_studi": "string",
        },
      ],
      "created_at": "string",
      "updated_at": "string",
    },
    ...
  ]
}

Detail Mahasiswa

Request :

  • Method : GET
  • Endpoint : /api/mahasiswa/{nim}
  • Header :
    • Accept: application/json
    • Autohorization: Bearer token

Response :

{
  "status": "boolean",
  "status_code": "integer",
  "message": "string",
  "data": [
    {
      "nama": "string",
      "email": "string, email",
      "NIM": "string, unique",
      "jenis_kelamin": "string",
      "semester": "integer",
      "angkatan": "year",
      "fakultas": [
        {   
            "id": "integer",
            "fakultas": "string",
        },
      ],
      "prodi": [
        {   
            "id": "integer",
            "program_studi": "string",
        },
      ],
      "created_at": "string",
      "updated_at": "string",
    },
  ]
}

Post Mahasiswa

Request :

  • Method : POST
  • Endpoint : /api/mahasiswa
  • Header :
    • Accept: application/json
    • Autohorization: Bearer token
  • Body :
{
    "nama": "string",
    "email": "string, email",
    "NIM": "string, unique",
    "jenis_kelamin": "string",
    "semester": "integer",
    "angkatan": "year",
}

Response :

{
  "status": "boolean",
  "status_code": "integer",
  "message": "string",
  "data": {
     "nama": "string",
     "email": "string, email",
     "NIM": "string, unique",
     "jenis_kelamin": "string",
     "semester": "integer",
     "angkatan": "year",
     "fakultas": [
       {   
           "id": "integer",
           "fakultas": "string",
       },
     ],
     "prodi": [
       {   
           "id": "integer",
           "program_studi": "string",
       },
     ],
     "created_at": "string",
     "updated_at": "string",
   },
}

Update Mahasiswa

Request :

  • Method : POST
  • Endpoint : /api/mahasiswa/{nim}
  • Header :
    • Accept: application/json
    • Autohorization: Bearer token
  • Body :
{
    "nama": "string",
    "email": "string, email",
    "NIM": "string, unique",
    "jenis_kelamin": "string",
    "semester": "integer",
    "angkatan": "year",
}

Response :

{
  "status": "boolean",
  "status_code": "integer",
  "message": "string",
  "data": {
     "nama": "string",
     "email": "string, email",
     "NIM": "string, unique",
     "jenis_kelamin": "string",
     "semester": "integer",
     "angkatan": "year",
     "fakultas": [
       {   
           "id": "integer",
           "fakultas": "string",
       },
     ],
     "prodi": [
       {   
           "id": "integer",
           "program_studi": "string",
       },
     ],
     "created_at": "string",
     "updated_at": "string",
   },
}

Delete Mahasiswa

Request :

  • Method : DELETE
  • Endpoint : /api/mahasiswa/{nim}
  • Header :
    • Accept: application/json
    • Autohorization: Bearer token
    • Content-Type: application/json

Response :

{
  "status": "boolean",
  "status_code": "integer",
  "message": "string",
  "data": []
}

Get Prodi

Request :

  • Method : GET
  • Endpoint : /api/prodi
  • Header :
    • Accept: application/json
    • Autohorization: Bearer token

Response :

{
  "status": "boolean",
  "status_code": "integer",
  "message": "string",
  "data": [
    {
      "id": "integer",
      "program_studi": "string",
    },
    ...
  ]
}

Post Prodi

Request :

  • Method : POST
  • Endpoint : /api/prodi
  • Header :
    • Accept: application/json
    • Autohorization: Bearer token
  • Body :
{
    "program_studi": "string",
    "fakultas_id": "integer",
}

Response :

{
  "status": "boolean",
  "status_code": "integer",
  "message": "string",
  "data": {
        "id": "integer",
        "program_studi": "string",
   },
}

Get Fakultas

Request :

  • Method : GET
  • Endpoint : /api/fakultas
  • Header :
    • Accept: application/json
    • Autohorization: Bearer token

Response :

{
  "status": "boolean",
  "status_code": "integer",
  "message": "string",
  "data": [
    {
      "id": "integer",
      "fakultas": "string",
      "program_studi": [
        {
           "id": "integer",
           "program_studi": "string",
        },
        ...
      ],
    },
    ...
  ]
}

Post Fakultas

Request :

  • Method : POST
  • Endpoint : /api/fakultas
  • Header :
    • Accept: application/json
    • Autohorization: Bearer token
  • Body :
{
    "fakultas": "string",
}

Response :

{
  "status": "boolean",
  "status_code": "integer",
  "message": "string",
  "data": {
      "id": "integer",
      "fakultas": "string",
      "program_studi": [
        {
           "id": "integer",
           "program_studi": "string",
        },
        ...
      ],
  }
}

About

API-related repo that is used for student data management systems, starting from student data APIs, study programs, admin authentication using Laravel JWT

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages