Skip to content

Commit

Permalink
Add documentation on how to get started with the application
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobefu committed Dec 13, 2024
1 parent 17fe484 commit f83c29f
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 6 deletions.
4 changes: 3 additions & 1 deletion docs/content/api-server/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ The API server allows the Contentstack Bridge to be used as an alternative to th
- Data can be transformed locally, since it's stored in a local database
- Full URLs can be saved, using a parenting system within the content types of entries

{{% children containerstyle="div" style="h2" description=true %}}
## Subpages

{{% children containerstyle="div" style="h3" description=true %}}
7 changes: 5 additions & 2 deletions docs/content/cli/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
+++
title = "CLI"
title = "Command Line Interface"
linkTitle = "CLI"
type = "default"
description = "Information on the subcommands and CLI flags in the Contentstack Bridge CLI"
menuPre = "<i class='fa-solid fa-fw fa-terminal'></i> "
Expand All @@ -13,4 +14,6 @@ The Contentstack Bridge has a powerful CLI. It will allow you to:
- Run actions in Contentstack (Coming soon!)
- And much more

{{% children containerstyle="div" style="h2" description=true %}}
## Subpages

{{% children containerstyle="div" style="h3" description=true %}}
44 changes: 43 additions & 1 deletion docs/content/getting-started/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,47 @@ menuPre = "<i class='fa-solid fa-fw fa-flag'></i> "
weight = 1
+++

{{% children containerstyle="div" style="h2" description=true %}}
It's pretty easy to set up the Contentstack Bridge.
Let's walk through the steps that are needed to set it up.

## Installation steps

### Getting the program binary

There's two ways to get the application binary.
One way is to build it locally.
Instructions on how to do this can be found on [Building](building).

Alternatively, pre-built binaries can be found on the [releases page on GitHub](https://github.com/Dobefu/csb/releases).
Once you have a `csb` binary, you can verify that it works by running `./csb --help`.
If this command outputs a help menu, you can move on to the next step.

### Configuring the .env file

For the application to be able to communicate with Contentstack and access its own database, a `.env` file is required.
An example `.env` file can be found [in the GitHub repository](https://github.com/Dobefu/csb/blob/main/.env.example).
Once the `.env` file has been configured, you can validate it by running `./csb check:health`.

For more information about the possible configuration options, please see the [Configuration options](configuration-options) page.

### Populating the database

Now that the application is configured, we can create the necessary database tables.
This can very easily be done by running `./csb migrate:db`.

Once this is done, all of the database tables will be set up and ready to go.

### Synchronising the Contentstack data

Now that we have a database and tables, we need to populate the data.
We can do this by running `./csb remote:sync`.
This will synchronise the remote data into the database.
This is needed for the [built-in API](api-server) to work, among other things.

This command should also be ran periodically, to keep the data up-to-date.
When run again, the sync will continue where it left off,
so only the initial synchronisation will be a heavy operation.

## Subpages

{{% children containerstyle="div" style="h3" description=true %}}
4 changes: 3 additions & 1 deletion docs/content/getting-started/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ description = "Building instructions for the application"
To build the application, simply run `go build`.

This will create a new file, called `csb`. Running it now will throw an error,
since there is no configuration yet. Instructions on how to configure the application can be found on the [Configuration](configuration) page.
since there is no configuration yet.

Instructions on how to configure the application can be found on the [Configuration](configuration) page.
6 changes: 5 additions & 1 deletion docs/content/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ description = "Configuring the Contentstack Bridge"
### Setting up the .env file

Configuration is done with a `.env` file. To start, copy the `.env.example`:
``` bash

```bash
cp .env.example .env
```

An example `.env` file can also be found [in the GitHub repository](https://github.com/Dobefu/csb/blob/main/.env.example).

### Contentstack credentials

The Contentstack credentials can be obtained from the Contentstack settings.
Expand All @@ -32,6 +35,7 @@ This will create a file called `db.sqlite3`. This can be handy for local testing

For production use, databases like MySQL and Postgres are supported as well.
For testing, alternative databases can quickly be spun up locally:

```bash
docker compose up -d
```

0 comments on commit f83c29f

Please sign in to comment.