# Day 2: Tech Stack Decision and TDD
Published: 2023-10-31 15:45:31

## Day 2: Tech Stack Decision and Technical Design Documentation

Upon receiving the complete PRD, it's time to analyze the project and decide on the required technology.

### 2.1 Socratic Questioning

The core logic revolves around fulfilling product feature requirements.

Instead of jumping to answers when encountering problems, it's crucial to keep asking questions. The best way to do this is through Socratic Questioning.

> Socratic Questioning is an enlightening method of questioning that's typically used to lead someone deeper into their thoughts and help us discover answers.

Put yourself into the two identities of questioner and answerer, **you can do:**

1. **Guided thinking through open-ended questions.** The focus of Socratic questioning is not on giving answers but on asking questions. Through a series of these, the questioner helps guide the respondent to delve deeper into the essence of the issue.
2. **Stimulate critical thinking.** This method encourages respondents to voice their opinions and critically analyze answers.
3. **Help in discovering answers.** Instead of providing answers, the questioner allows the respondent to reach their own conclusions, leading to deeper understanding and internalization.
4. **Facilitate deeper conversations.** Socratic questioning can push discussions deeper, uncovering underlying assumptions and fostering layered logical reasoning.
5. **Enhance learning capabilities.** This method can cultivate independent thinking and learning skills, enabling one to actively ask and solve problems.

From the initial product analysis, we determined that **the product will take the form of a website**. So, starting with Socratic Questioning:

* **Why not a mobile app?**
  * Limited time – websites generally have shorter development cycles than mobile apps and broader applicability.
    * **So, if time permits, it should be a mobile app?** Apparently, there's no reason to exclude it. Who says it can't be a mobile app?
  * A computer screen is bigger, providing a better chat experience.
    * **Can't a phone optimize to offer the same experience?** In theory, yes, so a mobile app could be considered.
  * Using a computer is more efficient, especially for work purposes.
    * **Can't one work on a phone?** Yes, but there's a noticeable efficiency gap that seems hard to bridge in the short term.
    * **Does this mean no need for a mobile version?** Not at all. Different scenarios and user habits might exist, but given the current ROI, it's not a priority.

Through continuous questioning, we can clarify many details.

Both mobile and PC versions share foundational logic and much reusable code. So, when choosing technology, mobile app system architectures in the future should be considered.

**Considerations from a performance and technical implementation perspective:**

1. **Potential challenges:**
   * The peak value caused when a certain prompt is popular may cause OpenAI interface call congestion.
   * Given its UGC (User Generated Content) nature, the growth of prompts might be rapid. How to plan for database sharding in advance?
   * With chat content being extensive text, will there be a search requirement? How can IO operations be minimized? How can database efficiency be maximized?
2. **Possible technical issues:**
   * Compared to news websites, there's a more significant database strain.
3. **User experience:**
   * Opt for technologies that offer superior user experiences, including loading speed, interactivity, and usability.
   * Consider the support level of the chosen tech for mobile devices and different browsers.
4. **Performance and scalability:**
   * Evaluate the performance of different technologies, such as response times, concurrent processing capability, and data handling prowess.
   * Anticipate potential growth and expansions, ensuring the chosen tech offers scalability and maintainability.
5. **Security:**
   * Assess the security of the tech, ensuring it meets project security and compliance needs.
   * Consider the tech's defenses against common threats, like SQL injection and cross-site scripting.

**Considerations from a cost perspective:**

1. **Development efficiency and cost:**
   * Assess how the tech choice impacts the development cycle, choosing those that enhance efficiency.
   * Weigh the cost-effectiveness of the technology, including development, maintenance, and operational costs.
2. **Tech ecosystem and community support:**
   * Opt for technologies with vibrant communities and abundant resources to quickly resolve issues.
   * Consider the update and maintenance status of the tech, ensuring its continued growth and support.
3. **Team skills and experience:**
   * Take into account the team's expertise and experience, choosing technologies they're familiar with or can quickly master.
   * Decide if additional training or resources are required to support the tech's adoption and application.
4. **Future tech trends:**
   * Stay informed about industry tech trends, avoiding those that might soon be obsolete.
   * Gauge the support level of the tech for emerging technologies and standards, ensuring the project stays technologically ahead.
5. **Integration with external systems:**
   * Think about the tech's support for integration with external systems and services, like API integration and data exchange.
6. **Testability and maintainability:**
   * Go for technologies that support automated testing, continuous integration, and continuous deployment to boost project quality and maintainability.
   * Think about the tech's documentation, debugging tools, and monitoring utilities to facilitate development and operations.