mongog setup
This commit is contained in:
236
.github/copilot-instructions.md
vendored
236
.github/copilot-instructions.md
vendored
@@ -1,162 +1,112 @@
|
||||
<!-- BMAD:START -->
|
||||
# Grateful Journal — Project Instructions for Copilot
|
||||
|
||||
# BMAD Method — Project Instructions
|
||||
## Project Overview
|
||||
|
||||
## Project Configuration
|
||||
**Grateful Journal** — A minimal, private-first gratitude journaling web app. Three main pages (Write, History/calendar, Settings/profile) plus Google auth. No feeds or algorithms; privacy by design with client-side encryption; daily use, even one sentence.
|
||||
|
||||
- **Project**: grateful-journal
|
||||
- **User**: Jeet
|
||||
- **Communication Language**: English
|
||||
- **Document Output Language**: English
|
||||
- **User Skill Level**: intermediate
|
||||
- **Output Folder**: {project-root}/\_bmad-output
|
||||
- **Planning Artifacts**: {project-root}/\_bmad-output/planning-artifacts
|
||||
- **Implementation Artifacts**: {project-root}/\_bmad-output/implementation-artifacts
|
||||
- **Project Knowledge**: {project-root}/docs
|
||||
|
||||
## BMAD Runtime Structure
|
||||
|
||||
- **Agent definitions**: `_bmad/bmm/agents/` (BMM module) and `_bmad/core/agents/` (core)
|
||||
- **Workflow definitions**: `_bmad/bmm/workflows/` (organized by phase)
|
||||
- **Core tasks**: `_bmad/core/tasks/` (help, editorial review, indexing, sharding, adversarial review)
|
||||
- **Core workflows**: `_bmad/core/workflows/` (brainstorming, party-mode, advanced-elicitation)
|
||||
- **Workflow engine**: `_bmad/core/tasks/workflow.xml` (executes YAML-based workflows)
|
||||
- **Module configuration**: `_bmad/bmm/config.yaml`
|
||||
- **Core configuration**: `_bmad/core/config.yaml`
|
||||
- **Agent manifest**: `_bmad/_config/agent-manifest.csv`
|
||||
- **Workflow manifest**: `_bmad/_config/workflow-manifest.csv`
|
||||
- **Help manifest**: `_bmad/_config/bmad-help.csv`
|
||||
- **Agent memory**: `_bmad/_memory/`
|
||||
|
||||
## Key Conventions
|
||||
|
||||
- Always load `_bmad/bmm/config.yaml` before any agent activation or workflow execution
|
||||
- Store all config fields as session variables: `{user_name}`, `{communication_language}`, `{output_folder}`, `{planning_artifacts}`, `{implementation_artifacts}`, `{project_knowledge}`
|
||||
- MD-based workflows execute directly — load and follow the `.md` file
|
||||
- YAML-based workflows require the workflow engine — load `workflow.xml` first, then pass the `.yaml` config
|
||||
- Follow step-based workflow execution: load steps JIT, never multiple at once
|
||||
- Save outputs after EACH step when using the workflow engine
|
||||
- The `{project-root}` variable resolves to the workspace root at runtime
|
||||
|
||||
## Available Agents
|
||||
|
||||
| Agent | Persona | Title | Capabilities |
|
||||
| ------------------- | ----------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
||||
| bmad-master | BMad Master | BMad Master Executor, Knowledge Custodian, and Workflow Orchestrator | runtime resource management, workflow orchestration, task execution, knowledge custodian |
|
||||
| analyst | Mary | Business Analyst | market research, competitive analysis, requirements elicitation, domain expertise |
|
||||
| architect | Winston | Architect | distributed systems, cloud infrastructure, API design, scalable patterns |
|
||||
| dev | Amelia | Developer Agent | story execution, test-driven development, code implementation |
|
||||
| pm | John | Product Manager | PRD creation, requirements discovery, stakeholder alignment, user interviews |
|
||||
| qa | Quinn | QA Engineer | test automation, API testing, E2E testing, coverage analysis |
|
||||
| quick-flow-solo-dev | Barry | Quick Flow Solo Dev | rapid spec creation, lean implementation, minimum ceremony |
|
||||
| sm | Bob | Scrum Master | sprint planning, story preparation, agile ceremonies, backlog management |
|
||||
| tech-writer | Paige | Technical Writer | documentation, Mermaid diagrams, standards compliance, concept explanation |
|
||||
| ux-designer | Sally | UX Designer | user research, interaction design, UI patterns, experience strategy |
|
||||
|
||||
## Slash Commands
|
||||
|
||||
When the user's message starts with a `/bmad-` command (with or without additional text), execute it by following the steps below. Always load `_bmad/bmm/config.yaml` first and store config as session variables, then load and follow the referenced file exactly.
|
||||
|
||||
### Workflow Commands
|
||||
|
||||
| Command | Action |
|
||||
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `/bmad-help` | Load and follow `_bmad/core/tasks/help.md` |
|
||||
| `/bmad-brainstorming` | Load and follow `_bmad/core/workflows/brainstorming/workflow.md` |
|
||||
| `/bmad-party-mode` | Load and follow `_bmad/core/workflows/party-mode/workflow.md` |
|
||||
| `/bmad-bmm-create-product-brief` | Load and follow `_bmad/bmm/workflows/1-analysis/create-product-brief/workflow.md` |
|
||||
| `/bmad-bmm-market-research` | Load and follow `_bmad/bmm/workflows/1-analysis/research/workflow-market-research.md` |
|
||||
| `/bmad-bmm-domain-research` | Load and follow `_bmad/bmm/workflows/1-analysis/research/workflow-domain-research.md` |
|
||||
| `/bmad-bmm-technical-research` | Load and follow `_bmad/bmm/workflows/1-analysis/research/workflow-technical-research.md` |
|
||||
| `/bmad-bmm-create-prd` | Load and follow `_bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-create-prd.md` |
|
||||
| `/bmad-bmm-edit-prd` | Load and follow `_bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-edit-prd.md` |
|
||||
| `/bmad-bmm-validate-prd` | Load and follow `_bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-validate-prd.md` |
|
||||
| `/bmad-bmm-create-ux-design` | Load and follow `_bmad/bmm/workflows/2-plan-workflows/create-ux-design/workflow.md` |
|
||||
| `/bmad-bmm-create-architecture` | Load and follow `_bmad/bmm/workflows/3-solutioning/create-architecture/workflow.md` |
|
||||
| `/bmad-bmm-create-epics-and-stories` | Load and follow `_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/workflow.md` |
|
||||
| `/bmad-bmm-check-implementation-readiness` | Load and follow `_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/workflow.md` |
|
||||
| `/bmad-bmm-sprint-planning` | Load `_bmad/core/tasks/workflow.xml` (engine), then execute `_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.yaml` |
|
||||
| `/bmad-bmm-sprint-status` | Load `_bmad/core/tasks/workflow.xml` (engine), then execute `_bmad/bmm/workflows/4-implementation/sprint-status/workflow.yaml` |
|
||||
| `/bmad-bmm-create-story` | Load `_bmad/core/tasks/workflow.xml` (engine), then execute `_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml` |
|
||||
| `/bmad-bmm-dev-story` | Load `_bmad/core/tasks/workflow.xml` (engine), then execute `_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml` |
|
||||
| `/bmad-bmm-code-review` | Load `_bmad/core/tasks/workflow.xml` (engine), then execute `_bmad/bmm/workflows/4-implementation/code-review/workflow.yaml` |
|
||||
| `/bmad-bmm-retrospective` | Load `_bmad/core/tasks/workflow.xml` (engine), then execute `_bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml` |
|
||||
| `/bmad-bmm-correct-course` | Load `_bmad/core/tasks/workflow.xml` (engine), then execute `_bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml` |
|
||||
| `/bmad-bmm-qa-automate` | Load `_bmad/core/tasks/workflow.xml` (engine), then execute `_bmad/bmm/workflows/qa/automate/workflow.yaml` |
|
||||
| `/bmad-bmm-quick-spec` | Load and follow `_bmad/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md` |
|
||||
| `/bmad-bmm-quick-dev` | Load and follow `_bmad/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md` |
|
||||
| `/bmad-bmm-document-project` | Load `_bmad/core/tasks/workflow.xml` (engine), then execute `_bmad/bmm/workflows/document-project/workflow.yaml` |
|
||||
| `/bmad-bmm-generate-project-context` | Load and follow `_bmad/bmm/workflows/generate-project-context/workflow.md` |
|
||||
| `/bmad-index-docs` | Load and execute `_bmad/core/tasks/index-docs.xml` |
|
||||
| `/bmad-shard-doc` | Load and execute `_bmad/core/tasks/shard-doc.xml` |
|
||||
| `/bmad-editorial-review-prose` | Load and execute `_bmad/core/tasks/editorial-review-prose.xml` |
|
||||
| `/bmad-editorial-review-structure` | Load and execute `_bmad/core/tasks/editorial-review-structure.xml` |
|
||||
| `/bmad-review-adversarial-general` | Load and execute `_bmad/core/tasks/review-adversarial-general.xml` |
|
||||
| `/bmad-bmm-write-document` | Load `_bmad/bmm/agents/tech-writer/tech-writer.md`, activate Paige persona, execute Write Document (WD) |
|
||||
| `/bmad-bmm-update-standards` | Load `_bmad/bmm/agents/tech-writer/tech-writer.md`, activate Paige persona, execute Update Standards (US) |
|
||||
| `/bmad-bmm-mermaid-generate` | Load `_bmad/bmm/agents/tech-writer/tech-writer.md`, activate Paige persona, execute Mermaid Generate (MG) |
|
||||
| `/bmad-bmm-validate-document` | Load `_bmad/bmm/agents/tech-writer/tech-writer.md`, activate Paige persona, execute Validate Document (VD) |
|
||||
| `/bmad-bmm-explain-concept` | Load `_bmad/bmm/agents/tech-writer/tech-writer.md`, activate Paige persona, execute Explain Concept (EC) |
|
||||
|
||||
### Agent Activator Commands
|
||||
|
||||
| Command | Agent File |
|
||||
| --------------------------- | --------------------------------------------- |
|
||||
| `/bmad-bmad-master` | `_bmad/core/agents/bmad-master.md` |
|
||||
| `/bmad-analyst` | `_bmad/bmm/agents/analyst.md` |
|
||||
| `/bmad-architect` | `_bmad/bmm/agents/architect.md` |
|
||||
| `/bmad-dev` | `_bmad/bmm/agents/dev.md` |
|
||||
| `/bmad-pm` | `_bmad/bmm/agents/pm.md` |
|
||||
| `/bmad-qa` | `_bmad/bmm/agents/qa.md` |
|
||||
| `/bmad-quick-flow-solo-dev` | `_bmad/bmm/agents/quick-flow-solo-dev.md` |
|
||||
| `/bmad-sm` | `_bmad/bmm/agents/sm.md` |
|
||||
| `/bmad-tech-writer` | `_bmad/bmm/agents/tech-writer/tech-writer.md` |
|
||||
| `/bmad-ux-designer` | `_bmad/bmm/agents/ux-designer.md` |
|
||||
|
||||
For agent commands: load the agent file, follow ALL activation instructions, display the welcome/greeting, present the numbered menu, and wait for user input.
|
||||
**User:** Jeet
|
||||
|
||||
---
|
||||
|
||||
## Project Context Maintenance (Critical)
|
||||
## Technology Stack & Versions
|
||||
|
||||
**Purpose:** `project-context.md` serves as the single source of truth for the project state, implementation patterns, and active features.
|
||||
| Layer | Technology | Notes |
|
||||
| -------- | -------------------- | ----------------------------------------------------- |
|
||||
| Frontend | React 19, TypeScript | Vite 7 build; port 8000 |
|
||||
| Routing | react-router-dom 7 | Routes: `/`, `/history`, `/settings`, `/login` |
|
||||
| Auth | Firebase 12 | Google sign-in only (no database) |
|
||||
| Styling | Plain CSS | `src/index.css` (globals), `src/App.css` (components) |
|
||||
| Backend | FastAPI 0.104 | Python; port 8001; modular routes |
|
||||
| Database | MongoDB 6.x | Local instance; collections: users, entries, settings |
|
||||
|
||||
### When to Update `project-context.md`
|
||||
---
|
||||
|
||||
1. **After each feature implementation** — Update relevant sections:
|
||||
- Technology stack (versions)
|
||||
- Critical implementation rules (new patterns or constraints)
|
||||
- File layout (new files/folders)
|
||||
- Known issues or deferred work
|
||||
## Critical Implementation Rules
|
||||
|
||||
2. **When user announces new features** — Immediately add to the file:
|
||||
- Feature description in project overview
|
||||
- Any new technology or dependency
|
||||
- Updated file structure (if applicable)
|
||||
- New implementation rules or conventions
|
||||
- Status of feature (e.g., _In Progress_, _Planned_, _Complete_)
|
||||
### Frontend
|
||||
|
||||
3. **Before starting implementation** — Ensure the file reflects current state
|
||||
- Validate that all recent changes are documented
|
||||
- Flag any deferred work or known blockers
|
||||
- Cross-reference with current codebase
|
||||
- **Colour palette (Coolors):** Use CSS variables from `src/index.css`. Primary green `#1be62c`, background soft `#f1eee1`, surface `#ffffff`, accent light `#cff2dc`, accent bright `#c3fd2f`. Do not introduce new palette colours without reason.
|
||||
- **Layout:** Responsive for all screens. Breakpoints: `--bp-sm` 480px, `--bp-md` 768px, `--bp-lg` 1024px, `--bp-xl` 1280px. On laptop (1024px+), page is single-screen 100vh — no vertical scroll; fonts and spacing scaled so content fits one viewport.
|
||||
- **Touch targets:** Minimum 44px (`--touch-min`) on interactive elements for small screens.
|
||||
- **Safe areas:** Use `env(safe-area-inset-*)` for padding where the app can sit under notches or system UI. Viewport meta includes `viewport-fit=cover`.
|
||||
- **Structure:** Main app layout: page container → header + main content + fixed `BottomNav`. Content max-width `min(680px, 100%)` (or `--content-max` 720px where appropriate).
|
||||
|
||||
### Format Rules
|
||||
### Backend
|
||||
|
||||
- **Last updated:** Always update the timestamp at the bottom: `_Last updated: [YYYY-MM-DD]_`
|
||||
- **Feature status markers:** Use `_Planning_`, `_In Progress_`, `_Complete)_`, `_Deferred_`
|
||||
- **Keep it concise:** One-line descriptions; refer to external docs for details
|
||||
- **Match codebase reality:** If the code differs from the document, the document is wrong—fix it immediately
|
||||
- **Framework:** FastAPI. APIs in Python only.
|
||||
- **Modularity:** Separate file per route. Each feature (users, entries) has its own router module.
|
||||
- **Database:** MongoDB. Setup instructions in `docs/MONGODB_SETUP.md`.
|
||||
- **Port:** 8001 (backend); 8000 (frontend). CORS configured between them.
|
||||
- **Authentication:** Relies on Firebase Google Auth token from frontend (passed in Authorization header).
|
||||
|
||||
### Example Updates
|
||||
### Conventions
|
||||
|
||||
When user says: "Add dark mode toggle to settings"
|
||||
- **Fonts:** Inter for UI, Playfair Display for headings/editorial, Lora for body/entry text. Loaded via Google Fonts in `index.html`.
|
||||
- **Naming:** CSS uses BEM-like class names (e.g. `.journal-card`, `.journal-prompt`). Keep the same pattern for new components.
|
||||
- **Build:** Fixing the current TypeScript/ESLint build errors is deferred to a later step; do not assume a clean build when adding features.
|
||||
|
||||
```markdown
|
||||
| Feature | Status | Notes |
|
||||
| Dark mode toggle | In Progress | Added to SettingsPage; CSS variables predefined |
|
||||
---
|
||||
|
||||
## File Layout (Reference)
|
||||
|
||||
```
|
||||
src/ # Frontend
|
||||
App.tsx, App.css # Root layout, routes, global page styles
|
||||
index.css # Resets, :root vars, base typography
|
||||
main.tsx
|
||||
pages/ # HomePage, HistoryPage, SettingsPage, LoginPage
|
||||
components/ # BottomNav, LoginCard, GoogleSignInButton, ProtectedRoute
|
||||
contexts/ # AuthContext (Firebase Google Auth)
|
||||
lib/
|
||||
firebase.ts # Firebase auth config (Firestore removed)
|
||||
|
||||
backend/ # FastAPI backend (Port 8001)
|
||||
main.py # FastAPI app, CORS, routes, lifespan
|
||||
config.py # Settings, environment variables
|
||||
db.py # MongoDB connection manager
|
||||
models.py # Pydantic models (User, JournalEntry, Settings)
|
||||
requirements.txt # Python dependencies
|
||||
.env.example # Environment variables template
|
||||
routers/
|
||||
users.py # User registration, update, delete endpoints
|
||||
entries.py # Entry CRUD, date filtering endpoints
|
||||
```
|
||||
|
||||
When implementation is done: Update to `Complete` and add any implementation notes.
|
||||
---
|
||||
|
||||
<!-- BMAD:END -->
|
||||
## Recent Changes & Status
|
||||
|
||||
### Port Configuration (Updated)
|
||||
|
||||
✅ Frontend port changed to **8000** (was 5173)
|
||||
✅ Backend port remains **8001**
|
||||
✅ CORS configuration updated in FastAPI
|
||||
✅ Vite config updated with server port 8000
|
||||
|
||||
### Backend Setup (Completed)
|
||||
|
||||
✅ FastAPI backend initialized (port 8001)
|
||||
✅ MongoDB connection configured (local instance)
|
||||
✅ Pydantic models for User, JournalEntry, UserSettings
|
||||
✅ Route structure: `/api/users/*` and `/api/entries/*`
|
||||
✅ CORS enabled for frontend (localhost:8000)
|
||||
✅ Firestore database files removed (`firestoreService.ts`, `firestoreConfig.ts`)
|
||||
✅ Firebase authentication kept (Google sign-in only)
|
||||
|
||||
### API Ready
|
||||
|
||||
- User registration, profile updates, deletion
|
||||
- Entry CRUD (create, read, update, delete)
|
||||
- Entry filtering by date
|
||||
- Pagination support
|
||||
|
||||
### Next Steps (Implementation)
|
||||
|
||||
🔄 Connect frontend React app to backend APIs
|
||||
🔄 Pass Firebase user ID from frontend to backend
|
||||
🔄 Integrate Auth context with entry save/load
|
||||
🔄 Add optional: Firebase token verification in backend middleware
|
||||
|
||||
---
|
||||
|
||||
_Last updated: 2026-03-04_
|
||||
|
||||
Reference in New Issue
Block a user