Commonly used sheet structures for using Google Spreadsheet with Sheetbase backend.
npm install --save @sheetbase/models
import { Post } from '@sheetbase/models';
const posts: Post[] = [];
const post: Post = {};
sheetbase db create categories
sheetbase db create tags
sheetbase db create pages
sheetbase db create posts
sheetbase db create authors
sheetbase db create threads
sheetbase db create users
sheetbase db create options
sheetbase db create bundles
sheetbase db create audios
sheetbase db create videos
sheetbase db create products
sheetbase db create orders
sheetbase db create properties
sheetbase db create notifications
sheetbase db create promotions
Sheet fields are sorted by groups.
- Ids:
#
,title
,$key
type
- Status:
status
createdAt
,updatedAt
authors
- Images:
thumbnail
,image
- Content:
description
|excerpt
,content
- (Specific properties)
locale
origin
parents
relationships
- Taxonomies:
categories
,tags
, ... - Rating:
rating
- Sharing:
sharing
- Statistics:
viewCount
,likeCount
,commentCount
keywords
- Extras:
meta
Every model is defined in a .json
file. File name is a plural string of a content type (categories, posts, ...) and is used as the model name.
export interface Model {
gid: string | number; // will be corverted to string
public?: boolean;
dataUrl?: string;
schema: ModelSchema[];
}
export interface ModelSchema {
name: string;
width?: number;
note?: string;
}
A Google Sheets sheet is indentified by its name
(categories, posts, ...) or its gid
(a string number as can be seen in the url #gid=0
). @sheetbase/client uses the gid
to request the public data accordingly.
A built-in model names its gid
with 3 characters string number, prefix by 1
.
- 💙
10x
: major sheets - 💚
11x-15x
: custom content public sheets - ❤️
16x-17x
: private sheets - 💜
18x-19x
: miscellaneous sheets
You can use any string number (from 1-9 characters) for your custom models, but it should not starts with 1
for 3 characters gid
.
Suggested covention:
- 💚
[2-9]1x-[2-9]5x
: custom content public sheets - ❤️
[2-9]6x-[2-9]7x
: private sheets - 💜
[2-9]8x-[2-9]9x
: miscellaneous sheets
Sheetbase Models is released under the MIT license.