Files
Chatapp/README.md
T
Francesco Lorenzo D'Amico a5d116358e Initial commit
2026-08-10 15:25:21 +02:00

1021 B

Docker Setup

Run the full stack with:

docker compose up --build

Services:

  • Frontend: http://localhost:5173
  • Backend: http://localhost:4000
  • MongoDB: mongodb://localhost:27017/chatapp

The Compose file starts all required services together:

  • frontend as a Vite container
  • backend as a Node/Express container
  • mongo with a persistent mongo-data volume

Stop everything with:

docker compose down

Remove containers and database volume with:

docker compose down -v

Local Development Without Docker

  1. Copy the backend environment file:

    cp Backend/.env.example Backend/.env
    
  2. Start MongoDB locally or with Docker.

  3. Start the backend:

    cd Backend && npm run dev
    

The backend tries MongoDB at mongodb://127.0.0.1:27017/chatapp first and falls back to Backend/data/db.json only if MongoDB is unavailable. Use DATA_STORE=mongo to fail fast on MongoDB errors, or DATA_STORE=json to force the JSON store.