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 requiremets are:
- At least Node v16 (use a 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.
You actually don't need to do anything for this! If you run the project with yarn dev
, it will automatically create a sqlite database in data/sqlite.db
yarn dev
Then visit:
- Admin: http://localhost:1337/admin
On its basic setup, you don't need to add any configuration parameter, however you might want to do so. You can do this by creating a .env
file.
# Create an ENV file from the example
cp .env.example .env
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 .env
Edit the .env file and set the database connection
To start with the new database, you simply start the dev server:
yarn dev
Before running the server for the first time, you need to build it:
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 up
Then 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 help
This 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