A Turborepo with Strapi v4 (w/ postgres database) + Next.js powered by docker and docker-compose

Overview

Turborepo + Strapi + Next.js + Docker

A Turborepo with Strapi v4 (w/ postgres database) + Next.js powered by docker and docker-compose.

⚠️ Prerequisites

Please make sure you have Docker and docker-compose installed in your machine. Please refer here to install them :

  1. Docker installation
  2. Docker compose installation

Getting Started

  1. Clone this repository :
git clone https://github.com/Elvincth/turbo-strapi-nextjs
  1. Change directory
cd turbo-strapi-nextjs

Setup strapi configuration (.env) :

  1. Change directory to our strapi application
cd apps/backend
  1. Create a .env file which stores strapi and postgres configuration, based on the .env.example file:
cp .env.example .env
  1. Define the admin JWT Token

    In order to make the admin login work you need to define the secret you want to use in .env file

Generate a secure token:

openssl rand 64 | base64 # (linux/macOS users)
# or
node -e "console.log(require('crypto').randomBytes(64).toString('base64'))" # (all users)

Add it to your env variables (apps/backend/.env):

ADMIN_JWT_SECRET=token_generated_above

Develop

To develop all apps and packages, run the following command (in the project root):

docker-compose up -d

Build

To build all apps and packages, run the following commands:

docker exec -it strapi_nextjs_turbo /bin/sh

Then run:

yarn build

What's inside?

This turborepo uses Yarn as a package manager. It includes the following packages/apps:

Apps and Packages

  • frontend: a Next.js app
  • backend: Strapi app
  • ui: a stub React component library currently used by frontend application
  • config: eslint configurations (includes eslint-config-next and eslint-config-prettier)
  • tsconfig: tsconfig.jsons used throughout the monorepo

Utilities

This turborepo has some additional tools already setup for you:

Remote Caching

Turborepo can use a technique known as Remote Caching (Beta) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

By default, Turborepo will cache locally. To enable Remote Caching (Beta) you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:

docker exec -it strapi_nextjs_turbo /bin/sh
npx turbo login

This will authenticate the Turborepo CLI with your Vercel account.

Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your turborepo:

npx turbo link

Useful Links

Learn more about the power of Turborepo:

Credits

You might also like...

Connect to a Postgres database from a Cloudflare Worker, using Cloudflare Tunnel

Cloudflare Workers Postgres Client This is an experimental module. Heavily based on cloudflare/worker-template-postgres, but cleaned up and bundled in

Dec 22, 2022

Fastest way to get financial data from Plaid into your Postgres database. Go from zero to live in 5 minutes without a single line of code.

Fastest way to get financial data from Plaid into your Postgres database. Go from zero to live in 5 minutes without a single line of code.

Venice Venice is a the fastest way to get financial data from Plaid into your Postgres database. Zero to production in 5 minutes without a single line

Dec 12, 2022

Blog and Resume template with turborepo

Blog and Resume template with turborepo

Comet-land BLOG DEMO RESUME DEMO Blog and Resume template with turborepo 한국어 문서는 다음 링크에서 확인하실 수 있습니다. Blog Feature 👔 Code highlight with line-highlig

Dec 27, 2022

Projen project type for Turborepo monorepo setup.

📦 projen-turborepo Projen project type for Turborepo monorepo setup. Getting Started To create a new project, run the following command and follow th

Oct 4, 2022

open-source implementation of the Turborepo custom remote cache server.

open-source implementation of the Turborepo custom remote cache server.

This project is an open-source implementation of the Turborepo custom remote cache server. If Vercel's official cache server isn't a viable option, th

Dec 30, 2022

Remix + Cloudflare Workers + DO + Turborepo

Remix + Cloudflare Workers + DO + Turborepo A starter to get you up and going with Remix on Cloudflare with all the latest and greatest. What's inside

Dec 12, 2022

A starter template for Remix + Cloudflare Workers + DO + KV + Turborepo

Remix + Cloudflare Workers starter with Turborepo 🚀 Starter to get going with Remix and Cloudflare Workers. This template is based on the starter cre

Jan 2, 2023

Turborepo starter with pnpm

Turborepo starter with pnpm This is an official starter turborepo. What's inside? This turborepo uses pnpm as a packages manager. It includes the foll

Dec 18, 2022

Strapi V4 Plugin to schedule publish and depublish actions

