Skip to content

Commit

Permalink
feat: add bonding pool and related content types (#45)
Browse files Browse the repository at this point in the history
* feat: add bonding pool and related content types

* chore: update readme with instructions to build before running dev

* chore: bump version to 0.7.0
  • Loading branch information
alfetopito authored Sep 6, 2024
1 parent 93ffb1c commit a35e7c6
Show file tree
Hide file tree
Showing 15 changed files with 17,708 additions and 8,325 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ This project is a Content Management System for the [cow.fi](https://cow.fi).
> It is an instance of Strapi, a headless CMS.
# API
Swagger Docs: https://cms.cow.fi/swagger.html

Swagger Docs: <https://cms.cow.fi/swagger.html>

# 👨‍💻 Develop

Expand All @@ -16,8 +16,8 @@ Some requiremets are:
- Yarn
- PostgreSQL (optional), for local dev is easier to use sqlite3 (the default). Alternatively you can use PostgreSQL


## Run locally using sqlite3

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`
Expand All @@ -27,8 +27,8 @@ yarn dev
```

Then visit:
* **Admin**: http://localhost:1337/admin

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

Expand All @@ -37,7 +37,6 @@ On its basic setup, you don't need to add any configuration parameter, however y
cp .env.example .env
```


## Dev locally using PostreSQL

If you want to use `PostgreSQL` (instead of `sqlite3`), you need to install it first:
Expand All @@ -55,7 +54,7 @@ cp .env.example .env

Edit the .env file and set the database connection

- See https://docs.strapi.io/dev-docs/configurations/environment
- See <https://docs.strapi.io/dev-docs/configurations/environment>

To start with the new database, you simply start the dev server:

Expand All @@ -65,6 +64,8 @@ yarn dev

# 👷‍♀️ Build

Before running the server for the first time, you need to build it:

```bash
yarn build
```
Expand Down Expand Up @@ -107,6 +108,7 @@ yarn strapi help
```

# Library

This project also exposes a library that can be used to interact with the CMS API.

To build the library, run:
Expand All @@ -117,4 +119,4 @@ npm version minor

# Build and Publish to NPM
./scripts/publish-lib.sh
```
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cowprotocol/cms-parent",
"version": "0.6.0",
"version": "0.7.0",
"description": "Cow Protocol CMS",
"private": true,
"license": "(MIT OR Apache-2.0)",
Expand Down
26 changes: 26 additions & 0 deletions src/api/bonding-pool/content-types/bonding-pool/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"kind": "collectionType",
"collectionName": "bonding_pools",
"info": {
"singularName": "bonding-pool",
"pluralName": "bonding-pools",
"displayName": "Bonding Pool"
},
"options": {
"draftAndPublish": false
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string",
"required": true,
"unique": true
},
"solver_bonding_pools": {
"type": "relation",
"relation": "oneToMany",
"target": "api::solver-bonding-pool.solver-bonding-pool",
"mappedBy": "bonding_pool"
}
}
}
7 changes: 7 additions & 0 deletions src/api/bonding-pool/controllers/bonding-pool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* bonding-pool controller
*/

import { factories } from '@strapi/strapi'

export default factories.createCoreController('api::bonding-pool.bonding-pool');
Loading

0 comments on commit a35e7c6

Please sign in to comment.