Skip to content

Commit 9db5e81

Browse files
second commit
0 parents  commit 9db5e81

File tree

191 files changed

+23780
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+23780
-0
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
2+
charset = utf-8
3+
indent_size = 2
4+
indent_style = space
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true

.env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
VITE_API_BASE_URL=http://localhost:8080
3+
4+
#VITE_API_BASE_URL=https://back.newjeaps.com
5+

.github/workflows/main.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Deploy Vue App to Ubuntu Server using Docker
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
env:
9+
SERVER_HOST: 211.117.197.184
10+
SERVER_SSH_USER: parkhaein
11+
PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
12+
DOCKER_IMAGE_NAME: kanepark/vue-app
13+
14+
jobs:
15+
build-and-push-docker:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: '18'
26+
27+
- name: Install dependencies
28+
run: |
29+
# 기존 node_modules와 package-lock.json 삭제
30+
rm -rf node_modules
31+
rm -f package-lock.json
32+
33+
# npm 캐시를 정리하여 충돌 방지
34+
npm cache clean --force
35+
36+
# 종속성 재설치
37+
npm install
38+
npm install vue-simple-range-slider
39+
40+
41+
- name: Build the Vue app
42+
run: npm run build
43+
44+
- name: Build Docker image
45+
run: docker build . --file Dockerfile --tag ${{ env.DOCKER_IMAGE_NAME }}:latest
46+
47+
- name: Login to Docker Hub
48+
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
49+
50+
- name: Push Docker image
51+
run: docker push ${{ env.DOCKER_IMAGE_NAME }}:latest
52+
53+
deploy-to-ubuntu-server:
54+
needs: build-and-push-docker
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- name: Deploy to Ubuntu Server
59+
uses: appleboy/ssh-action@master
60+
with:
61+
host: ${{ env.SERVER_HOST }}
62+
username: ${{ env.SERVER_SSH_USER }}
63+
key: ${{ secrets.SSH_PRIVATE_KEY }}
64+
port: 234
65+
script: |
66+
LOG_DIR="/home/ubuntu/app-logs"
67+
mkdir -p $LOG_DIR
68+
touch $LOG_DIR/app.log
69+
70+
# sudo 명령어에 비밀번호 자동 입력
71+
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S docker container prune -f
72+
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S docker image prune -af
73+
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S docker volume prune -f
74+
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S docker system prune -af --volumes
75+
76+
# Docker 이미지 업데이트 및 컨테이너 실행
77+
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S docker pull ${{ env.DOCKER_IMAGE_NAME }}:latest
78+
79+
# 기존 컨테이너 중지 및 삭제
80+
if [ "$(sudo docker ps -aq -f name=vue-container)" ]; then
81+
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S docker stop vue-container
82+
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S docker rm vue-container
83+
fi
84+
85+
# 새로운 컨테이너 실행
86+
echo "${{ secrets.SUDO_PASSWORD }}" | sudo -S docker run --name vue-container -d -p 60:3000 -e TZ=Asia/Seoul \
87+
-v $LOG_DIR/app.log:/app/logs/app.log ${{ env.DOCKER_IMAGE_NAME }}:latest

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
.DS_Store
12+
dist
13+
dist-ssr
14+
coverage
15+
*.local
16+
17+
/cypress/videos/
18+
/cypress/screenshots/
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
.idea
24+
*.suo
25+
*.ntvs*
26+
*.njsproj
27+
*.sln
28+
*.sw?
29+
30+
*.tsbuildinfo

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"Vue.volar",
4+
"dbaeumer.vscode-eslint",
5+
"EditorConfig.EditorConfig"
6+
]
7+
}

