Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arnav-kr/node-shuttle
Node.js Project Template for hosting on shuttle.rs
https://github.com/arnav-kr/node-shuttle
hosting nodejs rust-lang shuttle-rs
Last synced: 23 days ago
JSON representation
Node.js Project Template for hosting on shuttle.rs
- Host: GitHub
- URL: https://github.com/arnav-kr/node-shuttle
- Owner: arnav-kr
- License: agpl-3.0
- Created: 2024-04-03T13:41:16.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-04-03T15:37:15.000Z (8 months ago)
- Last Synced: 2024-05-02T03:46:15.075Z (7 months ago)
- Topics: hosting, nodejs, rust-lang, shuttle-rs
- Language: Rust
- Homepage: https://arnav.is-a.dev/node-shuttle
- Size: 68.4 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Node.js on shuttle.rs Template
This Template is a starting point for creating a Node.js project on the shuttle.rs. It is a simple discord bot template that can be used to create a discord bot using the discord.js library, or any other Node.js project.**Example of a bot running on shuttle.rs:**
![Bot Running on shuttle.rs](example.png)## Pre-requisites
- [rust](https://www.rust-lang.org/tools/install) installed
- [cargo-shuttle CLI](https://docs.shuttle.rs/getting-started/installation) installed
- [Node.js](https://nodejs.org/en/download/) installed (obv)## Getting Started
- Create a new project using the template
```bash
cargo shuttle init --from arnav-kr/node-shuttle
```
- rename `shuttle/Secrets.example.toml` to `shuttle/Secrets.toml` and put your environment variables there. Those will be deployed to the shuttle.rs server.- restart the project
```bash
npm run shuttle:restart
```
- deploy the project
```bash
npm run shuttle:deploy
```> [!NOTE]
> First Deploy might take some time to finish (maybe a lot) but subsequent deploys will be faster.> [!NOTE]
> `package.json` contains the `shuttle:` scripts to interact with the shuttle.rs server. You can use them to login, deploy, start, restart, and stop the server.## Deploy via GitHub Actions
Cosidering the deploy limit per day, the deploy workflow is opt-in by default i.e. you need to manually trigger it by putting `[deploy]` anywhere in your commit message.> [!IMPORTANT]
> To deploy using Github Actions, you need to specify the [`SHUTTLE_TOKEN`](https://console.shuttle.rs/login) in the repository secrets along with any other environment variable you are going to use in your project.\
> You can add or remove variables in [`.github/workflows/deploy.yml`](.github/workflows/deploy.yml) file.\
> This template requires the following environment variables to be set in the repository secrets:\
> - `SHUTTLE_TOKEN`: The token to authenticate with the shuttle.rs server.\
> - `DISCORD_TOKEN`: The discord bot token.\
> Not specifying them in the repository secrets will result in a failed deployment.> [!TIP]
> To save your build hours, you may run the first deploy manually and then use the GitHub Actions to deploy the later changes.## Development
use general node workflow for development.## License
This project is licensed under the AGPL 3.0 License - see the [LICENSE](LICENSE) file for details## Author
[Arnav Kumar (@arnav-kr)](https://github.com/arnav-kr)