Installation
Creating a new Alchemy project is easy using the npm init
command:
npm init alchemy my-project-name
This command will create a new folder named my-project-name
and populate it with files from the 11ways/alchemy-skeleton repository.
No plugins or dependencies will be added yet, and you also have to manually run the install command (in order to actually install the alchemymvc
package):
cd my-project-name
npm install --omit=dev
(The --omit=dev
parameter is so that AlchemyMVC development dependencies are not installed)
Now would be a good idea to check the configuration of your new project, including datasource configuration. When everything has been configured, you can start the server with this command:
node server.js
You'll get a GUI/TUI in your console, which is created using our own Janeway package.
Plugins
Plugins can be installed in two ways:
- In the
app/plugins
folder - From NPM, in the
node_modules
folder
For example, if you don't want to use a MongoDB database, you can opt for the alchemy-ds-nedb
or alchemy-ds-linvodb3
file-based database instead.
You can install it from NPM like this:
npm install alchemy-ds-linvodb3
After that, you need to enable the plugin, this has to be added to the app/config/bootstrap.js
file:
alchemy.usePlugin('ds-linvodb3');
The type name of this datasource is linvodb3
, so you'll also need to change that in the app/config/local.js
file (it'll currently be set to mongo
)