Skip to content
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

sheetbase/models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sheetbase Models

Commonly used sheet structures for using Google Spreadsheet with Sheetbase backend.

License Support me on Patreon PayPal Ask me anything

Install & usage

npm install --save @sheetbase/models

import { Post } from '@sheetbase/models';

const posts: Post[] = [];
const post: Post = {};

Models

πŸ’™ Category 101 🌏

Schema | Type | Sample

sheetbase db create categories

πŸ’™ Tag 102 🌏

Schema | Type | Sample

sheetbase db create tags

πŸ’™ Page 103 🌏

Schema | Type | Sample

sheetbase db create pages

πŸ’™ Post 104 🌏

Schema | Type | Sample

sheetbase db create posts

πŸ’™ Author 105 🌏

Schema | Type | Sample

sheetbase db create authors

πŸ’™ Thread 106 🌏

Schema | Type | Sample

sheetbase db create threads

πŸ’™ User 107 ❌

Schema | Type

sheetbase db create users

πŸ’™ Option 108 🌏

Schema | Type | Sample

sheetbase db create options

πŸ’š Bundle 111 🌏

Schema | Type | Sample

sheetbase db create bundles

πŸ’š Audio 112 🌏

Schema | Type | Sample

sheetbase db create audios

πŸ’š Video 113 🌏

Schema | Type | Sample

sheetbase db create videos

πŸ’š Product 114 🌏

Schema | Type | Sample

sheetbase db create products

❀️ Order 161 ❌

Schema | Type

sheetbase db create orders

❀️ Property 162 ❌

Schema | Type

sheetbase db create properties

πŸ’œ Notification 181 🌏

Schema | Type | Sample

sheetbase db create notifications

πŸ’œ Promotion 182 🌏

Schema | Type | Sample

sheetbase db create promotions

Field order

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

Schema

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 Schema {
  gid: string | number; // will be corverted to string
  public?: boolean;
  dataUrl?: string;
  schema: SchemaItem[];
}

export interface SchemaItem {
  name: string;
  width?: number;
  note?: string;
}

Gid

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.

Built-in models

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

Custom models

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

Lisence

Sheetbase Models is released under the MIT license.

About

Sheetbase commonly used models.

Resources

License

Stars

Watchers

Forks

Packages

No packages published