Skip to content

Commit 0a4cd9a

Browse files
committed
Initial commit: application bootstrapped!
0 parents  commit 0a4cd9a

Some content is hidden

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

47 files changed

+10129
-0
lines changed

.docker-home-vue/.vue-cli-ui/db.json

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"projects": [
3+
{
4+
"id": "8YRS4M1qu",
5+
"path": "/app",
6+
"favorite": 0,
7+
"type": "vue",
8+
"name": "my-front",
9+
"openDate": 1630478571391,
10+
"widgets": [
11+
{
12+
"id": "8r8E9Xa7X",
13+
"definitionId": "org.vue.widgets.plugin-updates",
14+
"x": 0,
15+
"y": 2,
16+
"width": 2,
17+
"height": 1,
18+
"config": null,
19+
"configured": true
20+
},
21+
{
22+
"id": "HuQHObP6E",
23+
"definitionId": "org.vue.widgets.dependency-updates",
24+
"x": 0,
25+
"y": 3,
26+
"width": 2,
27+
"height": 1,
28+
"config": null,
29+
"configured": true
30+
},
31+
{
32+
"id": "jzM80tbCg",
33+
"definitionId": "org.vue.widgets.vulnerability",
34+
"x": 0,
35+
"y": 1,
36+
"width": 2,
37+
"height": 1,
38+
"config": null,
39+
"configured": true
40+
},
41+
{
42+
"id": "a-Ug1bijt",
43+
"definitionId": "org.vue.widgets.run-task",
44+
"x": 0,
45+
"y": 0,
46+
"width": 2,
47+
"height": 1,
48+
"config": {
49+
"task": "/app:build"
50+
},
51+
"configured": true
52+
},
53+
{
54+
"id": "E__UE1wgc",
55+
"definitionId": "org.vue.widgets.news",
56+
"x": 3,
57+
"y": 0,
58+
"width": 3,
59+
"height": 4,
60+
"config": {
61+
"url": "https://vuenews.fireside.fm/rss"
62+
},
63+
"configured": true
64+
}
65+
]
66+
}
67+
],
68+
"foldersFavorite": [],
69+
"tasks": [],
70+
"config": {
71+
"lastOpenProject": "8YRS4M1qu"
72+
}
73+
}

.docker-home-vue/.vue-cli-ui/shared-data/.gitkeep

Whitespace-only changes.

.docker-home-vue/.vuerc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"useTaobaoRegistry": false
3+
}

.dockerignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
.dockerignore
3+
4+
node_modules
5+
**/.nuxt
6+
.git/
7+
.gitignore
8+
.gitmodules
9+
10+
**/docker-compose.*.yaml
11+
**/docker-compose.*.yml
12+
**/docker-compose.yaml
13+
**/docker-compose.yml
14+
**/Dockerfile
15+
16+
**/Thumbs.db
17+
.editorconfig
18+
19+
.env.*.local
20+
.env.local
21+
.env.local.php
22+
23+
.php_cs.cache

.env.dist

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
###> node -------------------- ###
2+
# This will be available in all environments
3+
# -----
4+
# Base application URL
5+
BASE_URL=http://localhost:3000
6+
# -----
7+
# API endpoint - the base root for the application API
8+
API_URL=http://localhost:8000/api
9+
# todo:Axios - choose to keep or flush...
10+
#API_PREFIX=/api
11+
#API_HOST=localhost
12+
#HOST=localhost
13+
#API_PORT=8001
14+
#PORT=8000
15+
# -----
16+
# AUTH endpoint - the base root for the user authorization
17+
# Uncomment this line to use an external oAuth server (B2P)
18+
# AUTH_URL=http://192.168.0.101:8083
19+
###< node -------------------- ###
20+
21+
###> docker -------------------- ###
22+
# -----
23+
# Docker variables
24+
# -----
25+
# Components versions
26+
TAG_NGINX=1.20
27+
TAG_NODEJS=14
28+
29+
# Project prefix
30+
PROJECT=eprotocole_frontend
31+
PROJECT_VERSION=beta
32+
PROJECT_API_VERSION=1
33+
PROJECT_PWA_VERSION=1
34+
35+
IMAGE_NAME=eprotocole_frontend_vuejs:beta
36+
CONTAINER_NAME=eprotocole_frontend_vuejs
37+
38+
# Vue UI settings
39+
VUE_UI_HOST=0.0.0.0
40+
VUE_UI_PORT=8000
41+
###< docker -------------------- ###

