1.4.0-alpha.8 • Published 6 months ago

alchemymvc v1.4.0-alpha.8

Weekly downloads
4
License
MIT
Repository
github
Last release
6 months ago

Getting started

You can create a new, empty app by executing this npm command:

npm init alchemy your-app-name

Then npm install the package.json contents. This is only alchemymvc by default.

Installation

Just installing the npm package can be done like this:

$ npm install alchemymvc

Quick start guide

You can find all the documentation on https://alchemy.elevenways.be

Base class

Most Alchemy classes inherit from the Base class (which in turn inherits from the Informer class, a custom event emitter class)

Here are some important static methods:

Base.setProperty(key, getter, setter)

This will create a property getter/setter on the class. For example:

MyClass.setProperty(function test_me() {
  return 'test!'
});

Will create a property getter called 'test_me' that will always return the string "test!"

var instance = new MyClass();
instance.test_me;
// »»» "test!"

Base.setMethod(key, fnc)

This will add a method to the class. For example:

MyClass.setMethod(function testMe() {
  return 'test!'
});

Now you can call this method:

var instance = new MyClass();
instance.testMe();
// »»» "test!"

Models

Creating a server-side model is easy, you need to inherit from the Alchemy.Model.App:

var Block = Function.inherits('Alchemy.Model.App', function Block(conduit, options) {
  Block.super.call(this, conduit, options);
});

Model schema

After that you probably want to define the schema to use, that has to be done in a constitute call:

Block.constitute(function addFields() {

  // Add a simple unique string field
  this.addField('name', 'String', {unique: true});

  // Another string field, that is not unique
  this.addField('title', 'String');

  // Longer piece of text
  this.addField('content', 'Text');
});

By default 3 fields are already added to the schema:

  • _id: An ObjectID field
  • created: A datetime field with the creation date
  • updated: A datetime field that gets updated whenever the record is saved

Authors

AlchemyMVC is developed at Eleven Ways, a team of IAAP Certified Accessibility Specialists.

1.4.0-alpha.9

6 months ago

1.4.0-alpha.8

7 months ago

1.4.0-alpha.7

8 months ago

1.4.0-alpha.6

9 months ago

1.4.0-alpha.5

10 months ago

1.4.0-alpha.4

10 months ago

1.3.23

1 year ago

1.4.0-alpha.3

1 year ago

1.4.0-alpha.2

1 year ago

1.4.0-alpha.1

1 year ago

1.3.22

1 year ago

1.3.17

2 years ago

1.3.18

2 years ago

1.3.15

2 years ago

1.3.16

2 years ago

1.3.19

2 years ago

1.3.20

2 years ago

1.3.21

2 years ago

1.3.14

2 years ago

1.3.13

2 years ago

1.3.11

2 years ago

1.3.12

2 years ago

1.3.10

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.7

2 years ago

1.3.3-alpha

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.9

4 years ago

1.1.10

3 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.5.0

7 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.3

8 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.0.1

12 years ago