Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gaurav-gosain/uadmin-railway
Deploy your uAdmin project and host it with a single click (and a few more steps π) !
https://github.com/gaurav-gosain/uadmin-railway
api cd ci deploy docker go golang mysql railway rest uadmin
Last synced: 10 days ago
JSON representation
Deploy your uAdmin project and host it with a single click (and a few more steps π) !
- Host: GitHub
- URL: https://github.com/gaurav-gosain/uadmin-railway
- Owner: Gaurav-Gosain
- Created: 2022-09-11T07:25:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-15T17:59:15.000Z (over 1 year ago)
- Last Synced: 2024-05-17T00:26:28.845Z (6 months ago)
- Topics: api, cd, ci, deploy, docker, go, golang, mysql, railway, rest, uadmin
- Language: JavaScript
- Homepage: https://gaurav-gosain.github.io/uadmin-railway/
- Size: 14.4 MB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Golang and [uAdmin](https://github.com/uadmin/uadmin) CI/CD using [π Railway](https://railway.app/)!
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/9IP5nJ?referralCode=A7siyP)
## Steps to Deploy
- Make sure to create a Github account and link it with [π Railway](https://railway.app/)
- Click [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/9IP5nJ?referralCode=A7siyP)![](assets/deploy_screen_1.png)
- Give your new Repository a name (and select the visibility if you want to make it private)
- Set the Environment Variables to the following (you can change the port as per your needs):| Value | env variable |
| :---------------------------------------------------------------: | -------------- |
| `1` |`CGO_ENABLED` |
| `8080` |`PORT` |
| `gcc` |`NIXPACKS_PKGS` |
| `encryption key used for encrypting and decrypting the database` |`KEY` |
| `salt used for encrypting and decrypting the database` |`SALT` |> NOTE: The `PORT` value here needs to match the port where uAdmin is exposed to (the default value is `8080` and I recommend not changing it unless necessary)
- and finally click on `Deploy`
## TA-DA! π Your app is deployed!
- A github repository will be created with the name you gave in the previous step
- A uadmin instance is run
- It is hosted on a live URL (which you can find in the `Deployments` tab of your project)
- The expected port is exposed
- An SSL certificate is generated
- A MySQL database is automatically created and linked to uAdmin
- The database is encrypted using the `KEY` and `SALT` environment variables
### All that with a click of a button and a few environment variables!![](assets/deploy_screen_2.png)
![](assets/deploy_screen_3.png)Finally, to setup this repository locally, you can follow the steps below:
- Head over to github and clone the repository that was created for you.
- Clicking on MySQL on the railway dashboard will give you the following details:
![](assets/mysql.png)
- The values for the fields like `host`, `port`, `user`, `password` and `name` can be found in the above screenshot from the fields `MYSQLHOST`, `MYSQLPORT`, `MYSQLUSER`, `MYSQLPASSWORD` and `MYSQLDATABSE` respectively.
> **host** β **MYSQLHOST**> **port** β **MYSQLPORT**
> **user** β **MYSQLUSER**
> **password** β **MYSQLPASSWORD**
> **name** β **MYSQLDATABSE**
- Create a `.database` file in the root of the repository and add the following content to it using the values mapped from the previous step:
```json
{
"type": "mysql",
"name": "railway",
"user": "root",
"password": "********************",
"host": "*********************.railway.app",
"port": 1234
}
```
- Create a `.encrypt` file in the root of the repository and add the following content to it using `KEY` and `SALT` environment variables from the railway dashboard:
```json
{
"KEY": "*********************",
"SALT": "*********************"
}
```> You can test the connection to the MySQL instance by running the following command in the root of the repository locally (assuming you have go installed on your machine):
> ```shell
> go mod download; go build .; ./railway
> ```Commit these changes to the repository and push them to github.
### Now for the cool part!
Since railway automatically deploys the app whenever there is a change in the repository, you will see that a new build is triggered and the app is deployed with the changes you made as soon as you push them to github!To fix:
```jsx
[ ERROR ] Hanlder.NewLogger. Unix syslog delivery error
```> Update on the above error: The issue is solved in HEAD and will be releases in a new version with the update. (~Internal Sources π)
## About me
[![GH WidgetBox](https://gh-widgetbox.vercel.app/api/profile?username=Gaurav-Gosain&data=followers,repositories,stars,commits)](https://github.com/Gaurav-Gosain)
## Star History
[![Star History Chart](https://api.star-history.com/svg?repos=Gaurav-Gosain/uadmin-railway&type=Date)](https://star-history.com/#Gaurav-Gosain/uadmin-railway&Date)