.gitignore

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
6+
# local env files
7+
.env
8+
.env.local
9+
.env.*.local
10+
11+
# Docker files
12+
docker-compose.override.yml
13+
14+
# Log files
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+
pnpm-debug.log*
19+
20+
# Editor directories and files
21+
.idea
22+
.vscode
23+
*.suo
24+
*.ntvs*
25+
*.njsproj
26+
*.sln
27+
*.sw?

Makefile

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
#!make
2+
# Specify a shell
3+
SHELL := /bin/bash
4+
5+
# Create the .env file if it does not exist
6+
ifeq (,$(wildcard .env))
7+
$(shell cp .env.dist .env)
8+
endif
9+
# Get the environment variables
10+
include .env
11+
12+
# Create the .env file if it does not exist
13+
ifeq (,$(wildcard docker-compose.override.yml))
14+
$(shell cp docker-compose.override.yml.dist docker-compose.override.yml)
15+
endif
16+
17+
# Color strings
18+
GREY = /bin/echo -e "\x1b[30m$(1)\x1b[0m"
19+
RED = /bin/echo -e "\x1b[31m$(1)\x1b[0m"
20+
GREEN = /bin/echo -e "\x1b[32m$(1)\x1b[0m"
21+
YELLOW = /bin/echo -e "\x1b[33m$1\x1b[0m"
22+
BLUE = /bin/echo -e "\x1b[34m$(1)\x1b[0m"
23+
PURPLE = /bin/echo -e "\x1b[35m$(1)\x1b[0m"
24+
CYAN = /bin/echo -e "\x1b[36m$(1)\x1b[0m"
25+
WHITE = /bin/echo -e "\x1b[37m$(1)\x1b[0m"
26+
27+
# Some files
28+
ENV_FILE_EXISTS := $(or $(and $(wildcard .env),1),0)
29+
DOCKER_OVERRIDE_FILE_EXISTS := $(or $(and $(wildcard docker-compose.override.yml),1),0)
30+
31+
# Project version string
32+
PROJECT_VERSION_STRING = Project: $(PROJECT), version $(PROJECT_VERSION)
33+
34+
# Commands and information
35+
info: commands
36+
@echo "------------------------------"
37+
@$(call YELLOW, "How to use commands:")
38+
@echo "------------------------------"
39+
@$(call YELLOW, "First install ?")
40+
@echo " - build: build (re-build) the Docker images and containers"
41+
@echo " - clean: remove Docker containers and images"
42+
@echo " - clean-yarn-cache: clean the Yarn cache"
43+
@echo " ---"
44+
@$(call YELLOW, "Start / stop project services ?")
45+
@echo " - up: start the project services in console mode"
46+
@echo " - up-detach: start the project services in daemon mode"
47+
@echo " - down: stop the project services"
48+
@echo " ---"
49+
@$(call YELLOW, "Some more advanced tricks ")
50+
@echo " - vue-ui: start the vue-ui listening on the 9081/tcp port"
51+
@echo " - ssh: open a bash shell in the running container"
52+
53+
54+
# --------------------
55+
commands: banner
56+
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
57+
58+
59+
# --------------------
60+
banner: ## The project information string (project name and version)
61+
@$(call CYAN, "------------------------------------------------------------")
62+
@$(call CYAN, $(PROJECT_VERSION_STRING))
63+
@$(call CYAN, "------------------------------------------------------------")
64+
65+
66+
clean: ## Remove project Docker containers, images, network, volume
67+
docker rm ${CONTAINER_NAME}
68+
docker rmi ${IMAGE_NAME}
69+
70+
71+
clean-yarn-cache: ## Clean Yarn global cache
72+
docker exec -t -i ${CONTAINER_NAME} yarn cache clean
73+
74+
75+
build: ## (Re-)build Docker images and containers with Docker compose
76+
docker-compose -f docker-compose.yml build
77+
78+
79+
up: ## Start project services in console attached mode
80+
docker-compose -f docker-compose.yml -f docker-compose.override.yml up
81+
up-detach: ## Start project services in daemon mode
82+
docker-compose -f docker-compose.yml -f docker-compose.override.yml up --detach
83+
84+
logs: ## View Docker containers log (if started in daemon mode)
85+
docker-compose -f docker-compose.yml -f docker-compose.override.yml logs
86+
down: ## Stop Docker containers (if started in daemon mode)
87+
docker-compose -f docker-compose.yml -f docker-compose.override.yml down
88+
89+
90+
serve: ## Start serving the application (default Docker command)
91+
docker exec ${CONTAINER_NAME} yarn serve
92+
93+
lint: ## Lint the source code
94+
docker exec ${CONTAINER_NAME} yarn lint
95+
96+
test: ## Run the unit tests
97+
docker exec ${CONTAINER_NAME} yarn test
98+
99+
100+
prod: ## Build the production app
101+
docker exec ${CONTAINER_NAME} yarn build
102+
103+
104+
ssh: ## Access Docker container terminal.
105+
docker exec -t -i ${CONTAINER_NAME} bash
106+
107+
108+
vue-ui: ## Access Docker container terminal.
109+
docker exec ${CONTAINER_NAME} yarn vue-ui
110+
111+
112+
stop: ## Stop/start Docker container
113+
docker stop ${CONTAINER_NAME}
114+
start: ## Stop/start Docker container
115+
docker start ${CONTAINER_NAME}
116+
117+
.PHONY: banner info help clean clean-yarn-cache build up up-detach down logs serve start stop ssh vue-ui

