Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-31T17:03:41.000Z (over 1 year ago)
- Last Synced: 2024-10-02T05:23:08.310Z (about 2 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
![System design](https://github.com/rahulsm20/go-crud-api/assets/77540672/e2ae444c-b8e6-46eb-b6a6-824c273118c2)
### Database Schema
![database_schema](https://github.com/rahulsm20/go-crud-api/assets/77540672/0208841e-cbdc-4f8f-a649-cada77d7746a)### ER Diagram
![er_diagram](https://github.com/rahulsm20/go-crud-api/assets/77540672/72d06af7-782e-4a97-b908-ffb31e6a092f)