diff --git a/README.md b/README.md index 3209e15..3365d30 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@

Self Hosted App Starter

-

A self hosted app starter for full-stack developer/creator.

+

A starter for the self-hosted app, help you to build your next full-stack project.

GitHub stars @@ -14,12 +14,28 @@ Go report

-## ⚓️ Deploy with Docker +## Features + +> SHA is built on top of GSVT Stack, which stands for Go、SQLite、Vue 3、TailwindCSS + +- 🪄 Full-stack starter with GSVT Stack +- ⚓️ Self-hosted with `Dockerfile` on the fly +- 💾 Store your data using SQLite database +- 🖖 Choose your familar Frontend Teck Stack, default is Vue 3 +- 🚄 Deploy you app easily on the Railway + +### Deploy Services + +### ⚓️ Deploy with Docker ```docker docker run --name sha --publish 3399:8080 --volume ~/.getsha/:/var/opt/sha -e mode=prod getsha/sha:dev ``` +### 🚄 Deploy on Railway + +[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/prX7No?referralCode=UEM9NF) + ## Tech Stack ### Backend @@ -48,34 +64,38 @@ Generate by [vue3-starter](https://github.com/xiaoluoboding/vue3-starter) 2. Pull source. -```bash -npx degit xiaoluoboding/self-hosted-app-starter my-self-hosted-app -``` + ```bash + npx degit xiaoluoboding/self-hosted-app-starter my-self-hosted-app + ``` 3. Start backend using air (with live reload). -```bash -pnpm run dev:be -or -air -c scripts/.air.toml -``` + ```bash + pnpm run dev:be + or + air -c backend/scripts/.air.toml + ``` -Change the open file limit if you encounter "error: too many open files". + > Change the open file limit if you encounter "error: too many open files". -``` -ulimit -n 10240 -``` + ```bash + ulimit -n 10240 + ``` 4. Start frontend (with live reload). -```bash -pnpm run dev:fe -or -cd frontend && pnpm i && pnpm dev -``` + ```bash + pnpm run dev:fe + or + cd frontend && pnpm i && pnpm dev + ``` The app should now be running at https://localhost:3000 and change either frontend or backend code would trigger live reload. +## Inspired by + +[Bytebase](https://github.com/bytebase/bytebase) + ## License MIT [@xiaoluoboding](https://github.com/xiaoluoboding) diff --git a/frontend/package.json b/frontend/package.json index b7ce023..ff85d3d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,7 +11,9 @@ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" }, "dependencies": { + "axios": "^0.27.2", "pinia": "^2.0.11", + "qs": "^6.10.3", "vue": "^3.2.31", "vue-i18n": "^9.2.0-beta.33", "vue-router": "^4.0.12" @@ -22,6 +24,7 @@ "@rushstack/eslint-patch": "^1.1.0", "@types/jsdom": "^16.2.14", "@types/node": "^16.11.25", + "@types/qs": "^6.9.7", "@vitejs/plugin-vue": "^2.2.2", "@vue/eslint-config-prettier": "^7.0.0", "@vue/eslint-config-typescript": "^10.0.0", diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index f8c48b5..2410f8f 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -6,17 +6,20 @@ specifiers: '@rushstack/eslint-patch': ^1.1.0 '@types/jsdom': ^16.2.14 '@types/node': ^16.11.25 + '@types/qs': ^6.9.7 '@vitejs/plugin-vue': ^2.2.2 '@vue/eslint-config-prettier': ^7.0.0 '@vue/eslint-config-typescript': ^10.0.0 '@vue/test-utils': ^2.0.0-rc.18 '@vue/tsconfig': ^0.1.3 '@vueuse/core': ^8.2.0 + axios: ^0.27.2 eslint: ^8.5.0 eslint-plugin-vue: ^8.2.0 jsdom: ^19.0.0 pinia: ^2.0.11 prettier: ^2.5.1 + qs: ^6.10.3 typescript: ~4.5.5 unplugin-icons: ^0.14.1 unplugin-vue-components: ^0.18.5 @@ -30,7 +33,9 @@ specifiers: windicss: ^3.5.1 dependencies: + axios: 0.27.2 pinia: 2.0.12_yiky6a7nq42a76m3cgtakyoff4 + qs: 6.10.3 vue: 3.2.31 vue-i18n: 9.2.0-beta.33_vue@3.2.31 vue-router: 4.0.14_vue@3.2.31 @@ -41,6 +46,7 @@ devDependencies: '@rushstack/eslint-patch': 1.1.1 '@types/jsdom': 16.2.14 '@types/node': 16.11.26 + '@types/qs': 6.9.7 '@vitejs/plugin-vue': 2.2.4_vite@2.8.6+vue@3.2.31 '@vue/eslint-config-prettier': 7.0.0_j4zsohvph7mgdk6nfobbsfrdii '@vue/eslint-config-typescript': 10.0.0_ckwpocuxe4j5omsdhuo2zh3ybe @@ -327,6 +333,10 @@ packages: resolution: {integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==} dev: true + /@types/qs/6.9.7: + resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} + dev: true + /@types/tough-cookie/4.0.1: resolution: {integrity: sha512-Y0K95ThC3esLEYD6ZuqNek29lNX2EM1qxV8y2FTLUB0ff5wWrk7az+mLrnNFUnaXcgKye22+sFBRXOgpPILZNg==} dev: true @@ -830,7 +840,15 @@ packages: /asynckit/0.4.0: resolution: {integrity: sha1-x57Zf380y48robyXkLzDZkdLS3k=} - dev: true + + /axios/0.27.2: + resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} + dependencies: + follow-redirects: 1.15.0 + form-data: 4.0.0 + transitivePeerDependencies: + - debug + dev: false /babel-walk/3.0.0-canary-5: resolution: {integrity: sha512-GAwkz0AihzY5bkwIY5QDR+LvsRQgB/B+1foMPvi0FZPMl5fjD7ICiznUiBdLYMH1QYe6vqu4gWYytZOccLouFw==} @@ -877,7 +895,6 @@ packages: dependencies: function-bind: 1.1.1 get-intrinsic: 1.1.1 - dev: true /callsites/3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} @@ -946,7 +963,6 @@ packages: engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 - dev: true /concat-map/0.0.1: resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} @@ -1026,7 +1042,6 @@ packages: /delayed-stream/1.0.0: resolution: {integrity: sha1-3zrhmayt+31ECqrgsp4icrJOxhk=} engines: {node: '>=0.4.0'} - dev: true /dir-glob/3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} @@ -1593,6 +1608,16 @@ packages: resolution: {integrity: sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==} dev: true + /follow-redirects/1.15.0: + resolution: {integrity: sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + /form-data/4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} @@ -1600,7 +1625,6 @@ packages: asynckit: 0.4.0 combined-stream: 1.0.8 mime-types: 2.1.35 - dev: true /fs.realpath/1.0.0: resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=} @@ -1616,7 +1640,6 @@ packages: /function-bind/1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - dev: true /functional-red-black-tree/1.0.1: resolution: {integrity: sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=} @@ -1632,7 +1655,6 @@ packages: function-bind: 1.1.1 has: 1.0.3 has-symbols: 1.0.3 - dev: true /get-stream/6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} @@ -1691,7 +1713,6 @@ packages: /has-symbols/1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} - dev: true /has-tostringtag/1.0.0: resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} @@ -1705,7 +1726,6 @@ packages: engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 - dev: true /html-encoding-sniffer/3.0.0: resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==} @@ -2024,14 +2044,12 @@ packages: /mime-db/1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} - dev: true /mime-types/2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} dependencies: mime-db: 1.52.0 - dev: true /mimic-fn/2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} @@ -2085,6 +2103,10 @@ packages: engines: {node: '>=0.10.0'} dev: true + /object-inspect/1.12.1: + resolution: {integrity: sha512-Y/jF6vnvEtOPGiKD1+q+X0CiUYRQtEHp89MLLUJ7TUivtH8Ugn2+3A7Rynqk7BRsAoqeOQWnFnjpDrKSxDgIGA==} + dev: false + /once/1.4.0: resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=} dependencies: @@ -2342,6 +2364,13 @@ packages: engines: {node: '>=6'} dev: true + /qs/6.10.3: + resolution: {integrity: sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: false + /queue-microtask/1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true @@ -2434,6 +2463,14 @@ packages: engines: {node: '>=8'} dev: true + /side-channel/1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.1 + object-inspect: 1.12.1 + dev: false + /signal-exit/3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 8d12c69..6dca3a1 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,5 +1,7 @@