Week 1 Assignment
Assignment 1
The objectives of this assignment are to:
- Download a full-stack application onto your computer (without having to build it).
- Start understanding the NextJS + Supabase project structure.
- Explore the power of AI coding tools to modify features in this application.
The questions for this assignment are the same questions inside the trivia app sandbox page here. Set up the trivia application sandbox by following the instructions on that page, and then answer the following questions:
Phase 0: Playing around with the app
-
Run the application with the command ‘npm run dev’. Explore the application by clicking on buttons and trying out the different features. *Note, every time you generate trivia questions, you will be spending some of your OpenAI credits (money).
a. Authentication:
- Go through the process of signing up for an account. Check your Supabase Users table (in your web browser) to see if the sign up was successful!
- Now that you have created an account, go ahead and sign in.
- Try resetting your user account password. Did that work? If not, what happened?
b. Trivia question generation:
- Generate a set of trivia questions! What happens?
- Can you check that the trivia_questions table and the user_trivia_questions table were updated in Supabase?
- What happens if you try to generate trivia questions again?
c. Favorites page:
- Favorite one or two of the questions on the home page.
- Do they appear in the favorites table in Supabase?
- Check the favorites page and see if the questions show up.
- Does the unfavoriting functionality work?
d. History page:
- Check the history page, and make sure the user’s past history questions appear.
Phase 1: Coding with AI open-exploration
-
(Feature 1: Cosmetic Change) Can you get Cursor to increase the text size of the trivia category buttons?
a. What learning/research/discovery did you do prior to writing and implementing a Cursor prompt (with LLMs and/or looking )?
b. Which files did Cursor edit/modify to implement this feature? Where does this file live?
c. What are some bugs, issues, or limitations you encountered during this process?
d. Were you successful in implementing the feature? If so, show a screenshot or GIF of it working.
-
(Feature 2: Countdown Timer) Add a timer that counts down as soon as the user clicks the button to generate trivia questions. As soon as the timer expires, can you have a UI/UX display that says ‘your time has run out’, and prevent the user from answering questions?
a. What learning/research/discovery did you do prior to writing and implementing a Cursor prompt (with LLMs and/or looking )?
b. Which files did Cursor edit/modify to implement this feature? Where do these files live?
c. What are some bugs, issues, or limitations you encountered during this process?
d. Were you successful in implementing the feature? If so, show a screenshot or GIF of it working.
Sandbox Feature Tips
-
(Feature 3: Prompt Modification) Modifying the prompt to take in additional user preference (for example, add a field for spiciness, goofiness, mind-bendiness, or whatever you can think of). Make sure that the prompt to the OpenAI API takes this user input into consideration when generating the trivia questions.
a. What learning/research/discovery did you do prior to writing and implementing a Cursor prompt (with LLMs and/or looking )?
b. Which files did Cursor edit/modify to implement this feature? Where do these files live?
c. What are some bugs, issues, or limitations you encountered during this process?
d. Were you successful in implementing the feature? If so, show a screenshot or GIF of it working.
Phase 2: Coding with AI directed exploration (to learn about project structure/files)
-
Can you find out where the UI/UX for the /sign-in and /sign-up forms live? You can either inspect the files/folders manually or use Cursor for guidance if you need help!
a. What do you notice about the route (i.e. website.com/sign-in) and where the file lives in the code repository? What is the pattern?
-
You have gone through the process of signing up for an account. Can you get Cursor to help you map where in the code this whole user-flow is encoded? Can you draw out a diagram to show what code files/functions are hit?
-
Let’s explore the OpenAI API integration.
a. What code is being called between the user hitting the ‘Generate Trivia Questions’ button and the questions being generated and appearing on the page?
b. Where is the route where the OpenAI API is called? What is happening in this code file? Can you walk through and describe the general functionality.
-
Can you find and list all instances where the Supabase tables are being updated or modified?
a. For each of these instances, can you label whether the Supabase client is being called on the server or client-side and why?
b. What is the difference between server vs. client-side?
Reflections on Coding with AI
-
What are your initial thoughts about coding with AI? Any surprises? Challenges?
-
When did you feel like you were collaborating with AI vs. just receiving instructions from it?
-
How helpful was AI in resolving bugs or identifying problems?
-
Did you ever get stuck in trying to fix a problem? Or in an infinite cycle of errors? What happened and what did you try?
-
Did you notice your prompts improving over time? How did your approach evolve?
-
On a scale of 1-10, how confident are you in knowing which files should change if I asked you to implement a specific feature (like the ones in phase 1 of the exercise)?