-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathlowdefy.yaml
63 lines (56 loc) · 2.56 KB
/
lowdefy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Lowdefy Admin Example
lowdefy: 4.0.1
license: MIT
# description
# This example show patterns that can be used to implement an admin app, that allows
# users to see data records, create new new data records, edit those records and delete
# those records.
# This example will contain a set of brands, and a set of products.
# A one-to-many relation will be created between the brands and the products.
# Each product will be related to one brand, and a brand can be related to many products.
# Define all the data connections, in this case the brands and products MongoDB collections.
connections:
- id: brands # The connectionId that will be used when defining requests and mutations on our pages.
type: MongoDBCollection # The type of connection
properties:
databaseName: example-crud # The database name.
collection: brands # The collection name.
databaseUri:
_secret: EXAMPLES_MDB # The database connection uri that is stored as a secret and accessed using the _secret operator.
write: true # Allows writes to the database. By default reads are allowed but writes are not.
- id: products
type: MongoDBCollection
properties:
databaseName: example-crud
collection: products
databaseUri:
_secret: EXAMPLES_MDB
write: true
# Menus used in the app can be listed here
# By default, the menu with id default, or the first menu defined is used.
# If no menu is defined, a default menu is created using all the defined pages.
menus:
- id: default
links:
- id: brands # Define the menu link that directs to the brands page.
type: MenuLink
pageId: brands # Id of the brands page.
properties:
title: Brands # Title to show on the menu.
icon: AiOutlineShop # Give the menu item a icon, see a list of all available icons at https://react-icons.github.io/react-icons/
- id: products
type: MenuLink
pageId: products
properties:
title: Products
icon: AiOutlineRest
# All the pages in the app are listed here.
# Instead of defining the page in the lowdefy.yaml file, it is defined in its own yaml file and referenced here.
pages:
# For brands, a simpler pattern of creating new pages for the new and edit brand actions will be used.
- _ref: pages/brands/brands.yaml
- _ref: pages/brands/new_brand.yaml
- _ref: pages/brands/edit_brand.yaml
# For products, the edit and new brand actions will be included on the same page. This is more complex,
# but results in a better user experience.
- _ref: pages/products/products.yaml