Skip to content

Commit 7e7d54d

Browse files
committed
[DOCS] add template inspection workflow (triggered at wednesday 00:00), add & edit inspection script's contents
1 parent dfec192 commit 7e7d54d

File tree

8 files changed

+485
-34
lines changed

8 files changed

+485
-34
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Weekly Template Inspection
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * 3"
6+
workflow_dispatch:
7+
inputs:
8+
templates:
9+
description: "Specific templates to inspect (comma-separated, leave empty for all)"
10+
required: false
11+
default: ""
12+
13+
jobs:
14+
inspect-templates:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: "3.12"
25+
26+
- name: Setup PDM
27+
uses: pdm-project/setup-pdm@v4
28+
29+
- name: Install dependencies
30+
run: pdm install -G dev
31+
32+
- name: Run template inspection
33+
run: |
34+
python scripts/inspect-templates.py --templates "${{ github.event.inputs.templates }}" --output template_inspection_results.json
35+
36+
- name: Upload inspection results
37+
uses: actions/upload-artifact@v4
38+
if: always() # Upload even if inspection fails
39+
with:
40+
name: template-inspection-results
41+
path: template_inspection_results.json
42+
retention-days: 30
43+
44+
- name: Create Issue on Failure
45+
if: failure()
46+
uses: actions/github-script@v7
47+
with:
48+
script: |
49+
const fs = require('fs');
50+
let resultsContent = "Inspection results not available.";
51+
52+
try {
53+
const results = JSON.parse(fs.readFileSync('template_inspection_results.json', 'utf8'));
54+
55+
resultsContent = `## 📊 Template Inspection Results
56+
57+
**Inspection Date:** ${results.inspection_date}
58+
**Total Templates:** ${results.total_templates}
59+
**✅ Passed:** ${results.passed_templates}
60+
**❌ Failed:** ${results.failed_templates}
61+
62+
### Failed Templates:
63+
`;
64+
65+
results.results.forEach(result => {
66+
if (!result.is_valid) {
67+
resultsContent += `\n#### ❌ ${result.template_name}\n`;
68+
if (result.errors && result.errors.length > 0) {
69+
resultsContent += "**Errors:**\n";
70+
result.errors.forEach(error => {
71+
resultsContent += `- ${error}\n`;
72+
});
73+
}
74+
if (result.warnings && result.warnings.length > 0) {
75+
resultsContent += "**Warnings:**\n";
76+
result.warnings.forEach(warning => {
77+
resultsContent += `- ${warning}\n`;
78+
});
79+
}
80+
}
81+
});
82+
83+
resultsContent += `\n---\n**Workflow:** [${context.workflow}](${context.payload.repository.html_url}/actions/runs/${context.runId})`;
84+
85+
} catch (error) {
86+
resultsContent += `\nError reading results: ${error.message}`;
87+
}
88+
89+
await github.rest.issues.create({
90+
owner: context.repo.owner,
91+
repo: context.repo.repo,
92+
title: `🚨 Weekly Template Inspection Failed - ${new Date().toISOString().split('T')[0]}`,
93+
body: resultsContent,
94+
labels: ['bug', 'template-inspection', 'automated']
95+
});
96+
97+
- name: Comment on Success
98+
if: success()
99+
uses: actions/github-script@v7
100+
with:
101+
script: |
102+
const fs = require('fs');
103+
104+
try {
105+
const results = JSON.parse(fs.readFileSync('template_inspection_results.json', 'utf8'));
106+
107+
console.log(`✅ Weekly template inspection completed successfully!`);
108+
console.log(`📊 Results: ${results.passed_templates}/${results.total_templates} templates passed`);
109+
console.log(`📄 Detailed results available in workflow artifacts`);
110+
111+
} catch (error) {
112+
console.log(`✅ Weekly template inspection completed successfully!`);
113+
console.log(`📄 Results available in workflow artifacts`);
114+
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# test workspace
22
tests/temp_test_workspace/
33

4+
# Template inspection results
5+
template_inspection_results.json
6+
47
# Coverage reports
58
htmlcov/
69
.coverage

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ test-coverage: ## Run tests with coverage report
3535
coverage: ## Alias for test-coverage
3636
$(MAKE) test-coverage
3737

38+
# Template inspection commands
39+
inspect-templates: ## Run template inspection on all templates
40+
python scripts/inspect-templates.py
41+
42+
inspect-templates-verbose: ## Run template inspection with verbose output
43+
python scripts/inspect-templates.py --verbose
44+
45+
inspect-template: ## Inspect specific template(s) - Usage: make inspect-template TEMPLATES="template-name"
46+
@if [ -z "$(TEMPLATES)" ]; then \
47+
echo "Usage: make inspect-template TEMPLATES=\"template-name1,template-name2\""; \
48+
echo "Example: make inspect-template TEMPLATES=\"fastapi-default,fastapi-async-crud\""; \
49+
exit 1; \
50+
fi
51+
python scripts/inspect-templates.py --templates "$(TEMPLATES)"
52+
3853
# Code quality commands
3954
lint: ## Run all linting checks
4055
@echo "Running isort check..."

README.md

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ This project was inspired by the `SpringBoot initializer` & Python Django's `dja
2121

2222
## Key Features
2323

24-
- **Immediate FastAPI project creation** : Super-fast FastAPI workspace & project creation via CLI, inspired by `django-admin`feature of [Python Django](https://github.com/django/django)
25-
- **Prettier CLI outputs** : beautiful CLI experiment ([rich library](https://github.com/Textualize/rich) feature)
26-
- **Standards-based FastAPI project template** : All FastAPI-fastkit templates are based on Python standards and FastAPI's common use
24+
- **⚡ Immediate FastAPI project creation** : Super-fast FastAPI workspace & project creation via CLI, inspired by `django-admin` feature of [Python Django](https://github.com/django/django)
25+
- **🎨 Prettier CLI outputs** : Beautiful CLI experience powered by [rich library](https://github.com/Textualize/rich)
26+
- **📋 Standards-based FastAPI project templates** : All FastAPI-fastkit templates are based on Python standards and FastAPI's common use patterns
27+
- **🔍 Automated template quality assurance** : Weekly automated testing ensures all templates remain functional and up-to-date
28+
- **🚀 Multiple project templates** : Choose from various pre-configured templates for different use cases (async CRUD, Docker, PostgreSQL, etc.)
2729

2830
## Installation
2931

@@ -239,43 +241,36 @@ $ fastkit list-templates
239241
└─────────────────────────┴───────────────────────────────────┘
240242
```
241243

242-
## Contributing
244+
## Documentation
243245

244-
We welcome contributions from the community! FastAPI-fastkit is designed to help newcomers to Python and FastAPI, and your contributions can make a significant impact.
246+
For comprehensive guides and detailed usage instructions, visit our documentation:
245247

246-
### For Contributors
248+
- 📚 **[User Guide](https://bnbong.github.io/FastAPI-fastkit/user-guide/quick-start/)** - Detailed installation and usage guides
249+
- 🎯 **[Tutorial](https://bnbong.github.io/FastAPI-fastkit/tutorial/getting-started/)** - Step-by-step tutorials for beginners
250+
- 📖 **[CLI Reference](https://bnbong.github.io/FastAPI-fastkit/user-guide/cli-reference/)** - Complete command reference
251+
- 🔍 **[Template Quality Assurance](https://bnbong.github.io/FastAPI-fastkit/reference/template-quality-assurance/)** - Automated testing and quality standards
247252

248-
If you want to contribute to this project, we've made it easy to get started:
253+
## Contributing
249254

250-
1. **Quick Development Setup:**
255+
We welcome contributions from the community! FastAPI-fastkit is designed to help newcomers to Python and FastAPI, and your contributions can make a significant impact.
251256

252-
fork or clone this repository:
257+
### Quick Start for Contributors
253258

259+
1. **Fork and clone the repository:**
254260
```bash
255261
git clone https://github.com/bnbong/FastAPI-fastkit.git
256262
cd FastAPI-fastkit
257-
make dev-setup
258263
```
259264

260-
2. **Available Development Commands:**
261-
262-
This project uses [Makefile](https://www.gnu.org/software/make/) to manage the development process.
263-
264-
You can use the following commands to help you get started:
265-
265+
2. **Set up development environment:**
266266
```bash
267-
make help # See all available commands
268-
make dev-check # Run all checks before submitting
269-
make quick-test # Quick test after changes
267+
make dev-setup # Sets up everything you need
270268
```
271269

272-
3. **Read our contribution guidelines:**
273-
274-
For other contribution guidelines, please refer to the following files:
275-
276-
- [CONTRIBUTING.md](CONTRIBUTING.md) - Detailed contribution guide
277-
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) - Project principles
278-
- [SECURITY.md](SECURITY.md) - Security guidelines
270+
3. **Run development checks:**
271+
```bash
272+
make dev-check # Format, lint, and test
273+
```
279274

280275
### What You Can Contribute
281276

@@ -285,13 +280,28 @@ For other contribution guidelines, please refer to the following files:
285280
- 🧪 **Tests** - Increase test coverage and add integration tests
286281
- 💡 **Features** - Suggest and implement new CLI features
287282

283+
### Contribution Guidelines
284+
285+
For detailed contribution guidelines, development setup, and project standards, please refer to:
286+
287+
- **[CONTRIBUTING.md](CONTRIBUTING.md)** - Comprehensive contribution guide
288+
- **[CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)** - Project principles and community standards
289+
- **[SECURITY.md](SECURITY.md)** - Security guidelines and reporting
290+
288291
## Significance of FastAPI-fastkit
289292

290293
FastAPI-fastkit aims to provide a fast and easy-to-use starter kit for new users of Python and FastAPI.
291294

292-
This idea was initiated with the aim of full fill to help FastAPI newcomers to learn from the beginning, which is the production significance of the FastAPI-cli package added with the [FastAPI 0.111.0 version update](https://github.com/fastapi/fastapi/releases/tag/0.111.0).
295+
This idea was initiated with the aim of helping FastAPI newcomers learn from the beginning, which aligns with the production significance of the FastAPI-cli package added with the [FastAPI 0.111.0 version update](https://github.com/fastapi/fastapi/releases/tag/0.111.0).
296+
297+
As someone who has been using and loving FastAPI for a long time, I wanted to develop a project that could help fulfill [the wonderful motivation](https://github.com/fastapi/fastapi/pull/11522#issuecomment-2264639417) that FastAPI developer [tiangolo](https://github.com/tiangolo) has expressed.
298+
299+
FastAPI-fastkit bridges the gap between getting started and building production-ready applications by providing:
293300

294-
As one person who has been using and loving FastAPI for a long time, I wanted to develop a project that could help me a little bit to practice [the wonderful motivation](https://github.com/fastapi/fastapi/pull/11522#issuecomment-2264639417) that FastAPI developer [tiangolo](https://github.com/tiangolo) has.
301+
- **Immediate productivity** for newcomers who might be overwhelmed by setup complexity
302+
- **Best practices** built into every template, helping users learn proper FastAPI patterns
303+
- **Scalable foundations** that grow with users as they advance from beginners to experts
304+
- **Community-driven templates** that reflect real-world FastAPI usage patterns
295305

296306
## License
297307

docs/index.md

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ This project was inspired by the `SpringBoot initializer` & Python Django's `dja
2121

2222
## Key Features
2323

24-
- **Immediate FastAPI project creation** : Super-fast FastAPI workspace & project creation via CLI, inspired by `django-admin`feature of [Python Django](https://github.com/django/django)
25-
- **Prettier CLI outputs** : beautiful CLI experiment ([rich library](https://github.com/Textualize/rich) feature)
26-
- **Standards-based FastAPI project template** : All FastAPI-fastkit templates are based on Python standards and FastAPI's common use
24+
- **⚡ Immediate FastAPI project creation** : Super-fast FastAPI workspace & project creation via CLI, inspired by `django-admin` feature of [Python Django](https://github.com/django/django)
25+
- **🎨 Prettier CLI outputs** : Beautiful CLI experience powered by [rich library](https://github.com/Textualize/rich)
26+
- **📋 Standards-based FastAPI project templates** : All FastAPI-fastkit templates are based on Python standards and FastAPI's common use patterns
27+
- **🔍 Automated template quality assurance** : Weekly automated testing ensures all templates remain functional and up-to-date
28+
- **🚀 Multiple project templates** : Choose from various pre-configured templates for different use cases (async CRUD, Docker, PostgreSQL, etc.)
2729

2830
## Installation
2931

@@ -259,13 +261,51 @@ $ fastkit list-templates
259261

260262
</div>
261263

264+
## Documentation
265+
266+
For comprehensive guides and detailed usage instructions, explore our documentation:
267+
268+
- 📚 **[User Guide](user-guide/quick-start.md)** - Detailed installation and usage guides
269+
- 🎯 **[Tutorial](tutorial/getting-started.md)** - Step-by-step tutorials for beginners
270+
- 📖 **[CLI Reference](user-guide/cli-reference.md)** - Complete command reference
271+
- 🔍 **[Template Quality Assurance](reference/template-quality-assurance.md)** - Automated testing and quality standards
272+
273+
## Contributing
274+
275+
We welcome contributions from the community! FastAPI-fastkit is designed to help newcomers to Python and FastAPI, and your contributions can make a significant impact.
276+
277+
### What You Can Contribute
278+
279+
- 🚀 **New FastAPI templates** - Add templates for different use cases
280+
- 🐛 **Bug fixes** - Help us improve stability and reliability
281+
- 📚 **Documentation** - Improve guides, examples, and translations
282+
- 🧪 **Tests** - Increase test coverage and add integration tests
283+
- 💡 **Features** - Suggest and implement new CLI features
284+
285+
### Getting Started with Contributing
286+
287+
To get started with contributing to FastAPI-fastkit, please refer to our comprehensive guides:
288+
289+
- **[Development Setup](contributing/development-setup.md)** - Complete guide for setting up your development environment
290+
- **[Code Guidelines](contributing/code-guidelines.md)** - Coding standards and best practices
291+
- **[CONTRIBUTING.md](https://github.com/bnbong/FastAPI-fastkit/blob/main/CONTRIBUTING.md)** - Comprehensive contribution guide
292+
- **[CODE_OF_CONDUCT.md](https://github.com/bnbong/FastAPI-fastkit/blob/main/CODE_OF_CONDUCT.md)** - Project principles and community standards
293+
- **[SECURITY.md](https://github.com/bnbong/FastAPI-fastkit/blob/main/SECURITY.md)** - Security guidelines and reporting
294+
262295
## Significance of FastAPI-fastkit
263296

264297
FastAPI-fastkit aims to provide a fast and easy-to-use starter kit for new users of Python and FastAPI.
265298

266-
This idea was initiated with the aim of full fill to help FastAPI newcomers to learn from the beginning, which is the production significance of the FastAPI-cli package added with the [FastAPI 0.111.0 version update](https://github.com/fastapi/fastapi/releases/tag/0.111.0).
299+
This idea was initiated with the aim of helping FastAPI newcomers learn from the beginning, which aligns with the production significance of the FastAPI-cli package added with the [FastAPI 0.111.0 version update](https://github.com/fastapi/fastapi/releases/tag/0.111.0).
300+
301+
As someone who has been using and loving FastAPI for a long time, I wanted to develop a project that could help fulfill [the wonderful motivation](https://github.com/fastapi/fastapi/pull/11522#issuecomment-2264639417) that FastAPI developer [tiangolo](https://github.com/tiangolo) has expressed.
302+
303+
FastAPI-fastkit bridges the gap between getting started and building production-ready applications by providing:
267304

268-
As one person who has been using and loving FastAPI for a long time, I wanted to develop a project that could help me a little bit to practice [the wonderful motivation](https://github.com/fastapi/fastapi/pull/11522#issuecomment-2264639417) that FastAPI developer [tiangolo](https://github.com/tiangolo) has.
305+
- **Immediate productivity** for newcomers who might be overwhelmed by setup complexity
306+
- **Best practices** built into every template, helping users learn proper FastAPI patterns
307+
- **Scalable foundations** that grow with users as they advance from beginners to experts
308+
- **Community-driven templates** that reflect real-world FastAPI usage patterns
269309

270310
## Next Steps
271311

@@ -288,11 +328,13 @@ Ready to get started with FastAPI-fastkit? Follow these next steps:
288328
Want to contribute to FastAPI-fastkit?
289329

290330
- **[Development Setup](contributing/development-setup.md)**: Set up your development environment
291-
- **[Contributing Guidelines](https://github.com/bnbong/FastAPI-fastkit/blob/main/CONTRIBUTING.md)**: Contribution guidelines
331+
- **[Code Guidelines](contributing/code-guidelines.md)**: Follow our coding standards and best practices
332+
- **[Contributing Guidelines](https://github.com/bnbong/FastAPI-fastkit/blob/main/CONTRIBUTING.md)**: Comprehensive contribution guide
292333

293334
### 🔍 Reference
294335

295336
- **[CLI Reference](user-guide/cli-reference.md)**: Complete CLI command reference
337+
- **[Template Quality Assurance](reference/template-quality-assurance.md)**: Automated testing and quality standards
296338
- **[FAQ](reference/faq.md)**: Frequently asked questions
297339
- **[GitHub Repository](https://github.com/bnbong/FastAPI-fastkit)**: Source code and issue tracking
298340

0 commit comments

Comments
 (0)