/remix-strapi-mysql-docker

An example of a blog with CMS, frontend is built with Remix, CMS is built with Strapi, database is MySQL, and containerized with Docker.

Primary LanguageTypeScriptMIT LicenseMIT

remix-strapi-mysql-docker

Elements

.
├── backend
│   └── ... Strapi files
├── database
│   └── ... MySQL files
└── frontend
    └── ... Remix files

Setup local development environment (Docker)

docker-compose build
docker-compose up

After the setup is complete, access to the following will be available:

Now you can access the admin console to edit contents, and update the frontend as you wish.

Here's initial local admin credential:

  • admin@example.com
  • P4ssW0rd

See other credentials on each local.env files.

  • NOTE: Please change passwords and other credentials if using this in a production environment.

If you want to save local database change as a dump file, try following command:

docker-compose exec database mysqldump -u root -p strapi > database/data/init/init.sql

If you update a GraphQL query (gql) and need to generate type definitions, try the following:

docker-compose exec frontend bash
npm run generate:type

Setup local development environment (without Docker)

It can also be set up without Docker.

Frontend

Since it is easier to refer to the type information by having node_modules locally, not using Docker only for Frontend is also an option.

cd frontend
npm i
npm run dev

Backend

Backend need setup database in your local. Therefore, I recommend using Docker for the database and backend at least.

cd backend
npm i
npm run dev

Todo & What I Did