Strapi - Selltim Help

II - Installation

This guide will show you how to install a project running Strapi CMS and Next.JS front-end.

In this tutorial, we assume the project is named foobar.

1. Prepare the database

First of all, you have to create a new database on your machine. Name it like the project.

CREATE DATABASE foobar;

2. Clone

Clone both back and front repositories on your machine. The back repository contains the Strapi project, and the front repository the Next.JS project.

git clone git@github.com:Company/foobar-back.git git clone git@github.com:Company/foobar-front.git

3. Install the dependencies

Once the repositories have been cloned, move into them, and run yarn to install the dependencies.

cd foobar-front && yarn cd foobar-back && yarn

4. Add your environment variables

Now, you can copy the example .env files (often named .env.example), and replace the example values by your own. Be careful, these values are secrets and shall not be versioned.

This is how the .env fil looks like for the back project

HOST=0.0.0.0 PORT=1337 APP_KEYS="toBeModified1,toBeModified2" API_TOKEN_SALT=tobemodified ADMIN_JWT_SECRET=tobemodified TRANSFER_TOKEN_SALT=tobemodified JWT_SECRET=tobemodified # Database DATABASE_CLIENT=postgres DATABASE_HOST=localhost DATABASE_PORT=5432 DATABASE_NAME=foobar DATABASE_USERNAME=root DATABASE_PASSWORD=root DATABASE_SSL=false # E-mail SMTP_HOST= SMTP_PORT=587 SMTP_USERNAME= SMTP_PASSWORD=

This is how the .env fil looks like for the front project

NEXT_PUBLIC_API_BASE=http://127.0.0.1:1337 API_KEY=your-key CONTACT_EMAIL= RECAPTCHA_VERIFICATION_URL=https://www.google.com/recaptcha/api/siteverify NEXT_PUBLIC_RECAPTCHA_SITE_KEY= RECAPTCHA_SECRET=
Last modified: 14 novembre 2023