254 lines
6.0 KiB
Markdown
254 lines
6.0 KiB
Markdown
<!-- Powered by BMAD™ Core -->
|
|
|
|
# Create Preface
|
|
|
|
---
|
|
|
|
task:
|
|
id: create-preface
|
|
name: Create Preface
|
|
description: Write compelling book preface that sets expectations and connects with readers
|
|
persona_default: book-analyst
|
|
inputs:
|
|
|
|
- book-outline
|
|
- target-audience
|
|
- learning-objectives
|
|
steps:
|
|
- Review preface template
|
|
- Define target audience clearly
|
|
- Explain what readers will learn (high-level outcomes)
|
|
- State prerequisites assumed
|
|
- Describe book organization (parts, structure)
|
|
- List code repository and resources
|
|
- Explain conventions used (code formatting, callouts)
|
|
- Write acknowledgments
|
|
- Add personal note if desired
|
|
- Keep concise (2-4 pages max)
|
|
- Use template preface-tmpl.yaml with create-doc.md
|
|
output: front-matter/preface.md
|
|
|
|
---
|
|
|
|
## Purpose
|
|
|
|
Create a preface that helps readers understand who the book is for, what they'll learn, and how to use it effectively.
|
|
|
|
## Workflow Steps
|
|
|
|
### 1. Define Target Audience
|
|
|
|
Be specific:
|
|
|
|
```markdown
|
|
## Who This Book Is For
|
|
|
|
This book is designed for:
|
|
|
|
✅ **Software developers** with 1-2 years of experience who want to master API development
|
|
✅ **Backend engineers** transitioning to API-first architectures
|
|
✅ **Full-stack developers** looking to strengthen their API design skills
|
|
|
|
You'll get the most from this book if you have:
|
|
- Working knowledge of Python or JavaScript
|
|
- Basic understanding of HTTP and web concepts
|
|
- Familiarity with command line tools
|
|
|
|
This book may not be for you if:
|
|
❌ You're brand new to programming (start with Python/JavaScript fundamentals)
|
|
❌ You're looking for advanced distributed systems architecture (this focuses on API basics and intermediate patterns)
|
|
```
|
|
|
|
### 2. Explain Learning Outcomes
|
|
|
|
High-level goals:
|
|
|
|
```markdown
|
|
## What You'll Learn
|
|
|
|
By the end of this book, you'll be able to:
|
|
|
|
1. **Design RESTful APIs** that follow industry best practices
|
|
2. **Implement authentication** using JWT and OAuth 2.0
|
|
3. **Build GraphQL schemas** and resolvers
|
|
4. **Handle errors gracefully** with consistent error responses
|
|
5. **Optimize API performance** with caching and rate limiting
|
|
6. **Deploy APIs to production** on AWS, Heroku, or Docker
|
|
7. **Document APIs** using OpenAPI/Swagger
|
|
|
|
You'll build real-world projects including:
|
|
- Task management API (REST)
|
|
- E-commerce backend (GraphQL)
|
|
- Real-time chat API (WebSockets)
|
|
```
|
|
|
|
### 3. State Prerequisites
|
|
|
|
Be honest about assumptions:
|
|
|
|
```markdown
|
|
## Prerequisites
|
|
|
|
**Required:**
|
|
- Python 3.10+ or Node.js 18+ installed
|
|
- Basic HTTP knowledge (GET, POST, status codes)
|
|
- Comfortable with command line
|
|
- Text editor or IDE
|
|
|
|
**Helpful but not required:**
|
|
- SQL database experience
|
|
- Git version control
|
|
- Basic Docker knowledge
|
|
```
|
|
|
|
### 4. Describe Book Organization
|
|
|
|
Help readers navigate:
|
|
|
|
```markdown
|
|
## How This Book Is Organized
|
|
|
|
This book is organized into three parts:
|
|
|
|
**Part 1: Foundations (Chapters 1-4)**
|
|
Covers REST fundamentals, HTTP, and basic API design. Read these chapters in order.
|
|
|
|
**Part 2: Intermediate Patterns (Chapters 5-8)**
|
|
Authentication, error handling, testing, and documentation. Mostly independent chapters.
|
|
|
|
**Part 3: Production Readiness (Chapters 9-12)**
|
|
Performance, security, deployment, and monitoring. Builds on earlier chapters.
|
|
|
|
**Appendices:**
|
|
- A: API design checklist
|
|
- B: HTTP status codes reference
|
|
- C: Exercise solutions
|
|
|
|
### Reading Paths
|
|
|
|
**Linear (Recommended for Beginners):**
|
|
Read chapters 1-12 in order.
|
|
|
|
**Fast Track (Experienced Developers):**
|
|
Chapters 1, 3, 5, 7, 9-12 (skip basics).
|
|
|
|
**Reference Use:**
|
|
Jump to specific topics as needed; each chapter is as self-contained as possible.
|
|
```
|
|
|
|
### 5. List Resources
|
|
|
|
Make code accessible:
|
|
|
|
```markdown
|
|
## Code and Resources
|
|
|
|
### Code Repository
|
|
All code examples: https://github.com/author/book-code
|
|
|
|
### Book Website
|
|
https://masteringwebapis.com
|
|
- Errata and updates
|
|
- Additional resources
|
|
- Community forum
|
|
|
|
### Author Contact
|
|
- Twitter: @authorhandle
|
|
- Email: author@example.com
|
|
- Newsletter: [signup link]
|
|
```
|
|
|
|
### 6. Explain Conventions
|
|
|
|
Set expectations:
|
|
|
|
```markdown
|
|
## Conventions Used in This Book
|
|
|
|
### Code Examples
|
|
|
|
```python
|
|
# Code examples look like this
|
|
def hello_world():
|
|
return "Hello, World!"
|
|
```
|
|
|
|
### Callouts
|
|
|
|
💡 **Tip**: Helpful suggestions and best practices
|
|
|
|
⚠️ **Warning**: Common pitfalls to avoid
|
|
|
|
📝 **Note**: Additional context or clarification
|
|
|
|
### Chapter Structure
|
|
|
|
Each chapter includes:
|
|
- Learning objectives
|
|
- Code examples with explanations
|
|
- Exercises (solutions in Appendix C)
|
|
- Summary and key takeaways
|
|
```
|
|
|
|
### 7. Write Acknowledgments
|
|
|
|
Thank contributors:
|
|
|
|
```markdown
|
|
## Acknowledgments
|
|
|
|
This book wouldn't exist without:
|
|
|
|
- **Technical reviewers**: [Names] who caught errors and improved clarity
|
|
- **Manning staff**: [Editor names] for guidance and support
|
|
- **Beta readers**: The MEAP community for invaluable feedback
|
|
- **My family**: [Personal thanks]
|
|
- **Open source community**: For the amazing tools and libraries
|
|
|
|
Special thanks to [specific acknowledgments].
|
|
```
|
|
|
|
### 8. Add Personal Note
|
|
|
|
Connect with readers:
|
|
|
|
```markdown
|
|
## A Note from the Author
|
|
|
|
I started learning about APIs five years ago, frustrated by incomplete documentation
|
|
and scattered resources. This book is what I wish I had back then: a comprehensive,
|
|
practical guide with working examples.
|
|
|
|
My goal is not just to teach you API syntax, but to help you think like an API designer.
|
|
Every example is tested, every pattern is battle-proven, and every chapter builds toward
|
|
real-world competence.
|
|
|
|
I hope this book accelerates your journey and helps you build APIs that developers love to use.
|
|
|
|
Happy coding!
|
|
|
|
[Author Name]
|
|
```
|
|
|
|
### 9. Keep Concise
|
|
|
|
Target length: 2-4 pages (1000-2000 words)
|
|
|
|
## Success Criteria
|
|
|
|
- [ ] Target audience clearly defined
|
|
- [ ] Learning outcomes specific and achievable
|
|
- [ ] Prerequisites stated honestly
|
|
- [ ] Book organization explained
|
|
- [ ] Code repository and resources listed
|
|
- [ ] Conventions documented
|
|
- [ ] Acknowledgments included
|
|
- [ ] Length: 2-4 pages
|
|
- [ ] Personal and engaging tone
|
|
|
|
## Next Steps
|
|
|
|
1. Include preface in front matter
|
|
2. Update as book evolves
|
|
3. Get feedback from beta readers
|