alchemymvc

1.3.23 • Public • Published

Alchemy logo Alchemy


A node.js MVC framework
Coded with ❤️ by Eleven Ways.

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.3.232latest
1.3.232legacy
1.4.0-alpha.61alpha

Version History

VersionDownloads (Last 7 Days)Published
1.4.0-alpha.61
1.4.0-alpha.50
1.4.0-alpha.40
1.3.232
1.4.0-alpha.30
1.4.0-alpha.20
1.4.0-alpha.10
1.3.220
1.3.210
1.3.200
1.3.190
1.3.180
1.3.170
1.3.160
1.3.150
1.3.140
1.3.130
1.3.120
1.3.110
1.3.100
1.3.90
1.3.80
1.3.70
1.3.60
1.3.50
1.3.40
1.3.30
1.3.3-alpha0
1.3.20
1.3.10
1.3.00
1.2.80
1.2.70
1.2.60
1.2.50
1.2.40
1.2.30
1.2.20
1.2.10
1.2.00
1.1.100
1.1.90
1.1.80
1.1.71
1.1.61
1.1.50
1.1.41
1.1.30
1.1.20
1.1.10
1.1.00
1.0.80
1.0.70
1.0.61
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00
0.5.00
0.4.30
0.4.20
0.4.11
0.4.00
0.3.30
0.3.20
0.3.10
0.3.00
0.2.20
0.2.10
0.2.00
0.0.10

Package Sidebar

Install

npm i alchemymvc

Weekly Downloads

8

Version

1.3.23

License

MIT

Unpacked Size

1.16 MB

Total Files

139

Last publish

Collaborators

  • skerit