Welcome to the Simple CMS Admin Service V2. An open-source Content Management System based on the echo framework. As admin, we can use the features provided by this service in the form of management of articles and categories. By using this service we can insert, update, delete and get details of each item (article and category). This service has implemented clean architecture principles, a practical software architecture solution from Robert C. Martin (known as Uncle Bob).
The following are some of the updates in this latest version of the content management system:
- Standardize the response format.
- Refactor algorithm including handler, usecase, and repository layer.
- Add custom middlewares and validator.
- Update database schema.
- Minor bug fixes.
- Go 1.19.3
- PostgreSQL
- Elasticsearch
- Redis
- Clone the git repository:
$ git clone https://github.com/Assyatier21/simple-cms-admin-v2.git
$ cd simple-cms-admin-v2
- Install Dependencies
$ go mod tidy
- Install Elasticsearch and Redis
$ docker pull docker.elastic.co/elasticsearch/elasticsearch:8.8.1
$ docker pull redis
- Adjust Configuration
$ cp example.config.json config.json
Then update config file as needed. I think you are quite easy for a smart person like you:)
$ go run cmd/main.go
or simply
$ make run
GET /admin/v2/article
Parameter | Type | Description |
---|---|---|
limit |
int |
|
offset |
int |
|
sort_by |
string |
can be every columns |
order_by |
string |
"asc", "desc" |
GET /admin/v2/article/{id}
Parameter | Type | Description |
---|---|---|
id |
string |
[Required] UUID of article to fetch |
POST /admin/v2/article
Parameter | Type | Description |
---|---|---|
id |
string |
UUID will be generated automatically. |
title |
string |
[Required] Title of the article. |
slug |
string |
[Required] URL-friendly slug of the article. |
htmlcontent |
string |
[Required] HTML content of the article. |
category_id |
[]int |
[Required] IDs of the categories the article belongs to. |
metadata |
string |
[Required] Metadata of the article. |
created_at |
string |
Creation timestamp of the article. |
updated_at |
string |
Last update timestamp of the article. |
PATCH /admin/v2/article/{id}
Parameter | Type | Description |
---|---|---|
id |
string |
[Required] UUID of the article to update. |
title |
string |
Title of the article to update. |
slug |
string |
URL-friendly slug of the article to update. |
htmlcontent |
string |
HTML content of the article to update. |
category_id |
[]int |
IDs of the categories the article belongs to. |
metadata |
string |
Metadata of the article to update. |
created_at |
string |
Creation timestamp of the article. |
updated_at |
string |
Last update timestamp of the article. |
DELETE /admin/v2/article/{id}
Parameter | Type | Description |
---|---|---|
id |
string |
[Required] UUID of article to delete |
Everything you need, such as the postman collection and database migration script, can be found in the folder in simple-cms-admin-v2/tools
.
$ go test -v -coverprofile coverage.out ./...
please follow this tutorial as well.
This project is licensed under the MIT License - see the LICENSE file for details.