Skip to content

fansuregrin/libre-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libre-blog

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.

API List

  • 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.

Setup, Build, and Run

Setup Environment

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

Build

1.Create database and data tables

Please see 🛠️here

2.Generate database model code

git clone https://github.com/fansuregrin/libre-blog.git
cd libre-blog/models
dg_ctl create model .

3.Build Executable File

cd libre-blog/
mkdir build
cd build
cmake .. && make

Run

Just run the libre-blog executable file in the build folder.

cd build
./libre-blog

Acknowledgements

  • 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.

About

A blog system powered by Drogon.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published