Skip to content

A RESTful CRUD (Create, Read, Update, Delete) API built in Go using the Gin web framework. The API allows users to perform basic CRUD operations on posts and supports user signup and authentication. It uses a PostgreSQL database to store post and user data.

Notifications You must be signed in to change notification settings

rahulsm20/go-crud-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GO CRUD API

Postman Documentation | Live Endpoint

This is a CRUD (Create, Read, Update, Delete) API built in Go using the Gin web framework. The API allows users to perform basic CRUD operations on posts and supports user signup and authentication. It uses a PostgreSQL database to store post and user data.

Dependencies

  • Framework
    • Gin
  • Authentication
    • Crypto
    • JWT
  • Database Utilities
    • GORM
    • GORM - Postgres Driver

Database

  • PostgreSQL

Requirements

  • Go (v1.16 or higher)
  • PostgreSQL database
  • Postman (optional, for testing the API)

Installation

  1. Clone the repository to your local machine:
git clone https://github.com/rahulsm20/go-crud-api.git
cd go-crud-api
  1. Set up the PostgreSQL database:

    • Create a .env file in the root directory.
    • Define the database connection string as DB_URL.
  2. Install the dependencies and run the API server:

go mod download
go run main.go

Alternatively, you can use the following command to automatically recompile and restart the server whenever changes are made to the source code.

CompileDaemon -command="./go-crud-api"

The API server will run on http://localhost:3000.

Endpoints

System design

Database Schema

database_schema

ER Diagram

er_diagram

About

A RESTful CRUD (Create, Read, Update, Delete) API built in Go using the Gin web framework. The API allows users to perform basic CRUD operations on posts and supports user signup and authentication. It uses a PostgreSQL database to store post and user data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published