Skip to content

maposia/nextjs-strapi-posgres-nginx-boilerplate

Repository files navigation

Welcome to Nextjs+Strapi+Postgres+Docker boilerplate

What for?

This project was implemented for a simple deployment to the server Some of the ideas of the implementation were taken from the this repo(I have nothing to do with this repository)

Features & Stacks

Backend

  • Strapi 4.21.1
  • Node.js 18
  • Yarn package manager

Frontend

  • Next.js 14.1.4
  • React 18
  • Tailwind CSS
  • TypeScript
  • Npm package manager

Database

  • Postgres 16.2-alpine

Reverse Proxy

  • Nginx Latest

The proxy is split into a domain for Next.js and a subdomain for Strapi

Containerization

  • Docker 26.0.0🐳
  • Docker Compose 2.26.0
  • Seperated Dockerfiles for development and production

Environment Variables Management

  • One file for backend + frontend + database + nginx

How to start

  1. Clone the repository
  2. Add Environment Variables from .env.example to your sever or CI/CD
  3. Change credentials with secure and strong ones
  4. If you are on development, be sure ENVIRONMENT=development
  5. If you are on production or want to production build, change with ENVIRONMENT=production
  6. Be sure localhost:443 is accesible and not using from another process (Nginx runs on 443). You need have SSL on your server.
  7. Change the domain names in the nginx configuration files and backend/config/server.js

I Recommend to use CI/CD for easy deploy this project to your server. You can use Gitlab CI/CD or Github Actions for this.

For Gitlab CI/CD, you can rename .gitlab-ci.yml.example file add runner and deploy this project to your server.

Author

About

This project was implemented for a simple deployment to the server Next.js+Strapi+Postgre+NGINX

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published