Skip to content

Commit

Permalink
Add FAQ for the CMS (#17)
Browse files Browse the repository at this point in the history
* Add FAQ

* Add categories
  • Loading branch information
anxolin authored Apr 23, 2024
1 parent e5d887b commit 7d9db27
Show file tree
Hide file tree
Showing 12 changed files with 5,726 additions and 1,942 deletions.
28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,37 @@ Swagger Docs: https://cms.cow.fi/swagger.html

# 👨‍💻 Develop

```
yarn dev
```

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


## 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`

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

```bash
# Create an ENV file from the example
cp .env.example .env
```


## Dev locally using PostreSQL

The easiest is to develop using sqlite, but if you want to use PostgreSQL, you need to install it first:
If you want to use `PostgreSQL` (instead of `sqlite3`), you need to install it first:

- **Mac**: [Postgres.app](https://postgresapp.com/).
- **Linux**: [PostgreSQL for Linux](https://www.postgresql.org/download/linux/)
Expand Down
34 changes: 34 additions & 0 deletions src/api/faq-category/content-types/faq-category/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"kind": "collectionType",
"collectionName": "faq_categories",
"info": {
"singularName": "faq-category",
"pluralName": "faq-categories",
"displayName": "FAQ Category"
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string",
"required": true,
"unique": true
},
"description": {
"type": "text",
"required": true
},
"image": {
"allowedTypes": [
"images",
"files",
"videos",
"audios"
],
"type": "media",
"multiple": false
}
}
}
7 changes: 7 additions & 0 deletions src/api/faq-category/controllers/faq-category.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* faq-category controller
*/

import { factories } from '@strapi/strapi'

export default factories.createCoreController('api::faq-category.faq-category');
Loading

0 comments on commit 7d9db27

Please sign in to comment.