Categorygithub.com/dhimweray222/test-BE-uninet
repositorypackage
0.0.0-20231217141552-3491f897a985
Repository: https://github.com/dhimweray222/test-be-uninet.git
Documentation: pkg.go.dev

# 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

# README

Attendance Apps

Prerequisites

  • Go installed on your machine.

Getting Started

  1. Clone the repository:

    git clone https://github.com/dhimweray222/Test-BE-UNINET.git
    cd Test-BE-UNINET
    
  2. Install dependencies:

    go mod download
    
  3. Change Config in .env file

    # Server Settings:
    SERVER_URI=localhost
    SERVER_PORT=8080
    DEFAULT_LIMIT=10
    
    # Database Setting
    DB_HOST=host
    DB_PORT=port
    DB_NAME=db_name
    DB_USERNAME=postgres
    DB_PASSWORD=db_password
    DB_POOL_MIN=10
    DB_POOL_MAX=100
    DB_TIMEOUT=10
    DB_MAX_IDLE_TIME_SECOND=60
    
    # jwt
    SECRET_KEY=AaBbCcJKLMadhanirAAnNoOPqrstu23VWXYZ
    SECRET_KEY_REFRESH=AaBbCcJKLMadhaniRAaPqrstu23VWXYZ
    SESSION_LOGIN=24
    SESSION_REFRESH_TOKEN=720
    
    # Location
    TOKEN_MAPS=37c54fbcd8fb4f
    
    
  4. Run the application:

    go run main.go
    
  5. Open your web browser and visit http://localhost:3000 to see the app in action.

Features

Postman Documentation

https://documenter.getpostman.com/view/23663611/2s9Ykn9Mjr
  1. Create User

    Endpoint: POST /users
    Body:
    {
      "id": "123456789",
      "name": "dhim Doe",
      "email": "[email protected]",
      "password": "123123123"
    }
    
  2. Login User

    Endpoint: POST /users/login
    Body:
    {
        "email":"[email protected]",
        "password":"123123123"
    }
    
  3. Detail User

    Endpoint: POST /users/:id
        Params:
        {
            "id":"example_uuid_user",
        }
    
  4. Check In

    Endpoint: POST /attendances
        Cookies:
        {
            "token":"example_token_from_login",
        }
    
  5. Check Out

    Endpoint: POST /attendances/:id
        Params:
        {
            "id":"example_uuid_attendance",
        }