This is an AI assistant application built with Convex and Convex Auth.
- Backend: Convex (database, server logic)
- Frontend: React with Vite
- UI: Tailwind CSS
- Authentication: Convex Auth
- Testing: Playwright-BDD for end-to-end testing
This project follows a Behavior-Driven Development (BDD) approach using Playwright-BDD. Every new feature follows this workflow:
Create a feature file in features/<feature-name>.feature describing the user story:
Feature: [name of the feature]
As a [type of user]
I want to [goal]
So that I can [reason]
Scenario: [name of the scenario]
Given I [initial context]
When I [action performed]
Then I should [expected outcome]Stop here to let the user validate and possibly modify the feature file. Only continue when they given them permission to.
Run the following command to generate a test skeleton:
npm run bddgenThis will create a skeleton test file in tests/steps/<feature-name>.steps.ts.
Following Test-Driven Development principles, implement the test steps using Playwright:
import { createBdd } from 'playwright-bdd';
import { expect } from '@playwright/test';
const { Given, When, Then } = createBdd();
Given('I am on the login page', async ({ page }) => {
await page.goto('/login');
await expect(page.locator('text=Log in')).toBeVisible();
});
// ... implement remaining stepsnpm run testThe test should fail since the feature hasn't been implemented yet.
Build the actual feature to make the test pass.
Run both linting and tests to ensure code quality:
npm run lint
npm run test- Node.js (v18 or higher)
- npm
npm installnpm run dev# Run all tests
npm run test
# Lint code
npm run lint├── features/ # Gherkin feature files
├── tests/
│ └── steps/ # Playwright-BDD step definitions
├── convex/ # Convex backend functions
├── src/ # React frontend code
└── package.json
When adding new features:
- Always start with a Gherkin feature file
- Use BDD to drive the implementation
- Ensure all tests pass before committing
- Follow the existing code style and conventions