Skip to content

Commit b3e155b

Browse files
committed
first commit on gov tool
0 parents  commit b3e155b

33 files changed

+3339
-0
lines changed

.github/workflows/publish.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: "publish"
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: build
14+
run: |
15+
echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u "${{ secrets.GHCR_USER }}" --password-stdin
16+
docker build -f Dockerfile.production . --tag ghcr.io/${{ github.repository }}:${GITHUB_REF#refs/tags/}
17+
docker tag ghcr.io/${{ github.repository }}:${GITHUB_REF#refs/tags/} ghcr.io/${{ github.repository }}:latest
18+
docker push ghcr.io/${{ github.repository }}:${GITHUB_REF#refs/tags/}
19+
docker push ghcr.io/${{ github.repository }}:latest

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["johnsoncodehk.volar"]
3+
}

Dockerfile.production

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:alpine as build
2+
WORKDIR /app
3+
COPY package*.json yarn.lock ./
4+
RUN yarn
5+
COPY ./ .
6+
RUN yarn build
7+
8+
FROM nginx as production-stage
9+
RUN mkdir /app
10+
COPY --from=build /app/dist /app
11+
COPY nginx.conf /etc/nginx/nginx.conf
12+
COPY --from=build /app/dist /usr/share/nginx/html
13+
EXPOSE 80
14+
CMD ["nginx", "-g", "daemon off;"]

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Vue 3 + Vite
2+
3+
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4+
5+
## Recommended IDE Setup
6+
7+
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)

deploy.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
version: "2.0"
3+
4+
services:
5+
node:
6+
image: ghcr.io/stakefrites/website:v0.0.5
7+
expose:
8+
- port: 80
9+
accept:
10+
- stakefrites.co
11+
to:
12+
- global: true
13+
14+
profiles:
15+
compute:
16+
node:
17+
resources:
18+
cpu:
19+
units: 1
20+
memory:
21+
size: 512Mi
22+
storage:
23+
size: 100Mi
24+
placement:
25+
dcloud:
26+
attributes:
27+
host: akash
28+
signedBy:
29+
anyOf:
30+
- akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63
31+
pricing:
32+
node:
33+
denom: uakt
34+
amount: 100
35+
36+
deployment:
37+
node:
38+
dcloud:
39+
profile: node
40+
count: 1

index.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<link rel="icon" href="/favicon.ico" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8+
<title>Vuetify 3 Vite Preview</title>
9+
</head>
10+
11+
<body>
12+
<div id="app"></div>
13+
<script type="module" src="/src/main.js"></script>
14+
</body>
15+
16+
</html>

nginx.conf

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
user nginx;
2+
worker_processes 1;
3+
error_log /var/log/nginx/error.log warn;
4+
pid /var/run/nginx.pid;
5+
events {
6+
worker_connections 1024;
7+
}
8+
http {
9+
include /etc/nginx/mime.types;
10+
default_type application/octet-stream;
11+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
12+
'$status $body_bytes_sent "$http_referer" '
13+
'"$http_user_agent" "$http_x_forwarded_for"';
14+
access_log /var/log/nginx/access.log main;
15+
sendfile on;
16+
keepalive_timeout 65;
17+
server {
18+
listen 80;
19+
server_name localhost;
20+
location / {
21+
root /app;
22+
index index.html;
23+
try_files $uri $uri/ /index.html;
24+
}
25+
error_page 500 502 503 504 /50x.html;
26+
location = /50x.html {
27+
root /usr/share/nginx/html;
28+
}
29+
}
30+
}

package.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "gov",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"serve": "vite preview",
7+
"build": "vite build",
8+
"dev": "vite",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"@cosmjs/encoding": "^0.28.3",
13+
"@cosmjs/stargate": "^0.28.1",
14+
"@cosmjs/tendermint-rpc": "^0.28.1",
15+
"@mdi/font": "5.9.55",
16+
"axios": "^0.26.1",
17+
"lodash": "^4.17.21",
18+
"roboto-fontface": "*",
19+
"vue": "^3.2.25",
20+
"vue-router": "^4.0.14",
21+
"vuetify": "^3.0.0-beta.0",
22+
"vuex": "^4.0.0",
23+
"webfontloader": "^1.0.0"
24+
},
25+
"devDependencies": {
26+
"@vitejs/plugin-vue": "^2.3.0",
27+
"@vue/cli-plugin-router": "~5.0.0",
28+
"@vue/cli-plugin-vuex": "~5.0.0",
29+
"@vuetify/vite-plugin": "^1.0.0-alpha.0",
30+
"sass": "^1.38.0",
31+
"sass-loader": "^10.0.0",
32+
"vite": "^2.9.0",
33+
"vue-cli-plugin-vuetify": "~2.4.8",
34+
"vuetify-loader": "^2.0.0-alpha.0"
35+
}
36+
}

