A quickstart framework for running a fullstack React/Apollo/Prisma application all in one solution.
Steps to get the development environment running
- Clone this
docker-compose up -d
- Perform the initial prisma deploy with:
docker-compose exec server npm run prisma -- deploy
🙌We did it.
(You should probalby run a local
npm i in the client directory so you can run developer tools outside of the containers)
You can access services now at the following addresses:
http://localhost:3000 - React Frontend http://localhost:4000 - Apollo Server (GraphQL Playground) http://localhost:4466 - Prisma Server (GraphQL Playground)
Client tech stack that you should know a bit about before working on this project:
- React 16.8 (Hooks!)
- Apollo Client
Helpful Client Commands
npm run apollo:codegen- Extract static types from apollo queries
npm run i18n:extract- Extracts the translations from
defineMessageshelper into a single messages file
npm run i18n:manage- Prepares translation files for provided languages [en, ja]
The above commands all have VSCode tasks included.
Server tech stack that you should know a bit about before working on this project:
- Apollo Server
Helpful Server Commands
docker-compose exec server npm run prisma -- deploy- Deploy Prisma inside of the container
docker-compose exec server npm run prisma -- seed --reset- Reseed the database. (Also resets the database and data loss will occur!)
docker-compose exec server npm run prisma -- reset --force- Reset Prisma database (This will delete all data!)
Prisma CLI commands need to be run inside of the containers so the correct addresses are used.
Adding Node Modules
Because we are running everything inside of containers, changes to
package.json will not replicate inside of the container without restarting it. Make sure to always restart your docker containers after making any changes to installed modules.