Strapi plugin scheduler This plugin allows you to publish and depublish collection types in the future. There are a couple of steps necessary to get t

Nov 24, 2022
Comments
  • ailed to load parser './parser.js' declared in '.eslintrc.js » eslint-config-next': Cannot find module 'next/dist/compiled/babel/eslint-parser'

    ailed to load parser './parser.js' declared in '.eslintrc.js » eslint-config-next': Cannot find module 'next/dist/compiled/babel/eslint-parser'

    Hi, first of all, thank you for this template !

    I have an issue running build/lint command :

    ❯ yarn lint
    yarn run v1.22.19
    $ next lint
    info  - SWC minify release candidate enabled. https://nextjs.link/swcmin
    Failed to load parser './parser.js' declared in '.eslintrc.js » eslint-config-next': Cannot find module 'next/dist/compiled/babel/eslint-parser'
    Require stack:
    - /Users/alexvrhe/Documents/Dev/Perso/julie-portfolio-mono/node_modules/eslint-config-next/parser.js
    - /Users/alexvrhe/Documents/Dev/Perso/julie-portfolio-mono/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    

    Do you have any idea where it is coming from ?

    Thx !

    opened by AlexandreVerhoye 2
Owner
Elvin Chu
Elvin Chu
Atlan is a CLI that helps you to manage local dockerized infrastructure without any needed knowledge on Docker and Docker Compose.

Atlan CLI Atlan is a CLI that helps you to manage local dockerized infrastructure without any needed knowledge on Docker and Docker Compose. What is A

Myastro 10 Aug 17, 2022
An example T3 app containerized with Docker, Docker Compose, and deployed on Railway

Create T3 App This is an app bootstrapped according to the init.tips stack, also known as the T3-Stack. What's next? How do I make an app with this? W

Anthony Campolo 15 Dec 19, 2022
A wee E-Commerce website powered by Stripe, Auth0, Strapi and Next.js

This is a Next.js project bootstrapped with create-next-app. Getting Started First, run the development server: npm run dev # or yarn dev Open http://

Simo Edwin 66 Dec 19, 2022
Fullstack Turborepo starter. Typescript, Nestjs, Nextjs, Tailwind, Prisma, Github Actions, Docker, And Reverse proxy configured

Turborepo (NestJS + Prisma + NextJS + Tailwind + Typescript + Jest) Starter This is fullstack turborepo starter. It comes with the following features.

Ejaz Ahmed 132 Jan 9, 2023
Remix TypeScript monorepo with Turborepo pipelines, Prisma, PostgreSQL, Docker deploy to Fly.io, pnpm, TailwindCSS and Tsyringe for DI.

Remix template with Turborepo, TypeScript and pnpm. The remix app deploys to fly.io or build to Docker image. Example packages for Database with prisma, Tsyringe dependency injection, UI, and internal TypeScript packages.

Philippe L'ATTENTION 33 Dec 29, 2022
The app's backend is written in Python (Flask) and for search it uses Elasticsearch. I used this app as candidate application for learning out how to build, run and deploy a multi-container environment (docker-compose).

foodtrucks-app-docker-compose The app's backend is written in Python (Flask) and for search it uses Elasticsearch. I used this app as candidate applic

Selçuk Şan 3 Oct 24, 2022
local docker-compose environment to deploy and configure backoffice

backoffice-local local docker-compose environment to deploy and configure backoffice How to install To install the repo dependencies yarn install be s

micro-lc 2 Dec 15, 2022
Built with Anima: A functioning bank app powered by Anima & Strapi

Bank website A functioning bank app powered by Anima & Strapi: Live Demo In this tutorial, we redesigned SVBs banking dashboard using Anima's open sou

Anima 15 Nov 21, 2022
🚀 Blazing Fast S3 Powered CDN ✨ Powered By Fastify, S3 Buckets & Docker!

?? WasiCDN Blazing Fast S3 Powered CDN, Powered By Fastify, S3 Compatible Buckets & Docker! Core DockerHub: https://hub.docker.com/r/maximking19/wasic

Maxim 5 Aug 31, 2022
A FARM stack app automated with docker-compose

Expense-Tracker An expense tracker built with FARM stack (FastAPI,React,MongoDB) Requirements Docker Docker-Compose Install and Run To install and run

Deepraj 4 Oct 10, 2022