# xmenio

> XMEN Framework - Any Frontend, MongoDB, Express, Node

Latest version **0.0.15** (published 2016-08-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install xmenio
pnpm add xmenio
yarn add xmenio
bun add xmenio
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.15 |
| Published | 2016-08-24 |
| First published | 2016-08-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 22 |
| Known vulnerabilities | 0 (+11 in 5 direct dependencies) |
| Install scripts | no |
| Author | John Taylor |
| Maintainers | johntayl |

## Links

- npm: https://www.npmjs.com/package/xmenio
- npm.io page: https://npm.io/package/xmenio

## Dependencies (22)

- [swig](https://npm.io/package/swig.md) ^1.4.2
- [async](https://npm.io/package/async.md) ^2.0.1
- [json3](https://npm.io/package/json3.md) ^3.3.2
- [nconf](https://npm.io/package/nconf.md) ^0.8.4
- [helmet](https://npm.io/package/helmet.md) ^2.1.2
- [moment](https://npm.io/package/moment.md) ^2.14.1
- [morgan](https://npm.io/package/morgan.md) ^1.7.0
- [express](https://npm.io/package/express.md) ^4.14.0
- [mongoose](https://npm.io/package/mongoose.md) ^4.5.9
- [passport](https://npm.io/package/passport.md) ^0.3.2
- [underscore](https://npm.io/package/underscore.md) ^1.8.3
- [body-parser](https://npm.io/package/body-parser.md) ^1.15.2
- [compression](https://npm.io/package/compression.md) ^1.6.2
- [errorhandler](https://npm.io/package/errorhandler.md) ^1.4.3
- [connect-flash](https://npm.io/package/connect-flash.md) ^0.1.1
- [connect-mongo](https://npm.io/package/connect-mongo.md) ^1.3.2
- [cookie-parser](https://npm.io/package/cookie-parser.md) ^1.4.3
- [passport-local](https://npm.io/package/passport-local.md) ^1.0.0
- [express-session](https://npm.io/package/express-session.md) ^1.14.0
- [method-override](https://npm.io/package/method-override.md) ^2.3.6
- [mongoose-paginate](https://npm.io/package/mongoose-paginate.md) ^5.0.0
- [connect-multiparty](https://npm.io/package/connect-multiparty.md) ^2.0.0

## Recent versions

- 0.0.15 (latest) — 2016-08-24
- 0.0.14 — 2016-08-19
- 0.0.13 — 2016-08-19
- 0.0.11 — 2016-08-17
- 0.0.10 — 2016-08-17
- 0.0.9 — 2016-08-17

## README

# XMEN Framework

XMEN = Any-Frontend Mongo Express NodeJS

Website: [xmen.io](http://xmen.io)


## Installation

XMEN requires [MongoDB](https://www.mongodb.org/) and [NodeJS](https://nodejs.org/) to be installed.

    npm install xmenio


## Project Configuration

You must define a project configuration file that is set up for XMEN. A default
config file looks like this:

    // config.js

    var path = require('path'),
        rootPath = path.normalize(__dirname);

    module.exports = {
        'development': {
            'DB': 'mongodb://localhost/xmen',       //MongoDB connection
            'PORT': 8000,                           //Port to run XMEN on
            'SECRET': 'xmen',                       //Provide a project secret
            'APP_ROOT': rootPath + '/app',          //Define a custom app path
            'STATIC_ROOT': rootPath + '/public',    //Define a custom static file path
            'PUBLIC_URL': 'http://localhost:8000',  //Public URL
            'INSTALLED_APPS': [                     //Apps to be registered
                'custom_app'
            ]
        }
    };

These are the project settings that are available to any installed app. Extend
this configuration to provide custom project values.


## Start The App

XMEN needs to be bootstrapped and there is a simple way to start the server.

    // app.js

    var XMEN = require('xmenio'),
        config = require('./config.js');

    XMEN.assemble(config); //This initializes the XMEN app

Simply run `node app.js` to get the server up and running.


## Project Structure

XMEN is comprised of smaller individually accessible apps and app must be installed
for it to be used.

Apps must be registered in `INSTALLED_APPS`. App names are based on the directory name.

Example project structure of using the `config.js` above:

    project-name/
        app/
            custom_app/
                index.js
        config/
            config.js
        node_modules/
        app.js
        package.json


## Models

Registering models within XMEN works by setting up a Mongoose Schema. These models
are automatically loaded.

    // custom_app/index.js
    module.exports = {
        models: require('./models')
    };

## Routes

XMEN apps can provide custom routes that are structured specifically for each app.
These routes are automatically loaded.

A routes module is passed the `app`, `passport`, and `auth` middleware.

    // custom_app/index.js
    module.exports = {
        routes: require('./routes')
    };


## Templates

XMEN templates are rendered from a registered app's `templates/` directory.


## Issues and Questions

Join in the conversation in [Github Issues](https://github.com/XMEN-Framework/xmen/issues)

---
_Source: https://npm.io/package/xmenio · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
