# Build in Blocks \[Assistant]

***

## General Information about project

{% content-ref url="/spaces/D4inNwzMBU3WuBySeYcV/pages/RQVfbKESEzj2qYn2axq2" %}
[Build in Blocks \[Assistant\]](https://resources.collabocate.community/projects-overview/collabocate-osc-projects/build-in-blocks-assistant)
{% endcontent-ref %}

***

## Local development instructions

{% hint style="warning" %}
We've made recent changes to the repository location and local development instructions of this project. Therefore, this section may be outdated. For now and pending the time that this section will be updated, you can get guidance on where to find and how to run this project in our collabo community Discord channel.
{% endhint %}

Find the local development instructions for the different Blocks Assistant projects in the tabs below, depending on the one you want to develop locally.

{% tabs %}
{% tab title="CLI" %}
***Local development instructions:***

* Head over to the GitHub repository: <https://github.com/collabo-community/blocks-assistant>
* Fork and clone the repository as shown in the [SWE contribution workflow](https://docs.collabo.community/software-engineering#git-workflow-fork-and-clone-repository).

***

***Instructions for installing dependencies and linking CLI:***

{% hint style="info" %}
Once you have the repository on your local computer, ensure you are ***in the root of the project's directory***. Then install globally and uninstall globally following the steps below.
{% endhint %}

Install dependencies:

```
npm install
```

Link after installing dependencies, so that you can access/use the Create Collabo App commands in the terminal:

```
npm link
```

Unlink (this is for when you are done developing):

```
npm unlink
```

***

***CLI commands and flags:***

The way you operate/run the CLI is still largely the same as what is in the former [Node Mongo user doc](https://docs.collabocommunity.com/node-mongo/detailed-guide) at the moment. The only difference (for now) is the main CLI command i.e. Instead of `node-mongo`, use `collabo-be`. Similarly for the shorter version of the commands - instead of `nmgo`, use `c-be`.

***

#### Learning resources

* [Twilio | Dominik Kundel: How to build a CLI with node.js](https://youtu.be/s2h28p4s-Xs) - *YouTube video*.
* [Twilio | Dominik Kundel: How to build a CLI with node.js](https://www.twilio.com/blog/how-to-build-a-cli-with-node-js) *- blog post.*
  {% endtab %}

{% tab title="Backend API Boilerplates" %}
***Local development instructions:***

* Head over to the GitHub repository: <https://github.com/collabo-community/nodejs-backend-api-boilerplates>
* Fork and clone the repository as shown in the [SWE contribution workflow](https://docs.collabo.community/software-engineering#git-workflow-fork-and-clone-repository).

***

***Instructions for installing dependencies and starting the development server:***

{% hint style="info" %}
Once you have the repository on your local computer, follow the steps below.
{% endhint %}

* Change directory into any of these folders in the repository, depending on the template you wish to work on: `ts-esm-async-await` folder, `js-esm-async-await` folder, `js-cjs-async-await` folder or `js-cjs-then` folder.
* Once in the chosen folder, follow ***steps 1 to 4*** in the tabs under the [Running the generated backend API application](https://docs.collabo.community/node-mongo#running-the-generated-backend-api-application) section of the former Node mongo user docs, depending on the connection setup type you prefer to use. \
  \&#xNAN;***Some slight modifications to the steps exist:*** We have removed the automated dev server for now. For ***step 4***, just use `npm run dev:atlas` or `npm run dev:local` script commands accordingly.

***

***Handling .env files during development:***

* Retain the `.env.example` file so that it doesn't get deleted from our repo when you submit your code fix.
* Create a copy of the `.env.example` file, rename this copy to `.env` , then change the `PORT` and add other environment variables to store your secrets as desired or as needed in your `.env` file.

***

#### Learning resources

* [TomDoesTech: REST API with Node.js, Express, TypeScript, MongoDB & Zod](https://www.youtube.com/watch?v=BWUi6BS9T5Y).
* [TomDoesTech: Module '"mongoose"' has no exported member 'DocumentDefinition'.ts (tutorial fixes)](https://www.youtube.com/watch?v=5-1KuU-21uI).
* [Academind: Building a restful API with node.js](https://academind.com/tutorials/building-a-restful-api-with-nodejs/).
* [CodAffection: MEAN stack CRUD operations](https://youtu.be/UYh6EvpQquw) - *1st 33 minutes*.
  {% endtab %}

{% tab title="Frontend App Boilerplates" %}
{% hint style="warning" %}
No instructions for now. Please ask about this project on our discord channel if you are interested in contributing.
{% endhint %}
{% endtab %}
{% endtabs %}

***


---

# 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://resources.collabocate.community/software-engineering/project-local-development-instructions/build-in-blocks-assistant.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.
