Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: installation on ubuntu docs #75

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 190 additions & 0 deletions documentation/docs/installation-ubuntu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
---
id: installation-ubuntu
title: Installation on Ubuntu
sidebar_label: Installation - Ubuntu
---

<br/>

### 1. Install NVM (Node Version Manager)

- **Update your package list:**

```
sudo apt update
```

<br/>

- **Install NVM:**

```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
```

_Note: Replace v0.35.3 with the latest version if necessary._

<br/>

- **Verify the installation:**

```
nvm --version
```

<br/>

- **Install the latest version of Node.js using NVM:**

```
nvm install node
```

<br/>

### 2. **Install Docker**

- **Add Docker's official GPG key and repository:**

```
sudo apt-get update sudo apt-get install -y ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL [https://download.docker.com/linux/ubuntu/gpg](https://download.docker.com/linux/ubuntu/gpg) -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc
```

<br/>

- **Add the Docker repository to Apt sources:**

```
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] [https://download.docker.com/linux/ubuntu](https://download.docker.com/linux/ubuntu) \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
```

<br/>

- **Update your package list:**

```
sudo apt-get update
```

<br/>

- **Install Docker packages:**

```
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```

<br/>

### 3. **Install Docker Compose**

<br/>

- **Download and install Docker Compose:**

```
sudo curl -L "[https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname](https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname) -s)-$(uname -m)" -o /usr/local/bin/docker-compose
```

<br/>

- **Set the correct permissions:**

```
sudo chmod +x /usr/local/bin/docker-compose
```

<br/>

- **Verify the installation:**

```
docker-compose --version
```

<br/>

### 4. **Allow Managing Docker as a Non-Root User**

<br/>

- **Add your user to the Docker group:**

```
sudo usermod -aG docker $USER
```

<br/>

- **Log out and log back in** for the changes to take effect, or run:

```
newgrp docker
```

<br/>

### 5. **Install Xest**

<br/>

- **Install Xest globally using NPM:**

```
npm install -g xest
```

After installing the XEST CLI globally, you can now bootstrap your API.

## Bootstrapping Your API

In order to create your API, you need to run the following commmand:

```bash
$ xx [project-name]
```

With one simple command, you will be installing all the necessary packages, utils, middlewares and required modules will be created for you. Have a look at the created directory.

```bash
$ cd project-name
```

to start your Xest API, run

```bash
$ xx run
```

Et voila! You're ready to Xest :)

The project-name directory will be created, node modules and a few other boilerplate files will be installed, and a src/ directory will be created and populated with several core files, forming a new API-directory with the following setup;

```
├── README.md
├── index.js
├── package-lock.json
├── package.json
├── node_modules
├── migrations
├── test
├── .env
├── .eslintignore
├── .eslintrc
├── .gitattributes
├── database.json
├── jsconfig.json
├── Makefile
├── database
│ ├── database-schema.sql
│ └── seed-data.sql
│ └── docker-compose.yml
│ └── test-database.json
└── src
```

`docker-compose.yml` is our local development environment configuration. When you run your application, a MySQL container will be started for you. You can connect to the local database instance by using the credentials listed in the `docker-compose.yml` file.

`database-schema.sql` is where you will define your database schema. It will be a series of CREATE TABLE statements which is used to populate your local development database.

`seed-data.sql` will contain the test data that you want to insert into your database whilst developing or testing your application locally.
6 changes: 3 additions & 3 deletions documentation/docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: installation
title: Installation
sidebar_label: Installation
id: installation-mac
title: Installation on MacOs
sidebar_label: Installation - Mac
---

You should install the XEST CLI first then start working on your project.
Expand Down
Loading
Loading