A template for building full-stack applications with React, Express and Docker containerization
To create a new React app with Vite (JavaScript):
npm create vite@latest my-appTo create a new Express app:
npm init -yThe
-yflag automatically answers "yes" to all prompts during initialization, creating apackage.jsonwith default values.
To build and start the application using Docker Compose:
docker-compose up -d --build-d: Runs the containers in detached mode.--build: Forces a rebuild of the Docker images.
docker exec -it <container_id> sh
# example npm install
docker-compose run --rm client npm install axios
docker-compose run --rm server npm install passport-local
# create migration
docker-compose run --rm server npx sequelize-cli migration:generate --name create-users-table
# run migrations
docker-compose run --rm server npx sequelize-cli db:migrate
# rollback
docker-compose run --rm server npx sequelize-cli db:migrate:undo:all