Offline Recipe Box
Build an iPhone recipe box that works fully offline, perfect for a kitchen with bad Wi-Fi. You save recipes with their ingredients and steps, search them by name or ingredient, and open them without any internet connection, because everything is stored on the phone with SwiftData. When you are online, you can import a recipe from a simple JSON link with URLSession, and it's saved for offline use from then on. It's a good first iOS project: you'll learn SwiftUI lists, forms and navigation, SwiftData models and queries, searching, and loading JSON from the web.
- Estimate
- ~8.5h
- Steps
- 6
- Completed by
- 0
- Proposed by
- codeseed.app
SwiftData · URLSession
Project roadmap
- 01
Plan the screens and data
~1hWrite README.md describing the screens (recipe list with search, recipe detail, add and edit form, import from link) and the data: a recipe has a title, servings, prep minutes, a list of ingredients (each with a name and amount) and steps. Write an example of the JSON format that can be imported, and host it somewhere, such as a GitHub Gist. Done when: README.md shows the screens and an example JSON recipe.
- 02
Create the SwiftData model
~1.5hCreate a SwiftUI app with SwiftData models Recipe and Ingredient, with a relationship that deletes a recipe's ingredients when it's deleted. Check values when saving: the title can't be empty, servings are between 1 and 50, and prep minutes aren't negative. Add sample recipes for previews. Done when: recipes with ingredients can be created in code and are still there after restarting.
- 03
Build the list, detail and form
~2hShow recipes with @Query in a list, sorted by title. Tapping opens a detail screen with ingredients and numbered steps. Add a form for creating and editing recipes, including adding and removing ingredients, and swipe to delete in the list. Done when: recipes can be created, viewed, edited and deleted.
- 04
Search recipes
~1hAdd a search field with .searchable that matches recipe titles and ingredient names, ignoring upper and lower case. Show a message when nothing matches. Done when: searching for an ingredient such as garlic shows every recipe that uses it.
- 05
Import from a link
~1.5hAdd an Import screen where the user pastes a link. Download it with URLSession, decode the JSON with Codable, validate it like a normal recipe, and save it with SwiftData. Show clear messages when offline, when the link isn't valid, or when the JSON is in the wrong format. Done when: importing your hosted example recipe works, and it opens later in airplane mode.
- 06
Test it
~1.5hWrite unit tests with an in-memory SwiftData container: validation rules, searching by title and ingredient, deleting a recipe removes its ingredients, and decoding valid and broken JSON. Test by hand in airplane mode. Done when: the tests pass, and everything except importing works offline.
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack