forked from codecombat/codecombat
-
Notifications
You must be signed in to change notification settings - Fork 0
Add a collection
Scott Erickson edited this page Apr 25, 2016
·
3 revisions
You want to add a new collection of data to the site.
Define the model's schema, construct REST endpoints on the server, and create a Backbone Model and Collection on the client side to interface with the server for the collection.
Here are the key things you need to add a collection to the website:
- [[JSON schema file in
/app/schemas/models|add-a-collection-schema]]. This defines what properties of documents in the collection, and is used by both server and client. - [[Mongoose Model in
/server/models|add-a-mongoose-model]]. This is the server's active record interface with MongoDB for the collection. - [[Node/Express REST endpoints in
/server/routes/index.coffee|add-basic-rest-endpoints-for-a-collection]]. Typically need POST, PUT, GET one and GET many, although each collection's may need more or less. - [[Backbone Model and Collection in
/app/modelsand/app/collections, respectively|connect-backbone-to-new-collection]]. These are the client's active record interface for a document or set of documents in the collection.
See linked recipes for details and examples.
CodeCombat | Home | Blog | Forum | Teachers | Legal | Contribute
- Home
- Archmage Home
- Artisan Home
- Adventurer Home
- Scribe Home
- Diplomat Home
- Ambassador Home
- Archmage General
- Mission statement
- Coco Models
- Coding Guidelines
- Cookbook
- File system
- JSON Schema
- Technical overview
- Testing
- Third party software and services
- Artisan General
- Building A Level
- Coding Guidelines for Artisans
- Editing Thang Components
- Important Artisan Concepts
- Keyboard Shortcuts
- Artisan How-To Index
- Adventurer General
- Scribe General
- Diplomat General
- i18n
- i18n Glossary nb
- i18n Glossary ru
- i18n Glossary es-419
- Ambassador General
- Dev Setup
- Dev Setup: Linux
- Dev Setup: Windows
- Dev Setup: Mac
- Dev Setup: Vagrant
- Dev Setup: Issues
- Game Engine
- Component
- Multiplayer
- Surface
- System
- Thang
- Thang Component System
- Tome
- World
- Artisan Tabs
- Components And Systems
- Scripts
- Settings
- Thangs
- Other
- Aether
- Client models
- Developer organization
- Educational Standards
- Events, subscriptions, shortcuts
- Chat Room
- Chat Room Rules
- Permissions
- Project Ideas List
- Treema
- Versioning
- Views