Coder Social home page Coder Social logo

go-restapi's Introduction

Simple Golang REST API with PostgreSQL

This is a project for creating APIs with.

  • Login and Register API Function with JWT Auth.
  • Create API Function - It can add an employee and fill the created_at column in the employee table.
  • Read API Function - It can view detailed information of the selected employee data.
  • Update API Function - It can modify employee data and update the updated_at column in the employee table when modifying employee data.
  • Delete API Function - It performs deletion of employee data using soft delete, allowing deleted data to be restored.

Getting Started

You can download this repo or clone using below command. (folder-name will be project folder in which you want to start your project).

git clone https://github.com/latifis/go-restapi.git <folder-name>

or from Download Zip

https://github.com/latifis/go-restapi

Installing And Running

  1. Instalation

To install dependencies, run the following command in your terminal or command prompt:

> go mod download
  1. Setup Database

After installing dependencies, you need to configure the database settings. Open the setup file in models folder and configure it according to the database you are using:

go-restapi/models/setup.go
  1. Running The Program

Once dependencies are installed and the database is configured, start the application with the following command:

> go main.go

API Documentation

To view documentation for using this program, you can go to the documentation, or at the following link:

https://documenter.getpostman.com/view/19724773/2sA2xfXsux

Preview

  • Login alt text
  • Login Failed alt text
  • Register alt text
  • Failed Register when User Already Exists alt text
  • Get Data Unauthorized alt text
  • Create Karyawan alt text
  • Get All Data Karyawan alt text
  • Get Data Karyawan by ID alt text
  • Update Data Karyawan alt text
  • Soft Delete Karyawan alt text
  • Get Karyawan When They Have Been Soft Delete alt text

go-restapi's People

Contributors

latifis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.