A Dockerized full-stack Wordle application with a Node.js/Express backend, PostgreSQL database and React.js frontend.
Ensure you have Docker Desktop installed, which includes Docker Engine and Docker Compose. You'll also need Node.js installed locally for Prisma Studio.
This setup uses docker-compose.dev.yml
for local development with hot-reloading and ts-node
.
-
Clone the repository:
git clone [https://github.com/EliaRitzmann/fullstack-wordle](https://github.com/EliaRitzmann/fullstack-wordle) cd fullstack-wordle
-
Configure local
.env
for Prisma Studio: Navigate toapps/backend/
and create a.env
file (if it doesn't exist) with the following content. This allows your local Prisma Studio to connect to the Dockerized database.cd apps/backend cp .env.example .env # If you have one # Then edit apps/backend/.env: # NODE_ENV=development # DATABASE_URL="postgresql://postgres:postgres@localhost:5432/mydb"
-
Start Services: From the project root (
fullstack-wordle/
), start the Docker services:# first time docker compose -f docker-compose.dev.yml up --build # run in background docker-compose -f docker-compose.dev.yml up -d
The frontand will be available at
http://localhost:5173
.
This setup uses docker-compose.yml
for a production-like environment.
- Clone the repository (if not already done).
- Configure production environment variables:
Create a
.env
file at the root of your project (next todocker-compose.yml
).(For real production, consider more secure methods like Docker Secrets.)# .env (at project root) DATABASE_URL="postgresql://postgres:postgres@db:5432/mydb" NODE_ENV=production
- Start Services:
From the project root (
fullstack-wordle/
), start the Docker services in detached mode:docker compose -f docker-compose.yml up --build -d
Run these commands from the project root (fullstack-wordle/
):
- Start development services (with rebuild):
docker compose -f docker-compose.dev.yml up --build
- Start production services (with rebuild, detached):
docker compose -f docker-compose.yml up --build -d
- Stop all services:
docker compose down
- Stop services and remove database data (useful for a clean start):
docker compose down -v
- Generate api client:
npm run generate:api
While your Docker services are running, you can inspect your database data using Prisma Studio:
- Open a new terminal and navigate to your
apps/backend
directory. - Run Prisma Studio:
Prisma Studio will open in your web browser, at
npx prisma studio
http://localhost:5555
.
The backend provides interactive API documentation via Swagger UI. Once the backend server is running, visit:
http://localhost:3000/api-docs