public/favicon.ico

4.19 KB
Binary file not shown.

public/index.html

Whitespace-only changes.

src/App.vue

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<template>
2+
<v-app>
3+
<v-app-bar app color="primary" dark>
4+
<div class="d-flex align-center">
5+
<v-app-bar-title class="text"> <h2>Stake Frites</h2></v-app-bar-title>
6+
</div>
7+
8+
<v-spacer></v-spacer>
9+
</v-app-bar>
10+
<v-container>
11+
<v-main>
12+
<router-view />
13+
</v-main>
14+
</v-container>
15+
<v-footer padless>
16+
<v-card flat tile width="100%" class="red lighten-1 text-center">
17+
<v-card-text>
18+
<v-btn v-for="icon in icons" :key="icon" class="mx-4" icon>
19+
<v-icon size="24px">
20+
{{ icon }}
21+
</v-icon>
22+
</v-btn>
23+
</v-card-text>
24+
25+
<v-divider></v-divider>
26+
27+
<v-card-text class="white--text">
28+
{{ new Date().getFullYear() }} —
29+
<strong>Stake Frites (🥩 , 🍟)</strong>
30+
</v-card-text>
31+
</v-card>
32+
</v-footer>
33+
</v-app>
34+
</template>
35+
36+
<script>
37+
import HelloWorld from "./components/HelloWorld.vue";
38+
39+
export default {
40+
name: "App",
41+
42+
components: {
43+
HelloWorld,
44+
},
45+
async created() {
46+
await this.$store.dispatch("fetchNetworks");
47+
},
48+
49+
data: () => ({
50+
//
51+
}),
52+
};
53+
</script>

src/assets/logo.png

6.69 KB
Loading

src/assets/logo.svg

+1
Loading

src/components/Coin.vue

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<template>
2+
<span>
3+
<span class="amount mr-1">{{ showAmount(amount, decimals) }}</span>
4+
<span class="denom">{{ showDenom(denom) }}</span>
5+
</span>
6+
</template>
7+
8+
<script>
9+
import _ from "lodash";
10+
export default {
11+
name: "Coin",
12+
data: () => ({}),
13+
props: {
14+
amount: {
15+
type: Number,
16+
default: 0,
17+
},
18+
decimals: {
19+
type: Number,
20+
default: 0,
21+
},
22+
denom: {
23+
type: String,
24+
default: "",
25+
},
26+
},
27+
methods: {
28+
showDenom(denom) {
29+
console.log("denom", denom);
30+
if (!denom) return;
31+
32+
if (denom.startsWith("base")) {
33+
return denom.slice(4).toUpperCase();
34+
} else if (["u", "a", "n"].includes(denom[0])) {
35+
return denom.slice(1).toUpperCase();
36+
}
37+
return denom.toUpperCase();
38+
},
39+
showAmount(amount, decimals) {
40+
if (!decimals) {
41+
decimals = 6;
42+
}
43+
let amountFmt = (amount / Math.pow(10, decimals)).toFixed(2);
44+
return amountFmt;
45+
},
46+
},
47+
48+
computed: {},
49+
};
50+
</script>
51+
52+
<!-- Add "scoped" attribute to limit CSS to this component only -->
53+
<style scoped></style>

0 commit comments

Comments
 (0)