README.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# my-front, tests for a Vue.js frontend
2+
3+
## Project setup
4+
*Hint*, run
5+
```shell
6+
$ make info
7+
```
8+
to view all the available commands thanks to make -)
9+
10+
```shell
11+
$ make build
12+
```
13+
14+
Else, you can:
15+
```shell
16+
$ cp .env.dist .env
17+
$ cp docker-compose.override.yml.dist docker-compose.override.yml
18+
$ docker-compose build
19+
```
20+
21+
And then you can configure in the `.env` and `docker-compose.override.yml` files if needed.
22+
23+
### Compiles and hot-reloads for development
24+
```shell
25+
$ make up
26+
# Browse http://localhost:8080
27+
```
28+
29+
### Lints and fixes files / run unit tests
30+
```shell
31+
$ make lint
32+
# e.g. yarn lint
33+
34+
$ make test
35+
# e.g. yarn test
36+
```
37+
38+
### Compiles and minifies for production
39+
```shell
40+
$ make prod
41+
# Get the result in the 'dist' directory
42+
# e.g. yarn build
43+
```
44+
45+
### Customize configuration
46+
See [Configuration Reference](https://cli.vuejs.org/config/).

babel.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset'
4+
]
5+
}

docker-compose.override.yml.dist

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: "3.8"
2+
3+
services:
4+
# Front UI build tools and development server
5+
# VueJS application
6+
node-vuejs:
7+
ports:
8+
- "8080:8080"
9+
- "9080:${VUE_UI_PORT}"
10+
volumes:
11+
# Vue ongoing dev application
12+
- .:/app/
13+
# Vue UI live configuration
14+
- .docker-home-vue/.vuerc:/home/node/.vuerc
15+
- .docker-home-vue/.vue-cli-ui:/home/node/.vue-cli-ui
16+
17+
# Front UI production web server
18+
nginx-ui:
19+
ports:
20+
- "3001:80"
21+
volumes:
22+
# Vue built application for production
23+
- ./dist/:/usr/share/nginx/html/:ro

0 commit comments

Comments
 (0)