Libre-blog is a blog system. This repository uses the Drogon framework to implement the backend API of libre-blog. The front-end implementation of libre-blog is 👉here.
- article
/blog/articles/{page}
/blog/category/{slug}/{page}
/blog/tag/{slug}/{page}
/blog/user/{id}/{page}
/blog/admin/articles/{page}
/blog/article/{id}
/blog/article/add
/blog/article/update
/blog/article/delete
- category
/blog/categories
/blog/category/{id}
/blog/category/add
/blog/category/update
/blog/category/delete
- tag
/blog/tags/{page}
/blog/tag/{id}
/blog/tag/add
/blog/tag/update
/blog/tag/delete
- user
/login
/register
/user/center
/user/update/general-info
/user/update/password
/users/{page}
/user/{id}
/user/add
/user/update
/user/delete
/user/role
- role
/roles
- menu
/blog/admin/menu
/blog/menu
For more detailed API documentation, please see 👉here.
This project is developed on Debian GNU/Linux 12 (bookworm). You need to install these packages to meet the development environment.
apt install g++ gdb libgtest-dev git cmake doxygen \
libjsoncpp-dev uuid-dev zlib1g-dev \
libssl-dev openssl libmariadb-dev libhiredis-dev libc-ares-dev libbrotli-dev libyaml-cpp-dev \
-y
Then, you need to install the Drogon framework. For more detailed information about the Drogon framework, please see the Drogon wiki page.
git clone https://github.com/drogonframework/drogon
cd drogon
git submodule update --init
mkdir build
cd build
cmake ..
make && sudo make install
This project uses jwt-cpp
for token issuing and verification. So, you need to install this library.
git clone https://github.com/Thalhammer/jwt-cpp.git
cd jwt-cpp
mkdir build
cd build
cmake .. && make
sudo make install
git clone https://github.com/fansuregrin/libre-blog.git
cd libre-blog
Please see 🛠️here
Edit config.json
and models/model.json
, then change the MySQL database connection configuration (such as host, port, user, passwd, and etc) to what you need.
cd models
dg_ctl create model .
mkdir build
cd build
cmake .. && make
Just run the libre-blog
executable file in the build
folder.
cd build
./libre-blog
- Drogon: Provides the possibility to build various types of web application server programs.
- VSCode: Provide an environment for code writing and debugging.
- ApiPost: Provide API design and debugging functions.