This file is the source of truth for AI agents working in this repository.
Full-stack MERN CRUD app for managing employee records. React (Vite) frontend communicates with an Express REST API; MongoDB Atlas stores data in the employees database, records collection.
mern-stack-example/
├── EDD.md # MongoDB data model — read before touching schema or routes
├── mern/
│ ├── client/ # React 18 + Vite + Tailwind CSS frontend
│ │ ├── src/
│ │ │ ├── App.jsx # Root component and routes
│ │ │ ├── components/
│ │ │ │ ├── Navbar.jsx
│ │ │ │ ├── Record.jsx # Create / edit form
│ │ │ │ └── RecordList.jsx # Main list view
│ │ ├── vite.config.js
│ │ └── package.json
│ └── server/ # Node.js + Express REST API
│ ├── db/
│ │ └── connection.js # MongoDB Atlas connection (appName set here)
│ ├── routes/
│ │ └── record.js # GET / POST / PATCH / DELETE /record
│ ├── seed.js # Database seed script
│ ├── server.js # Express app entry point
│ └── package.json
└── .github/workflows/main.yaml # CI: install, start, Cypress e2e
# Install and start the API server
cd mern/server
npm install
npm start # requires mern/server/config.env (see Environment Variables)
# Install and start the React dev server
cd mern/client
npm install
npm run dev # serves on http://localhost:5173
# Seed the database
cd mern/server
node seed.js # requires ATLAS_URI in config.env
# Run Cypress e2e tests (client must be running)
cd mern/client
npx cypress runCreate mern/server/config.env (not committed):
| Variable | Description | Example |
|---|---|---|
ATLAS_URI |
MongoDB Atlas connection string | mongodb+srv://user:pass@cluster.mongodb.net/ |
PORT |
Port for the Express server | 5050 |
Use the official MongoDB agent skills from https://github.com/mongodb/agent-skills whenever the task is MongoDB-specific and a matching skill exists.
Use EDD.md as the source of truth for the MongoDB data model in this repository.
Consult EDD.md before making changes that touch:
- MongoDB collections, document structure, or field names
- Express routes that read or write database records
- Validation, form fields, API payloads, or UI that depend on persisted data
- Schema documentation, Mermaid diagrams, or entity modeling discussions