README.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<<<<<<< HEAD
2+
# newjeaps
3+
4+
This template should help get you started developing with Vue 3 in Vite.
5+
6+
## Recommended IDE Setup
7+
8+
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
9+
10+
## Customize configuration
11+
12+
See [Vite Configuration Reference](https://vite.dev/config/).
13+
14+
## Project Setup
15+
16+
```sh
17+
npm install
18+
```
19+
20+
### Compile and Hot-Reload for Development
21+
22+
```sh
23+
npm run dev
24+
```
25+
26+
### Compile and Minify for Production
27+
28+
```sh
29+
npm run build
30+
```
31+
32+
### Lint with [ESLint](https://eslint.org/)
33+
34+
```sh
35+
npm run lint
36+
```
37+
=======
38+
# Newjeaps Final Gwangju 04
39+
40+
41+
42+
## Getting started
43+
44+
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
45+
46+
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
47+
48+
## Add your files
49+
50+
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
51+
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
52+
53+
```
54+
cd existing_repo
55+
git remote add origin https://lab.ssafy.com/gommj0611/newjeaps_final_gwangju_04.git
56+
git branch -M master
57+
git push -uf origin master
58+
```
59+
60+
## Integrate with your tools
61+
62+
- [ ] [Set up project integrations](https://lab.ssafy.com/gommj0611/newjeaps_final_gwangju_04/-/settings/integrations)
63+
64+
## Collaborate with your team
65+
66+
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
67+
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
68+
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
69+
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
70+
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
71+
72+
## Test and Deploy
73+
74+
Use the built-in continuous integration in GitLab.
75+
76+
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
77+
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
78+
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
79+
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
80+
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
81+
82+
***
83+
84+
# Editing this README
85+
86+
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
87+
88+
## Suggestions for a good README
89+
90+
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
91+
92+
## Name
93+
Choose a self-explaining name for your project.
94+
95+
## Description
96+
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
97+
98+
## Badges
99+
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
100+
101+
## Visuals
102+
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
103+
104+
## Installation
105+
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
106+
107+
## Usage
108+
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
109+
110+
## Support
111+
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
112+
113+
## Roadmap
114+
If you have ideas for releases in the future, it is a good idea to list them in the README.
115+
116+
## Contributing
117+
State if you are open to contributions and what your requirements are for accepting them.
118+
119+
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
120+
121+
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
122+
123+
## Authors and acknowledgment
124+
Show your appreciation to those who have contributed to the project.
125+
126+
## License
127+
For open source projects, say how it is licensed.
128+
129+
## Project status
130+
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
131+
>>>>>>> 8857ce2ed611768f6905a11e78a534837409b492

dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# 빌드 단계
2+
FROM node:18 AS build-stage
3+
4+
WORKDIR /app
5+
6+
# 의존성 설치
7+
COPY package*.json ./
8+
RUN npm cache clean --force && npm install --no-optional
9+
10+
# Vue 애플리케이션 빌드
11+
COPY . .
12+
RUN npm run build
13+
14+
# 배포 단계
15+
FROM node:18 AS production-stage
16+
17+
WORKDIR /app
18+
19+
# 빌드된 파일만 복사
20+
COPY --from=build-stage /app/dist ./dist
21+
22+
# Node.js로 정적 파일 서빙
23+
RUN npm install -g serve
24+
25+
# 앱 실행
26+
CMD ["serve", "-s", "dist", "-l", "3000"]
27+
28+
# 포트번호
29+
EXPOSE 3000

eslint.config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import js from '@eslint/js'
2+
import pluginVue from 'eslint-plugin-vue'
3+
4+
export default [
5+
{
6+
name: 'app/files-to-lint',
7+
files: ['**/*.{js,mjs,jsx,vue}'],
8+
},
9+
10+
{
11+
name: 'app/files-to-ignore',
12+
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
13+
},
14+
15+
js.configs.recommended,
16+
...pluginVue.configs['flat/essential'],
17+
]

index.html

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

jsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"paths": {
4+
"@/*": ["./src/*"]
5+
}
6+
},
7+
"exclude": ["node_modules", "dist"]
8+
}

0 commit comments

Comments
 (0)