ให้ GPT มันช่วยคิด Prompt

เอา เทคนิค กวนๆ แต่ work มากๆ สำหรับให้ chatGPT ช่วยเขียน โปรแกรม full stack แบบละเอียดยิบโดยที่เราเองก็ไม่มีรายละเอียดอะไรเลย 😀 โดย key ถาม chatGPT แบบว่า


1. Do you have a full details of a long prompt for develop a full stack application.


แล้วเจ้า chatGPT ก็แสดง prompt แบบชุดใหญ่ไฟกระพิบ มาให้เรา


2. จากนั้นก็ใช้ prompt ของมันนั้นแหละ gen code แบบ high-level design อย่างละเอียด มาช้วยเราซะเลย 5555

Ok now show me full details of sample code

……

เราดูแล้ว ยังละเอียดไม่พอเลยขอเพิ่มใหม่แบบว่า

I want to see all details of sample code


เท่านั้น ละ มันพ่น samples code ออกมาอย่างกะ กระสุนปืนกลเลย 5555 ที่ทดลอง ใช้ เป็น chatGPT 3.5 นะ ถ้าเป็น chatGPT 4 คงจะอลังการกว่านี้


เอา prompt ที่ได้จากข้อที่ 1.มาแบ่งกันดู จากนั้นก็ลองแก้ไขกันเอง นะครับ อิอิ แต่ code ทึ่ gen มา เปะไม่ไหวมันยาวววว 😀 

———————-


Sure, here's an example of a long prompt for developing a full-stack application:


---


**Prompt:**


You are tasked with developing a full-stack web application for an online bookstore. The application should allow users to browse, search, and purchase books from a catalog of available titles. Additionally, users should be able to create accounts, manage their profiles, add books to a shopping cart, and complete the checkout process.


**Frontend Requirements:**

1. Implement a user-friendly interface with responsive design using HTML, CSS, and JavaScript.

2. Create a homepage that displays featured books, categories, and search functionality.

3. Implement a book catalog page with pagination, filtering by category, and sorting options.

4. Allow users to view detailed information about a specific book, including its title, author, description, and price.

5. Implement user authentication and authorization functionality, allowing users to sign up, log in, and log out.

6. Create a user profile page where users can update their personal information, view order history, and manage their shopping cart.

7. Implement a shopping cart feature that allows users to add books, update quantities, and remove items.

8. Develop a checkout process with multiple steps, including shipping information, payment details, and order summary.

9. Implement client-side form validation and error handling to ensure data integrity and improve user experience.

10. Utilize AJAX or asynchronous JavaScript to enhance page loading and improve performance.


**Backend Requirements:**

1. Develop a RESTful API using a backend framework such as Node.js with Express, Django, or Ruby on Rails.

2. Implement endpoints for CRUD operations on resources such as books, users, orders, and cart items.

3. Integrate a database system (e.g., MySQL, PostgreSQL, MongoDB) to store and manage application data.

4. Implement user authentication and authorization using techniques such as JWT (JSON Web Tokens) or session-based authentication.

5. Create endpoints for user registration, login, logout, and password reset functionality.

6. Implement server-side validation and error handling to ensure data consistency and security.

7. Develop business logic to handle order processing, including inventory management, order calculation, and payment processing.

8. Implement API endpoints for searching and filtering books based on title, author, category, etc.

9. Utilize middleware for request logging, error handling, authentication, and authorization.

10. Secure API endpoints with HTTPS and implement CORS (Cross-Origin Resource Sharing) policies to restrict access to authorized domains.


**Deployment and Infrastructure:**

1. Deploy the frontend application to a web server or cloud platform such as AWS, Azure, or Heroku.

2. Set up a CI/CD (Continuous Integration/Continuous Deployment) pipeline for automated testing and deployment.

3. Configure a production-grade database server with appropriate security measures and backups.

4. Implement caching mechanisms (e.g., Redis, Memcached) to improve performance and reduce database load.

5. Set up monitoring and logging to track application performance, errors, and user interactions.

6. Scale infrastructure resources dynamically to handle fluctuations in traffic and ensure high availability.

7. Implement CDN (Content Delivery Network) caching for static assets to improve page load times and reduce latency.

8. Configure load balancers and reverse proxies to distribute incoming traffic and improve reliability.


**Testing and Quality Assurance:**

1. Develop unit tests, integration tests, and end-to-end tests to ensure code quality and functionality.

2. Implement test automation frameworks (e.g., Jest, Selenium) to streamline the testing process.

3. Conduct performance testing to evaluate system scalability, response times, and resource utilization.

4. Perform security audits and vulnerability assessments to identify and mitigate potential risks.

5. Implement logging and error monitoring to track and diagnose issues in production environments.

6. Utilize code review and collaboration tools (e.g., GitHub, Bitbucket) to facilitate peer review and code quality improvements.

7. Develop documentation for developers, users, and administrators to ensure clarity and consistency.

8. Implement a bug tracking system (e.g., Jira, Bugzilla) to track and prioritize issues throughout the development lifecycle.


**Conclusion:**


This prompt provides a comprehensive overview of the requirements for developing a full-stack web application for an online bookstore. It covers frontend development, backend development, deployment, infrastructure, testing, and quality assurance aspects of the project. Implementing these requirements will require a combination of technical skills, including proficiency in web development frameworks, databases, deployment tools, testing methodologies, and DevOps practices. 


---


แต่จงจำไว้เสมอนะครับมันปิดจบให้เราไม่ได้

ต้องมีความเข้าใจระดับนึงในเรื่องนั้นๆ

เราต้อง end to end ด้วยตัวเราเอง

0
48