Potion/TechSpecs.md
Hayden Hargreaves 71d79cc27e (DOCS): Began working on the tech specs.
This includes some details for the home page as well as the DB specs. Or
at least the current DB specs.
2025-06-01 21:27:53 -07:00

145 lines
4.0 KiB
Markdown

# Technical Specifications
<!--toc:start-->
- [Technical Specifications](#technical-specifications)
- [Page Requirements](#page-requirements)
- [Home](#home)
- [UI Requirements](#ui-requirements)
- [API Requirements](#api-requirements)
- [Favorites](#favorites)
- [Create](#create)
- [Shopping List](#shopping-list)
- [Profile](#profile)
- [Database Requirements](#database-requirements)
- [Tables](#tables)
<!--toc:end-->
Application specifications.
## Page Requirements
This section outlines the specific technical requirements for the application. It is broken down
by page.
#### Home
Home page will server as the landing page where users can search recipes, filter their search, as
well as view lists of recently made recipes, and other (**undetermined**) lists.
##### UI Requirements
- Search bar
- [ ] Ability to search for recipes, meals, and tags
- Filter drop down
- [ ] **Filter by meal** - *breakfast, lunch, dinner, side, any*
- [ ] **Filter by time requirements** - *15min, 30min, 1hr, 1.5hr, +1.5hr*
- [ ] **Filter by difficulty** - *1 to 5 stars*
- Make again list
- [ ] Scrolling list of the most recent 5-10 recipes **made**
- [ ] **How do we determine what recipes were made?***
- [ ] **Display recipe details** - Title, duration, **image***, and a heart to like the recipe
- Another scrolling list*
'*': Not sure yet, still under consideration
##### API Requirements
- Search bar
- [ ] Text search on titles based on search query
- [ ] Text search on tags based on search query
- [ ] Text search on **meal** based on search query
- Filter drop down
- [ ] Update search to only contain meals from selected filter
- [ ] Update search to only contain means that meet the time requirement of the selected filter
- [ ] Update search to only contain meals that meet the difficulty level of the selected filter
- Make again list
- [ ] Fetch a list of recently made meals**
- [ ] Like a post and store it in user's liked posts list
'**': Not sure implementation
#### Favorites
#### Create
#### Shopping List
#### Profile
## Database Requirements
This section outlines the specific technical requirements for the database store for
this application. It will describe the required tables, fields, and other expectations.
### Tables
- [ ] Recipe: Represents a single recipe.
- [ ] ID (PK) *UUID or serial***
- [ ] Title (Unique, Required) string(128)
- [ ] Description (Required) text
- [ ] Instructions (Required) string(1024)[]
- [ ] Serves (Required) int(0..16)
- [ ] Ingredients (Required) JSONB({ "item_a": [{ "name": string, "quantity": string }], "item_b": ... })
- [ ] Difficulty (Required) int(1..5)
- [ ] Duration (Required) JSONB({ "total": int, "prep": int, "cook": int })
- [ ] Author (FK: User.Id) *UUID or serial***
- [ ] Created (Required) date/time stamp
- [ ] User: Represents a single user.
- [ ] ID (PK) *UUID or serial***
- [ ] Name (Required) string(64)
- [ ] Email (Unique, Required) string(128)
- [ ] Password (Required) string(128) *stored as hash***
- [ ] Created (Required) date/time stamp
- [ ] Like: **Many-to-many** table to represent a list of recipes liked by a user.
- [ ] ID (PK) *Composite key***
- [ ] UserId (FK: User.Id, Required) *UUID or serial***
- [ ] RecipeId (FK: Recipe.Id, Required) *UUID or serial***
- [ ] Created (Required) date/time stamp
- [ ] Tag: **Many-to-many** table to represent a list of tags that can be had by many recipes.
- [ ] ID (PK) *UUID or serial***
- [ ] Name (Unique, Required) string(32)
- [ ] RecipeId (FK: Recipe.Id, Required) *UUID or serial***
- [ ] Created (Required) date/time stamp
- [ ] List: Represents a single users shopping list
- [ ] ID (PK) *UUID or serial***
- [ ] UserId (FK: User.Id, Required) *UUID or serial***
- [ ] Content (Required) JSONB([ { "name": string, "quantity": string }, ... ])
- [ ] Created (Required) date/time stamp
'**': Not sure implementation