proto-notes-dkr
所属分类:Websocket编程
开发工具:Vue
文件大小:0KB
下载次数:0
上传日期:2023-08-01 15:11:31
上 传 者:
sh-1993
说明: 与Docker打包的简单UI和API服务器。。。,
(a simple UI and API server packaged with Docker...,)
文件列表:
.ncuSkip (15, 2023-12-15)
.ncuSubs (8, 2023-12-15)
.noBuild (0, 2023-12-15)
.nyp2 (0, 2023-12-15)
.skip (0, 2023-12-15)
api/ (0, 2023-12-15)
api/Dockerfile (215, 2023-12-15)
api/LICENSE (1079, 2023-12-15)
api/app.js (3749, 2023-12-15)
api/cSpell.json (605, 2023-12-15)
api/db.json (98, 2023-12-15)
api/demon (25, 2023-12-15)
api/notes.js (1746, 2023-12-15)
api/package.json (935, 2023-12-15)
api/yarn.lock (36509, 2023-12-15)
app/ (0, 2023-12-15)
app/Dockerfile (210, 2023-12-15)
app/cSpell.json (743, 2023-12-15)
app/favicon.ico (4286, 2023-12-15)
app/images/ (0, 2023-12-15)
app/images/git-notes_herokuapp-50x.png (286156, 2023-12-15)
app/index.html (1297, 2023-12-15)
app/package.json (859, 2023-12-15)
app/src/ (0, 2023-12-15)
app/src/App.vue (1572, 2023-12-15)
app/src/assets/ (0, 2023-12-15)
app/src/assets/logo.png (6849, 2023-12-15)
app/src/components/ (0, 2023-12-15)
app/src/components/Alerts/ (0, 2023-12-15)
app/src/components/Alerts/Danger.vue (273, 2023-12-15)
app/src/components/Alerts/Success.vue (272, 2023-12-15)
app/src/components/Containers/ (0, 2023-12-15)
app/src/components/Containers/ErrorContainer.vue (668, 2023-12-15)
app/src/components/Containers/KeysContainer.vue (556, 2023-12-15)
app/src/components/Containers/NavigatorContainer.vue (732, 2023-12-15)
app/src/components/Containers/ProfileContainer.vue (1733, 2023-12-15)
... ...
# proto-notes-dkr
This project was orgininally setup as independent pieces. There were 2 parts:
- a UI written in Vue, deployed to Vercel
- an API server written in Node, deployed to Heroku
The original idea came from an Egghead course i took. That course built a UI in React with a backend in Firebase. I wrote my own server to replace Firebase, built with Node and Websockets, just to explore how this all worked. The server part was called **fire-notes** and that part is in the api folder of this repo. I later rewrote the UI while exploring Vue and that was called **git-notes**. That UI now lives in the app folder of this repo. To simplify things, the Websocket and server connections aren't encrypted, not a big deal since they only run inside this container and it's not designed to be deployed anywhere.
Since the Free tier of Heroku is going away in November of 2022, i decided to repackage this project as a Docker container. When it's running locally, it exposes the following:
- [localhost:3000][xoc-app] - _the Vue app_
- [localhost:8082][xoc-wss] - _websocket server_
- [localhost:8182][xoc-api] - _api server (REST)_
## docker
To run this multi-part app:
1. `docker-compose build`
2. `docker-compose up`
```
proto-notes-dkr git:(main) docker-compose up
[+] Running 3/2
Network proto-notes-dkr_backbone Created 0.0s
Container proto-notes-dkr-api-1 Created 0.0s
Container proto-notes-dkr-app-1 Created 0.0s
Attaching to proto-notes-dkr-api-1, proto-notes-dkr-app-1
proto-notes-dkr-api-1 | yarn run v1.22.19
proto-notes-dkr-api-1 | $ yarn; node app.mjs
proto-notes-dkr-api-1 | [1/4] Resolving packages...
proto-notes-dkr-app-1 | yarn run v1.22.19
proto-notes-dkr-app-1 | $ yarn; vite build; vite preview --host 0.0.0.0
proto-notes-dkr-api-1 | success Already up-to-date.
proto-notes-dkr-api-1 | -- Notes Server listening on port 8182
proto-notes-dkr-api-1 | -- Websocket Server created on port 8082
proto-notes-dkr-api-1 | -- http://localhost:8182
proto-notes-dkr-app-1 | [1/4] Resolving packages...
proto-notes-dkr-app-1 | [2/4] Fetching packages...
proto-notes-dkr-app-1 | [3/4] Linking dependencies...
proto-notes-dkr-app-1 | [4/4] Building fresh packages...
proto-notes-dkr-app-1 | vite v3.1.3 building for production...
proto-notes-dkr-app-1 | transforming...
proto-notes-dkr-app-1 | 101 modules transformed.
proto-notes-dkr-app-1 | rendering chunks...
proto-notes-dkr-app-1 | dist/assets/favicon.db74ab0b.ico 4.19 KiB
proto-notes-dkr-app-1 | dist/index.html 1.37 KiB
proto-notes-dkr-app-1 | dist/assets/index.4a29606e.css 1.24 KiB / gzip: 0.52 KiB
proto-notes-dkr-app-1 | dist/assets/index.3fed08c7.js 92.85 KiB / gzip: 35.48 KiB
proto-notes-dkr-app-1 | Local: http://localhost:3000/
proto-notes-dkr-app-1 | Network: http://172.18.0.3:3000/
```
If you prefer, there are yarn commands to handle all of this:
- `yarn build` - _docker-compose build_
- `yarn start` - _docker-compose up_
- `yarn stop` - _docker-compose down_
These scripts are just a shortcuts to running `docker-compose`.
You will notice that we're not installing any npm packages locally in order to build and run this app suite. All of that is handled by Docker...
## requirements
- [Docker Desktop for OSX][docker-osx]
- [Docker Desktop for Windows][docker-win]
## who
- Richard Hess
- [https://eswat2.github.io][eswat2-io]
[eswat2-io]: https://eswat2.github.io
[xoc-app]: http://localhost:3000
[xoc-wss]: http://localhost:8082
[xoc-api]: http://localhost:8182
[docker-osx]: https://docs.docker.com/docker-for-mac/
[docker-win]: https://docs.docker.com/docker-for-windows/
近期下载者:
相关文件:
收藏者: