mnnx

Getting Started

Welcome to mnnx development. This guide will help you set up your environment and run your first application in just a few steps.

1. Installation

Choose your preferred installation method below or visit our quickstart guide:

npm Package

npm install @mnnx/core

For JavaScript/TypeScript projects using Node.js or modern build tools.

Docker Image

docker pull mnnx/runner:latest

Pre-configured container for quick deployment and development environments.

2. Configuration

Set up your environment with these essential configurations:

API Key Setup

export MNX_API_KEY="your-secure-key"

Set environment variables for authentication and feature activation.

Base Configuration

mnnx init --env=development --region=us-west-2

Initialize your project with default settings and your preferred region.

3. Your First Application

Let's create a simple application using the mnnx CLI:

  1. Create a new directory
    mkdir myapp && cd myapp
  2. Generate boilerplate code
    mnnx new myapp
  3. Run the development server
    mnnx serve --port 3000

// Example program - basic counter application
import mnnx from '@mnnx/core';

const app = new mnnx.App();

app.addComponent('Counter', {
    state: { count: 0 },
    actions: {
        increment() { this.state.count++ },
        decrement() { this.state.count-- }
    },
    render() {
        return `
            <div class="p-4 bg-white shadow">
                <h2>Count: ${this.state.count}</h2>
                <button onclick="this.decrement()">−</button>
                <button onclick="this.increment()">+</button>
            </div>
        `;
    }
});

app.start();

                    

Best Practice: Environment Management

Always use .env files for storing secrets, never hardcode in source files.