Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
heyqbnk committed May 28, 2024
1 parent 27146de commit 9adeedb
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Mini Apps platform using the following technologies:
- [Vite](https://vitejs.dev/)

> This boilerplate was created using [pnpm](https://pnpm.io/). Therefore, it is required to use
> it for this project as well.
> it for this project as well. Using other package managers, you will receive a corresponding error.
## First Start

Expand Down Expand Up @@ -41,53 +41,58 @@ pnpm run {script}
## Running

The first important thing to note here is that the application should always be launched in the
context of Telegram application. You can't just run the application and open it directly in your
browser via `http://localhost:3000`. Opening application this way will surely lead to errors, as long
as this environment does not provide the required Telegram Mini Apps functionality.
context of Telegram application. You can't just run the application and open it directly in your
browser. Opening the application this way will surely lead to errors, as long as this environment
does not provide required Telegram Mini Apps functionality.

Telegram Mini Apps environment could be any specified
in the [documentation](https://docs.telegram-mini-apps.com/platform/about#supported-applications).

So, before starting the application, make sure you have already created it in the Telegram
system. Here is the [guide](https://docs.telegram-mini-apps.com/platform/creating-new-app) how to do it.
system. Here is the [guide](https://docs.telegram-mini-apps.com/platform/creating-new-app) how to do
it.

When application is created successfully, run it using the `dev` script and open inside Telegram:
When the application is created successfully, run it using the `dev` script and open inside
Telegram:

```Bash
pnpm run dev
```

## Deploying

This boilerplate uses GitHub Pages as the way to host the application externally. GitHub Pages provides a CDN
which will let your users receive the application rapidly. Alternatively, you could use such services
as [Heroku](https://www.heroku.com/) or [Vercel](https://vercel.com).
This boilerplate uses GitHub Pages as the way to host the application externally. GitHub Pages
provides a CDN which will let your users receive the application rapidly. Alternatively, you could
use such services as [Heroku](https://www.heroku.com/) or [Vercel](https://vercel.com).

### GitHub Workflow

To simplify the process of deployment, this boilerplate contains already
written [GitHub workflow](.github/workflows/github-pages-deploy.yml) to deploy the project automatically in case, some
content was pushed to the `master` branch.
written [GitHub workflow](.github/workflows/github-pages-deploy.yml) to deploy the project
automatically in case, some content was pushed to the `master` branch.

To let this workflow work properly, it is required create a new environment (or edit the existing one) in the GitHub
repository Settings with the name `github-pages`. Then, add the `master` branch to the list of deployment branches.
To let this workflow work properly, it is required create a new environment (or edit the existing
one) in the GitHub repository Settings with the name `github-pages`. Then, add the `master` branch
to the list of deployment branches.

Environments settings could be find using this URL: `https://github.com/{username}/{repository}/settings/environments`
Environments settings could be find using this
URL: `https://github.com/{username}/{repository}/settings/environments`

![img.png](.github/deployment-branches.png)

In case, you don't want to do it automatically, or you don't use GitHub as the project codebase, just remove the
`.github` directory.
In case, you don't want to do it automatically, or you don't use GitHub as the project codebase,
just remove the `.github` directory.

### GitHub Web Interface

Alternatively, developers are able to configure the automatic deployment using GitHub web interface. To use it,
follow the link: `https://github.com/{username}/{repository}/settings/pages`.
Alternatively, developers are able to configure the automatic deployment using GitHub web interface.
To use it, follow the link: `https://github.com/{username}/{repository}/settings/pages`.

### Manual Deployment

This boilerplate uses the [gh-pages](https://www.npmjs.com/package/gh-pages) tool, which allows deploying your
application right from your PC.
This boilerplate uses the [gh-pages](https://www.npmjs.com/package/gh-pages) tool, which allows
deploying your
application right from your PC.

#### Configuring

Expand All @@ -103,16 +108,16 @@ is `is-awesome`, the value in the `homepage` field should be the following:

```json
{
"homepage": "https://telegram-mini-apps.github.io/is-awesome"
"homepage": "https://telegram-mini-apps.github.io/is-awesome"
}
```

And `vite.config.ts` should have this content:

```ts
export default defineConfig({
base: '/is-awesome/',
// ...
base: '/is-awesome/',
// ...
});
```

Expand Down

0 comments on commit 9adeedb

Please sign in to comment.