Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lunarwhite/article-manager
A simple web app with microservice, built with Go and Gin framework.
https://github.com/lunarwhite/article-manager
article-management demo gin golang web-app
Last synced: about 2 months ago
JSON representation
A simple web app with microservice, built with Go and Gin framework.
- Host: GitHub
- URL: https://github.com/lunarwhite/article-manager
- Owner: lunarwhite
- License: mit
- Created: 2022-01-18T02:12:26.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-19T14:38:29.000Z (8 months ago)
- Last Synced: 2024-10-11T09:41:26.062Z (3 months ago)
- Topics: article-management, demo, gin, golang, web-app
- Language: Go
- Homepage:
- Size: 74.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# article-manager
A simple web app with microservice written in Golang and Gin, to manager articles.
```
.
├── LICENSE
├── README.md
├── common_test.go
├── go.mod
├── go.sum
├── handlers.article.go
├── handlers.article_test.go
├── main.go
├── models.article.go
├── models.article_test.go
├── routes.go
└── templates
├── article.html
├── footer.html
├── header.html
├── index.html
└── menu.html
```## setup envs
- golang## features
- Let users register with a username and a password (non-logged in users only)
- Let users login with a username and a password (non-logged in users only)
- Let users log out (logged in users only)
- Let users create new articles (logged in users only)
- Display the list of all articles on the home page (for all users)
- Display a single article on its own page (for all users)## how it works
- control flow
```
Request -> Route Parser -> [Optional Middleware] -> Route Handler -> [Optional Middleware] -> Response
```
- functionalities offered by Gin
- Routing — to handle various URLs
- Custom rendering — to handle the response format
- Middleware — to implement authentication## run & deploy
- run
```shell
go run mian.go
```
- visit `localhost:8080`## reference
- [Building Go Web Applications and Microservices Using Gin](https://semaphoreci.com/community/tutorials/building-go-web-applications-and-microservices-using-gin)