https://github.com/rahulsm20/go-crud-api
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.
https://github.com/rahulsm20/go-crud-api
docker gin-gonic golang gorm postgresql restful-api
Last synced: 4 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/rahulsm20/go-crud-api
- Owner: rahulsm20
- Created: 2023-07-26T18:19:07.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-31T17:03:41.000Z (almost 2 years ago)
- Last Synced: 2025-02-01T17:44:20.300Z (5 months ago)
- Topics: docker, gin-gonic, golang, gorm, postgresql, restful-api
- Language: Go
- Homepage: https://gocrudapi.onrender.com/
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GO CRUD API
[Postman Documentation](https://documenter.getpostman.com/view/22495929/2s9Xxtwue7) |
[Live Endpoint](https://gocrudapi.onrender.com/)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
```2. Set up the PostgreSQL database:
- Create a .env file in the root directory.
- Define the database connection string as DB_URL.3. 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

### Database Schema
### ER Diagram
