Categorygithub.com/Revprm/go-fp-pbkk
modulepackage
0.0.0-20241212125439-0d7ea6f4bb0e
Repository: https://github.com/revprm/go-fp-pbkk.git
Documentation: pkg.go.dev

# README

FP PBKK Golang

This repository contains the final project for the Framework-Based Programming course, developed using the Go programming language.

Authors

NRPNama
5025221002Iftala Zahri Sukmana
5025221252Revy Pramana

API Documentation

https://documenter.getpostman.com/view/32470266/2sAYBYeV5b

Quick Start

To set up and run the project locally, follow these steps:

  1. Clone the Repository:

    git clone https://github.com/Revprm/go-fp-pbkk.git
    
  2. Navigate to the Project Directory:

    cd go-fp-pbkk
    
  3. Copy the Example Environment File:

    cp .env.example .env
    
  4. Install Dependencies:

    Ensure you have Go installed. Then, run:

    go mod tidy
    
  5. Run Database Migrations:

    go run main.go --migrate
    
  6. Start the Application:

    go run main.go
    

The application should now be running on http://localhost:8080.

Program Flow

The application follows a clean architecture pattern, ensuring separation of concerns and maintainability.

request > router > controller > service > repository > service > controller > router > response

Commands

  • Run the Application:

    go run main.go
    
  • Run Database Migrations:

    go run main.go --migrate
    
  • Run Tests:

    go run main.go --test
    

Directory Structure

The project is organized as follows:

go-fp-pbkk/
├── command/            # CLI commands
├── config/             # Configuration files
├── constants/          # Constant values used across the application
├── controller/         # HTTP request handlers (controller layer)
├── dto/                # Data Transfer Objects
├── entity/             # Database entities (data layer)
├── helpers/            # Utility functions
├── middleware/         # HTTP middleware
├── migrations/         # Database migration files
├── repository/         # Data access layer
├── routes/             # API route definitions
├── script/             # Auxiliary scripts
├── service/            # Business logic layer (service layer)
├── tests/              # Test cases
├── utils/              # Utility functions
└── main.go             # Entry point of the application

Response Format

{
  "status": true | false,
  "message": string,
  "error": null | "Error description (for failures)",
  "data": null | "Payload of the response (optional)",
  "meta": null | "Pagination metadata (optional)"
}

Response Structure:

  1. Success
  2. Error
  3. Pagination

Success

{
    "status": true,
    "message": string,
    "data": [] or {} (optional)
}

Error

{
  "status": false,
  "message": string,
  "error": string,
  "data": null
}

Pagination

{
  "status": true,
  "success": string,
  "data": PaginationData{}
}

PaginationData

{
  "page": number,
  "per_page": number,
  "max_page": number,
  "count": number
}

Youtube Link

Youtube

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author