Skip to content

Commit

Permalink
adds frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Dec 30, 2023
1 parent ccbf2c3 commit 93dbdcc
Show file tree
Hide file tree
Showing 41 changed files with 1,138 additions and 1,765 deletions.
2 changes: 1 addition & 1 deletion .air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ full_bin = "PP_USER=air ./tmp/main"
# Watch these filename extensions.
include_ext = ["go", "tpl", "tmpl", "html", "env", "conf"]
# Ignore these filename extensions or directories.
exclude_dir = ["assets", "tmp", "vendor", "dist", "node_modules", "public", "site"]
exclude_dir = ["assets", "tmp", "vendor", "dist", "node_modules", "public", "frontend"]
# Watch these directories if you specified.
include_dir = []
# Exclude files.
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,15 @@ jobs:
version: ${{ matrix.go-version }}
- name: Build
run: go build main.go

# setup node
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '20'

- name: build node
working-directory: ./frontend
run: |
npm install
npm run build
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ jobs:
- uses: kevincobain2000/action-gobrew@v2
with:
version: 'mod'
- name: Setup Node.js ${{ matrix.node-versions }}
uses: actions/setup-node@v2
with:
node-version: 20

- name: Build Dist for Embed
working-directory: frontend
run: |
npm install
npm run build
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ tmp/

.env
*.pid
dist/
bin/
build/

Expand All @@ -26,4 +25,4 @@ out
.vscode
main

logs/
logs/
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- [`GET /radar`](#get-radar)
- [`GET /funnel`](#get-funnel)
- [`GET /table`](#get-table)
- [Self Hosting](#self-hosting)
- [CHANGE LOG](#change-log)

# API
Expand Down Expand Up @@ -246,6 +247,12 @@ https://instachart.coveritup.app/table?title=Table+Chart&data={
</p>


# Self Hosting

```sh
curl -sLk https://raw.githubusercontent.com/kevincobain2000/instachart/master/install.sh | sh
```

# CHANGE LOG

- **v1.0.0** - Initial release with `line`, `bar`, `donut`, `pie`, `radar`.
Expand Down
13 changes: 12 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#! /bin/bash


cd frontend
npm install
npm run build
cd ..

go build main.go
pm2 delete 3001
pm2 start --name 3001 "./main"
pm2 start --name 3001 "./main"

### or use this
#curl -sLk https://raw.githubusercontent.com/kevincobain2000/instachart/master/install.sh | sh
#pm2 delete 3001
#pm2 start --name 3001 "./instachart"
3 changes: 0 additions & 3 deletions home-page/.gitignore → frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# build output
dist/

# generated types
.astro/

Expand Down
3 changes: 2 additions & 1 deletion home-page/astro.config.mjs → frontend/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import astroSingleFile from 'astro-single-file'
import { defineConfig } from 'astro/config'
import tailwind from '@astrojs/tailwind'

export default defineConfig({
integrations: [astroSingleFile()]
integrations: [astroSingleFile(), tailwind()]
})
File renamed without changes.
8 changes: 8 additions & 0 deletions frontend/dist/index.html

Large diffs are not rendered by default.

Loading

0 comments on commit 93dbdcc

Please sign in to comment.