Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new pattern: create_recursive_outline. #852

Merged

Conversation

rdegges
Copy link
Contributor

@rdegges rdegges commented Aug 21, 2024

This pattern is actually based on this incredibly great article: https://learnhowtolearn.org/how-to-build-extremely-quickly/

The idea is to use this pattern whenever you want to break an idea or task down into small components, fully fleshing out your own TODO list of things to implement to get it working.

This applies to things like writing articles/papers, creating applications, and much more.

This pattern is actually based on this incredibly great article: https://learnhowtolearn.org/how-to-build-extremely-quickly/

The idea is to use this pattern whenever you want to break an idea or
task down into small components, fully fleshing out your own TODO list
of things to implement to get it working.

This applies to things like writing articles/papers, creating
applications, and much more.
@LaBalaDeOro
Copy link

Sweet pattern and link! I downloaded it from your fork and will give it a try. Any test case?

@rdegges
Copy link
Contributor Author

rdegges commented Aug 25, 2024

@LaBalaDeOro, sure! I'm using it all the time. Example:

echo "I'd like to write about article about the pros and cons of JSON Web Token usage for developers." | fabric -sp create_recursive_outline
# JSON Web Tokens (JWTs) for Developers: Pros and Cons

## Introduction
- Brief explanation of JSON Web Tokens
- Importance of understanding JWTs for developers

## 1. Pros of Using JWTs

### A. Stateless Authentication
- Explanation of stateless nature
- Reduced server-side storage requirements
- Scalability benefits

### B. Cross-domain / CORS
- Ease of use in distributed systems
- Simplification of CORS (Cross-Origin Resource Sharing)

### C. Performance
- Reduced database lookups
- Faster authentication process

### D. Flexibility and Extensibility
- Customizable claims
- Support for various algorithms

### E. Mobile-friendly
- Compact size
- Efficient for mobile applications

## 2. Cons of Using JWTs

### A. Token Size
- Larger than traditional session tokens
- Potential bandwidth issues

### B. Security Considerations
- Token storage on client-side
- Risks of XSS (Cross-Site Scripting) attacks

### C. Token Revocation Challenges
- Difficulty in invalidating tokens before expiration
- Potential security risks

### D. Complexity
- Learning curve for proper implementation
- Potential for misuse if not understood correctly

### E. Data Overhead
- Repeated data in each request
- Increased payload size

## 3. Best Practices for JWT Implementation

### A. Proper Token Storage
- Secure storage methods
- Avoiding localStorage

### B. Token Expiration
- Setting appropriate expiration times
- Implementing refresh token mechanisms

### C. HTTPS Usage
- Importance of encrypted connections
- Preventing man-in-the-middle attacks

### D. Payload Considerations
- Limiting sensitive data in tokens
- Balancing information and token size

## Conclusion
- Recap of main pros and cons
- Importance of considering specific use cases
- Final thoughts on JWT usage in development

## Additional Resources
- Links to further reading
- Official JWT documentation
- Security best practices guides%                                                                                                                                     

Here's another example for programming (been using this a lot):

echo "I'd like to create a simple TODO-list application using Python and Flask that is production-ready." | fabric -sp create_recursive_outline
# Production-Ready TODO-List Application with Python and Flask

## Introduction
This outline breaks down the process of creating a production-ready TODO-list application using Python and Flask. The application will allow users to create, read, update, and delete tasks in a web-based interface.

## Project Outline

- **Project Setup**
  - Create a new directory for the project
  - Set up a virtual environment
  - Install necessary dependencies (Flask, SQLAlchemy, etc.)
  - Initialize a Git repository

- **Backend Development**
  - **Flask Application Setup**
    - Create main application file (app.py)
    - Configure Flask application
    - Set up database connection (SQLAlchemy)

  - **Database Model**
    - Design TODO item model
      - Fields: id, title, description, created_at, updated_at, completed
    - Create database migration scripts

  - **API Development**
    - Implement CRUD operations for TODO items
      - Create new TODO item
      - Retrieve all TODO items
      - Retrieve a single TODO item
      - Update a TODO item
      - Delete a TODO item
    - Implement error handling and input validation

- **Frontend Development**
  - **HTML Templates**
    - Create base template
    - Create template for listing all TODO items
    - Create template for adding/editing a TODO item

  - **Static Files**
    - Create CSS file for styling
    - Create JavaScript file for dynamic interactions

  - **User Interface**
    - Implement form for adding new TODO items
    - Display list of existing TODO items
    - Add buttons for editing and deleting TODO items
    - Implement task completion toggle

- **Testing**
  - **Unit Tests**
    - Write tests for database models
    - Write tests for API endpoints

  - **Integration Tests**
    - Test the interaction between frontend and backend

- **Deployment Preparation**
  - **Environment Configuration**
    - Set up configuration files for different environments (development, testing, production)
    - Implement environment variable handling

  - **Database Migration**
    - Prepare database migration scripts for production

  - **Logging**
    - Implement proper logging for the application

  - **Security Measures**
    - Implement CSRF protection
    - Ensure secure handling of user input

- **Documentation**
  - Write README file with setup and running instructions
  - Document API endpoints

- **Deployment**
  - Choose a hosting platform (e.g., Heroku, AWS, DigitalOcean)
  - Set up production database
  - Configure web server (e.g., Gunicorn)
  - Deploy the application
  - Set up monitoring and error tracking

- **Post-Deployment**
  - Perform final testing on the live application
  - Set up backup and recovery procedures
  - Implement a system for gathering user feedback

This outline provides a comprehensive breakdown of the steps required to create a production-ready TODO-list application using Python and Flask. Each main component is broken down into actionable subtasks, ensuring that all aspects of development, testing, and deployment are covered.%                                               

@LaBalaDeOro
Copy link

@rdegges sweet! Thanks for sharing the pattern and your examples! Even though your pattern isn't in the official repo (yet) I've added it to my installation and plan to begin using it. 👍

@danielmiessler danielmiessler merged commit 9a3b341 into danielmiessler:main Sep 8, 2024
1 check passed
eugeis pushed a commit that referenced this pull request Oct 19, 2024
Adding new pattern: create_recursive_outline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants