1.0.23 • Published 3 years ago

@salsaboy990/strapi-template-seeder v1.0.23

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

strapi-template-seeder

A Strapi template with seeder to create a Strapi project for a Gatsby website with sample data.

  • custom entities and components
  • dynamic groups for content
  • content seeder
  • Gatsby frontend available for the Strapi backend

Important notes

There was an older npm package strapi-template-drb (1.0.9) which is deprecated.

Always use the current package: strapi-template-seeder

Usage

# Using Yarn
yarn create strapi-app your-app-name --template https://github.com/SalsaBoy990/strapi-template-seeder

# Or using NPM
npx create-strapi-app your-app-name --template https://github.com/SalsaBoy990/strapi-template-seeder

At the install process:

  • Choose JavaScipt
  • Choose manual setup and select postgres (though sqlite can be used as well)

In order to use Postgres, create first a Postgres database with user and password.

Strapi backend example

The example backend is created using the starter template.

Deploy a Strapi app to Heroku

  • Deploy Strapi on Heroku You only need to have a free Heroku account. You can also have a Postgres database for free.

Checkout the database config used by Heroku: https://github.com/SalsaBoy990/strapi4-backend/blob/master/config/env/production/database.js

And this file: https://github.com/SalsaBoy990/strapi4-backend/blob/master/config/env/production/server.js

Note:: You cannot store your assets in the uploads folder on Heroku, since your uploads will be lost after Heroku restarts the dyno. The filesystem only lasts until the dyno is restarted. In the free tier, this is done more regurarly since Heroku will stop your dyno after 30 mins.

You only need to have a free account on Cloudinary. In addition, do not forget to set your cloudinary credentials as env vars for your Heroku application, for example:

heroku config:set CLOUDINARY_NAME=app-name-here

See the cloudinary config: https://github.com/SalsaBoy990/strapi4-backend/blob/master/config/plugins.js

Check out this file: https://github.com/SalsaBoy990/strapi4-backend/blob/master/config/plugins.js

Frontend starter using Gatsby v4

Frontend starter for the Strapi backend:

Set these variables in .env.development:

STRAPI_API_URL=strapi-app-url-on-heroku
STRAPI_TOKEN=full-access-token-generated-in-the-strapi-app

To refresh content for the Gatsby development script, set this variable to true:

ENABLE_GATSBY_REFRESH_ENDPOINT=true

And run: bin/refresh

The bash script will trigger the rebuild of the content after the data changes you have made in the Strapi admin.

Sample images and text

Three images are from Unsplash and can be used for commercial and non-commercial purposes.

Author attributions:

There are sample images from a real project I made for a client at a company where I used to do contract work. All the brand images are replaced with fake ones, so the original company can't be recognized.

The original texts are also changed and replaced with made-up, or lorem ipsum texts.

1.0.23

3 years ago

1.0.22

3 years ago

1.0.21

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago