Installing Anix

Getting started with Anix is simple. Follow these steps to set up your first Anix project.

Prerequisites

Before installing Anix, make sure you have the following installed:

  • Node.js (version 12.x or higher)
  • npm (usually comes with Node.js)

You can check your current versions with:

node --version
npm --version

Creating a New Project

The easiest way to get started is to use the CLI to create a new project:

npx create-anix my-anix-project
cd my-anix-project

This will create a new directory with the basic project structure and install all necessary dependencies.

Manual Setup

If you prefer to set up your project manually, create the following directory structure:

my-anix-project/
 ├── views/            # UI templates (.anix files)
 ├── core/             # Anix core files (will be created)
 ├── package.json      # Project configuration
 └── README.md         # Project documentation

Then install dependencies if required:

npm install

Project Configuration

The anix files comes with few pre-configured commands:

scripts { 
 start: node core/dev-server.js,
 build: anix node core/compiler.js,
 server: node backend/astpoint-server.js 
 ast-gui: node backend/server.js 
 }

These scripts allow you to:

  • npm start: Run the development server
  • npm run build: Build the project for production
  • npm run server: Run the backend server for astpoint #document based database, you can also configure server for your prefered backend
  • npm run ast-gui: Run Astpoint database Gui

Creating Your First Anix File

Create a file named index.anix in the views directory:

page ["Home", "/"] { 
 div.container {
  h1 "Hello, Anix!" 
  p "Welcome to my first Anix page"
  div.buttons {
  a.btn.btn-primary "Learn More" -> "#"
 }

Running the Development Server

Start the development server with:

npm start

This will start a local development server, typically at http://localhost:3000. Any changes you make to your .anix files will automatically reload the page.

Building for Production

p.mb-3 "When you're ready to deploy your application, build it for production:"
npm run build

This will create optimized HTML, CSS, and JavaScript files in the dist directory.

Next Steps

p.mb-3 "Now that you've installed Anix, explore these topics to learn more:"