Skip to content

Coachonko/peony

Repository files navigation

peony

A content management system and shoping cart API for simple ecommerce needs. It is developed and used for Coachonko's blog.

Goals

This project aims to satisfy the needs of hobbists and professional content publishers. peony aims to provide the tools to publish content, market it and monetize it. These tools should also be able to satisfy merchants and service providers

peony aims to support multi-language, multi-channel, multi-currency, multi-stock locations, physical, virtual products and services.

Architecture

This graph represents how peony works on a single-server deployment. This setup may scale horizontally by deploying each box on several independent servers.

┌────────────┐                           ┌──────────────────────┐        ┌───────┐
│            │                           │        peony         │        │       │
│            │                           │                      ├────────► KeyDB ├───────┐
│            │     ┌────────────────┐    │                      │        │       │       │
│            │     │                │    │                      │        └───────┘       │
│            ◄─────► Admin frontend ◄────►       /admin/        │                        │
│            │     │                │    │                      │   ┌────────────────┐   │
│            │     └────────────────┘    │                      │   │                │   │
│            │                           │                      ├───► Percona Server ◄───┘
│            ◄───────────────────────────►                      │   │                │
│            │                           │                      │   └────────────────┘
│  lighttpd  │  ┌─────────────────────┐  │                      │
│            │  │                     │  │                      │   ┌────────────────┐
│            ◄──► Storefront frontend ◄──►     /storefront/     │   │                │
│            │  │                     │  │                      ├───►     Garage     ├───┐
│            │  └─────────────────────┘  │                      │   │                │   │
│            │                           │                      │   └────────────────┘   │
│            │                           │                      │                        │
│            │                           └──────────────────────┘                        │
│            │                                                                           │
│            ◄───────────────────────────────────────────────────────────────────────────┘
└────────────┘

peony is meant to work behind a web server set up as reverse proxy. It is recommended to use lighttpd.

peony uses a cloud architecture. It can run on several backend servers sharing a connection to the KeyDB server and Percona Server. Static files uploaded from the Admin frontend (such as images and documents) are stored on Garage. KeyDB works as cache, job queue and session storage, and Percona Server stores data.

While I use these technologies deployed as containers on my VPS, this application can be used with any managed MySQL server, Redis server and S3-compatible object storage.

The Storefront API routes are all prefixed with /storefront, while the Admin API routes are all prefixed with /admin.

Development and deployment

Instructions for development of peony can be found here, comprehensive instructions for a single-server deployment are provided here.

Important

  • It is required to add ANSI to the default sql-mode of the MySQL server.

Defaults

The default admin account has username default_admin@peony.com and password peony_password. These are logged to console when running peony for the first time, it is recommended to change both email and password of the default admin account.

Environment variables

If a .env file exists, peony will read it and use the variables provided in the file. Please look at the provided .env.template file for more information.