# Core Initialization

## Main

The core initialization is responsible for unifying all mandarine modules (*Core*, *MVC*, *Security*, *Data*) into one as it handles some of the most important tasks inside the framework such as:

* Dependency Initialization
* Controllers' initialization
* Templates' initialization
* Repositories' proxy connector
* Initialization of *entity manager*
  * Responsible for handling the use of data source&#x73;*.*

The core initialization is also responsible for creating a bridge between Mandarine's internal core & Mandarine's MVC Core.

## Usage

In order to invoke the initialization of Mandarine's core, this is what you would have to do.

```typescript
import { MandarineCore } from "https://deno.land/x/mandarinets/mod.ts";

/**
 * Code
 */
 
 new MandarineCore();
```

## Single entry-point file

The single entry point file serves as an index for all your Mandarine-powered components as well as modules that are not written in *Mandarine* but are required in certain sections of your Mandarine-powered application.

{% tabs %}
{% tab title="Syntax example" %}

```typescript
import { MandarineCore } from "https://deno.land/x/mandarinets/mod.ts";

const services = [/* Unitialized Instances / Classes */];
const middleware = [/* Unitialized Instances / Classes */];
const repositories = [/* Unitialized Instances / Classes */];
const configurations = [/* Unitialized Instances / Classes */];
const components = [/* Unitialized Instances / Classes */];
const otherModules = [/* Unitialized Instances / Classes */];

new MandarineCore();
```

{% endtab %}
{% endtabs %}

**Note** that you *should not* pass initialized instances in the entry-point variables as shown above, you should only pass the reference.

## MVC Bridge

If your application is a Mandarine's web MVC application, you would start it like this:

```typescript
import { MandarineCore } from "https://deno.land/x/mandarinets/mod.ts";

/**
 * Code
 * Or Single entry-point File
 */
 
 new MandarineCore().MVC().run();
```

{% hint style="info" %}
For more information on how to initialize a Mandarine-powered application with multiple file references or a Mandarine-powered *web application* [click here](https://mandarineframework.gitbook.io/mandarine-ts/mandarine-mvc/launching-web-app#single-entry-point-file)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mandarineframework.gitbook.io/mandarine-ts/mandarine-core/core-initialization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
