├── vue.config.js ├── public ├── favicon.ico └── index.html ├── src ├── assets │ └── logo.png ├── http-common.js ├── main.js ├── services │ └── ExplorerService.js ├── router.js ├── App.vue └── components │ ├── ExplorersList.vue │ ├── AddExplorer.vue │ └── Explorer.vue ├── babel.config.js ├── .gitignore ├── README.md └── package.json /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | devServer: { 3 | port: 8081 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RodolfoBaume/client-launchx/master/public/favicon.ico -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RodolfoBaume/client-launchx/master/src/assets/logo.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /src/http-common.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | export default axios.create({ 3 | baseURL: "http://localhost:3000", 4 | headers: { 5 | "Content-type": "application/json" 6 | } 7 | }); 8 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import 'bootstrap' 4 | import 'bootstrap/dist/css/bootstrap.min.css' 5 | import router from './router' 6 | createApp(App).use(router).mount('#app') 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-3-crud 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | npm run lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /src/services/ExplorerService.js: -------------------------------------------------------------------------------- 1 | import http from "../http-common"; 2 | 3 | class ExplorerService { 4 | getAll() { 5 | return http.get("/explorers"); 6 | } 7 | get(id) { 8 | return http.get(`/explorers/${id}`); 9 | } 10 | create(data) { 11 | return http.post("/explorers", data); 12 | } 13 | update(id, data) { 14 | return http.put(`/explorers/${id}`, data); 15 | } 16 | delete(id) { 17 | return http.delete(`/explorers/${id}`); 18 | } 19 | } 20 | 21 | export default new ExplorerService(); 22 | -------------------------------------------------------------------------------- /src/router.js: -------------------------------------------------------------------------------- 1 | import { createWebHistory, createRouter } from "vue-router"; 2 | const routes = [ 3 | { 4 | path: "/", 5 | alias: "/explorers", 6 | name: "explorers", 7 | component: () => import("./components/ExplorersList") 8 | }, 9 | { 10 | path: "/explorer/:id", 11 | name: "explorer-details", 12 | component: () => import("./components/Explorer") 13 | }, 14 | { 15 | path: "/add", 16 | name: "add-explorer", 17 | component: () => import("./components/AddExplorer") 18 | } 19 | ]; 20 | const router = createRouter({ 21 | history: createWebHistory(), 22 | routes, 23 | }); 24 | export default router; 25 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 19 | 24 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "launch-x", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build --dest build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "axios": "^0.26.0", 12 | "bootstrap": "^4.6.0", 13 | "core-js": "^3.6.5", 14 | "jquery": "^3.6.0", 15 | "popper.js": "^1.16.1", 16 | "vue": "^3.0.0", 17 | "vue-router": "^4.0.12" 18 | }, 19 | "devDependencies": { 20 | "@vue/cli-plugin-babel": "~4.5.0", 21 | "@vue/cli-plugin-eslint": "~4.5.0", 22 | "@vue/cli-service": "~4.5.0", 23 | "@vue/compiler-sfc": "^3.0.0", 24 | "babel-eslint": "^10.1.0", 25 | "eslint": "^6.7.2", 26 | "eslint-plugin-vue": "^7.0.0" 27 | }, 28 | "eslintConfig": { 29 | "root": true, 30 | "env": { 31 | "node": true 32 | }, 33 | "extends": [ 34 | "plugin:vue/vue3-essential", 35 | "eslint:recommended" 36 | ], 37 | "parserOptions": { 38 | "parser": "babel-eslint" 39 | }, 40 | "rules": {} 41 | }, 42 | "browserslist": [ 43 | "> 1%", 44 | "last 2 versions", 45 | "not dead" 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /src/components/ExplorersList.vue: -------------------------------------------------------------------------------- 1 | 34 | 71 | -------------------------------------------------------------------------------- /src/components/AddExplorer.vue: -------------------------------------------------------------------------------- 1 | 46 | 47 | 85 | -------------------------------------------------------------------------------- /src/components/Explorer.vue: -------------------------------------------------------------------------------- 1 | 37 | 84 | 85 | 91 | --------------------------------------------------------------------------------