Mommy
Mommy (hereinafter the βApplicationβ) is a web-based application that provides users with supportive and loving messages, optionally personalized with their name. The Application uses a Fastify-based backend server that serves both a landing page and an API endpoint, delivering encouraging phrases with configurable βmommyβ personas. It is designed for ease of use, accessibility, and providing emotional support through positive reinforcement.
1. User Documentation
How to Use Mommy
The Mommy application provides a simple web interface for receiving encouraging messages:
- Visit the Application: Navigate to the Mommy web application in your browser
- Optional Name Entry: Enter your name in the text field if youβd like personalized messages
- Request Love: Click the βI need some loveβ¦β button to receive an encouraging message
- Receive Your Message: A supportive phrase will appear, personalized with your name if provided
Features
- Personalized Messages: Over 100 unique encouraging phrases that can be personalized with your name
- Accessibility-Focused Design: Uses OpenDyslexic font and high-contrast styling for better readability
- Mobile-Friendly: Responsive design that works on all device sizes
- No Registration Required: Instant access without any account creation
API Endpoint
The application also provides a simple API:
- Endpoint:
/api
- Method: GET
- Optional Parameter:
name
(string) - Your name for personalization - Response: Plain text encouraging message
Example: GET /api?name=Alex
returns a personalized encouraging message.
2. Technical Documentation
Architecture Overview
Mommy is built using:
- Backend: Fastify web framework (Node.js/TypeScript)
- Frontend: Vanilla HTML/CSS/JavaScript (no frameworks)
- Configuration: Modular phrase and persona configuration files
Project Structure
src/βββ index.ts # Main server entry pointβββ config/β βββ html.ts # HTML template for landing pageβ βββ mommy.ts # Mommy persona names ("your mommy", "mama", etc.)β βββ phrases.ts # 100+ encouraging phrase templates
Server Implementation
The application uses Fastify to serve:
- Landing Page (
/
): Returns the complete HTML interface - API Endpoint (
/api
): Returns personalized encouraging messages
Message Generation
Messages are generated by:
- Randomly selecting a phrase template from
phrases.ts
- Randomly selecting a βmommyβ persona from
mommy.ts
- Interpolating
{{ name }}
and{{ mommy }}
variables in the template - Converting to lowercase and returning as plain text
Installation and Setup
Prerequisites
- Node.js (18+ recommended)
- pnpm package manager
Development Setup
# Install dependenciespnpm install
# Run in development mode with auto-reloadpnpm dev
# Build for productionpnpm build
# Run production serverpnpm start
# Run testspnpm test
# Lint codepnpm lint
Production Deployment
The server listens on port 8008 by default. For production deployment:
- Build the project:
pnpm build
- Start the server:
pnpm start
- Configure reverse proxy (nginx/Apache) if needed
Configuration
Adding New Phrases
Edit src/config/phrases.ts
to add new encouraging messages. Use:
{{ name }}
for userβs name interpolation{{ mommy }}
for mommy persona interpolation
Adding New Mommy Personas
Edit src/config/mommy.ts
to add new ways mommy refers to herself.
Testing
The project includes comprehensive tests using Vitest:
- Server endpoint testing
- Configuration validation
- Phrase uniqueness verification
- HTML response validation
3. Legal Documentation
License
This software is licensed under Naomiβs Public License. Copyright held by Naomi Carrigan.
Privacy
The application:
- Does not store user data persistently
- Does not use cookies or tracking
- Processes names only for message personalization
- Does not log personal information
Content Policy
All phrases are designed to be:
- Supportive and encouraging
- Appropriate for all ages
- Non-discriminatory
- Focused on positive reinforcement
4. Contributing Documentation
Development Workflow
- Fork and Clone: Fork the repository and clone your fork
- Install Dependencies: Run
pnpm install
- Create Feature Branch:
git checkout -b feature/your-feature
- Make Changes: Implement your changes with tests
- Test: Run
pnpm test
andpnpm lint
- Commit: Use conventional commit messages
- Pull Request: Submit PR with clear description
Code Standards
- TypeScript: Strict typing enabled
- ESLint: Uses @nhcarrigan/eslint-config
- Testing: Vitest with coverage requirements
- Documentation: JSDoc comments for all functions
Adding Content
New Encouraging Phrases
To add new phrases to src/config/phrases.ts
:
- Follow the existing template format
- Use
{{ name }}
and{{ mommy }}
placeholders - Keep messages positive and supportive
- Ensure phrases are appropriate for all audiences
- Add tests to verify uniqueness
New Mommy Personas
To add new personas to src/config/mommy.ts
:
- Add family-friendly terms
- Ensure they work grammatically in all phrase templates
- Test with existing phrases
Testing Guidelines
- All new features must include tests
- Maintain 100% test coverage
- Test both success and error cases
- Verify phrase interpolation works correctly
Submission Guidelines
- Follow existing code style
- Include tests for new functionality
- Update documentation as needed
- Ensure all checks pass before submitting