Skip to content

The Blog Backend Drogon Project is a RESTful API that provides the backend for the Client App.

Notifications You must be signed in to change notification settings

vodoanminhhieuvn/drogon_blog

Repository files navigation

E-Learning Backend

The Blog Backend Drogon Project is a RESTful API that provides the backend for the Client App.

Getting started

  • Drogon Framework: Built on top of Drogon, leveraging its features for high speed.
  • Simple Blogging: Create, edit, and delete blog posts.

To-Do

  • Authentication
  • Fully Migrated DB link
  • Validator and Error handling (Current handling is dog water)
  • Nested comments
  • Dockerize

Available Endpoints

BASE_URL : localhost:3000

  • /auth/** - Authentication endpoints
  • /me/** - Users endpoints
  • /posts/** - Posts endpoints
  • /Comments/** - Comments endpoints
  • /Categories/** - Categories endpoints

For more details you can import Blog.postman_collection.json into Postman.

Requirement

  • C++2a
  • Cmake 3.20.0
  • Drogon 1.5.0
  • PostgreSQL 16

Setting up a project

I tested on OSx so Linux will probably work. Window I have no ideas, because I don't have window device, may god bless your soul.

  1. Clone the repository:

    git clone https://github.com/vodoanminhhieuvn/drogon_blog.git
  2. Install dependencies:

  • Please follow the instructions on Drogon to install Drogon.
  • To add third-parties library, create library folder.
    mkdir library
    cd library
    git clone https://github.com/Thalhammer/jwt-cpp.git
    git clone https://github.com/openssl/openssl.git
    git clone https://github.com/trusch/libbcrypt.git
    cd ..
  1. Build the project:

    cd drogon-blog
    mkdir build
    cd build
    cmake ..
    make
  2. Run the server:

    ./wblog
  3. Open your Postman and navigate to http://localhost:3000 to access the blog.

Databases

Initialize the database

Run init.sql to create the database and table

Configure the database

By default, the project is configured to connect to PostgreSQL database. You need to update your own config.json and model.json file to connect to your own database.

You want to create a new model, you can use the following command:

    drogon_ctl create model models

Deployment (I don't know when it will be deployed because I'm broke :->)

About

The Blog Backend Drogon Project is a RESTful API that provides the backend for the Client App.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published