This project is a Content Management System for the cow.fi.
It is an instance of Strapi, a headless CMS.
Swagger Docs: https://cms.cow.fi/swagger.html
Some requirements are:
- Node v18 or v20 (use an LTS version)
- Yarn
- PostgreSQL (optional), for local dev is easier to use sqlite3 (the default). Alternatively you can use PostgreSQL
The CMS relies on a database. The simplest is to use Sqlite for development (it will be created automatically at data/sqlite.db when you start the app).
Steps:
-
Build the project (required before running):
yarn build
-
Create a
.envfile and set at leastAPP_KEYS(required for the app to start):cp .env.example .env
Edit
.envand setAPP_KEYSto a comma-separated list of secret keys, for example:APP_KEYS="mySecretKey1,mySecretKey2"You can leave other values as in the example for local dev, or adjust them as needed (see Strapi environment config).
-
Start the dev server:
yarn dev
-
Visit http://localhost:1337/admin and create your local admin user.
If you want to use PostgreSQL (instead of sqlite3), you need to install it first:
- Mac: Postgres.app.
- Linux: PostgreSQL for Linux
- Windows: PostgreSQL for Windows
Once you know the running port, you can setup the .env file:
# Create an ENV file from the example
cp .env.example .envEdit the .env file and set the database connection
To start with the new database, you simply start the dev server:
yarn devBefore running the server for the first time, you need to build it (see Run locally using sqlite3 for the full setup). To build:
yarn build🚨 For this command to work you must first have a build in place. You can do this via the previous command, yarn build.
yarn start# Create an ENV file from the example
cp .env.example .env
# Start the project
docker compose upThen visit:
Also, a Postgres database will be exposed on port 5432.
Strapi comes with a powerful CLI tooling Strapi documentation
# Check version of the Strapi CLI
yarn strapi version
# Help command
yarn strapi helpThis project also exposes a library that can be used to interact with the CMS API.
To build the library, run:
# Create a new version (patch, minor or major)
npm version minor
# Build and Publish to NPM
./scripts/publish-lib.sh