Skip to content

Commit

Permalink
Improve README.md file
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkuranda committed Aug 23, 2022
1 parent 6d3a9fa commit 5b25f20
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 6 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Yummy Changelog

## [2.7.0] - 2022-08-23

- [mjkuranda]: Meals without image render no image photo.

### Added

- New sections in `README.md` file such us: `Using`, `Yummy for developers`.
- Improved `README.md` file.

### Changed

- No image photo for meals without image.

## [2.6.3] - 2022-08-16

- [mjkuranda]: New routing structure
Expand Down
12 changes: 9 additions & 3 deletions IDEAS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,26 @@

- Validation - client side: The patterns should be loaded from pattern file? Or simply embedeed inside elements.
- Error page for multer and other errors while you are trying to add a new meal.
- 6 meals in `/search` should be removed in a near future.
- Edition of existing meals - you can edit anything you want apart from the title - because it occurs as the name.
- Each result has a property called `relevance` - could be measured as a percentage. The found results should be sorted according to the this property.
- Better handling MongoDB errors - types of errors and their communicates.
- Improved README and guide for developers how to add ingredients and other things.

## Bugs

-
- NaN

## Added

- (vNaN): NaN

## Changed

v2.7.0:

- 6 meals in `/search` should be removed in a near future.

- Improved README (guide for the customers and the developers - how to add ingredients and other stuff.

## Fixed

- (v2.6.3): When you try to add a new meal and its image is too large, then you receive a message about failure but the meal wil be added.
79 changes: 78 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,84 @@

Website that will help you to find somewhat to eat!

# About
<br />

## About

Have you ever encountered a situation when you didn't know what to cook?
Yummy will help you to make the best decision!

<br />

## Using

Being in the main page (locally is `http://localhost:3000/`) you can see panel, containg the three following buttons:

- `Wyszukaj po produktach` - redirects to `/search` and move to the ingredients.
- `Propozycja na dziś` - returns the best option for you at the time (currently disabled option)
- `Wyszukaj z bazy` - redirects to `/search`

The subpage `/search` allows you finding the best results. You can select multiple ingredients and a type of looking for a meal/meals. Below these filters, `/search` renders the results.

When you hover on a result, it magnifies. You can see title, description and an image of such meal.

When you click on a result, it redirects to `/result` subpage, where you can see the full description of the meal and its all ingredients.

There is one more button on the bottom `/search` subpage. The `Dodaj` button allows you adding a new meal. It redirects to `/meals/add`.

Being in `/meals/add`, you can see a form, containing the fields.

- `Nazwa posiłku`
- `Opis posiłku`
- `Rodzaj posiłku`
- `Imię autora wprowadzającego posiłek`
- `Składniki`

are required. You can optionally add an image for a new meal.
Additionally, `Nazwa posiłku` is unique i.e. there is no any meal with that name in the database.

<br />

# Yummy for developers

This section contains information about adding the new stuff.

<br />

## Adding a new icon

1. Download a new icon image and attach to the appropriate directory, locating in `/icons`.
2. Open `YummyData.ts` and add a new property to `icons` object, naming it according to `camelCase` convention.
3. For the object being created set following properties: `name`, `url` (starting in `/icons`), `ext` (abbr. extension) and `link` (i.e. `source`)

<br />

### Adding the new property for `icons` object

The below example creates a new icon located in directory `/icons/default/new-icon.jpg`.
<br />

```javascript
newIcon: new Icon(
"new icon",
"/default",
"jpg",
"https://cool-icons.com/new-icon-source"
),
```

## Adding a new ingredient

1. Open `YummyData.ts` and find `ingredients` object.
2. Add a new property using `camelCase` convention.
3. Assign an object of ingredient to the new property.

```javascript
newIngredient: new Ingredient(
Category.SOME_CATEGORY, // Category
icons.newIcon, // Icon object
"nowy składnik" // Name
),
```

where `Category` has enum type and `icons` is the object planty of icons in the same file as `ingredients`.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yummy",
"version": "2.6.3",
"version": "2.7.0",
"description": "Website that will help you the best!",
"main": "index.js",
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion src/YummyData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Ingredient from "./classes/Ingredient";
import Meal, { Type } from "./classes/Meal";
import Icon from "./classes/Icon";
import Category from "./enums/categories";

Expand Down

0 comments on commit 5b25f20

Please sign in to comment.