├── .browserslistrc ├── .eslintrc.js ├── .gitignore ├── README.md ├── babel.config.js ├── package.json ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── assets │ └── logo.png ├── main.js ├── modules │ └── daybook │ │ ├── components │ │ ├── Entry.vue │ │ ├── EntryList.vue │ │ ├── Fab.vue │ │ └── Navbar.vue │ │ ├── layouts │ │ └── DayBookLayout.vue │ │ ├── router │ │ └── index.js │ │ ├── store │ │ └── journal │ │ │ ├── actions.js │ │ │ ├── getters.js │ │ │ ├── index.js │ │ │ ├── mutations.js │ │ │ └── state.js │ │ └── views │ │ ├── EntryView.vue │ │ └── NoEntrySelected.vue ├── router │ └── index.js ├── store │ ├── index.js │ └── module-template │ │ ├── actions.js │ │ ├── getters.js │ │ ├── index.js │ │ ├── mutations.js │ │ └── state.js ├── styles │ └── styles.scss └── views │ ├── About.vue │ └── Home.vue └── yarn.lock /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/vue3-essential', 8 | 'eslint:recommended' 9 | ], 10 | parserOptions: { 11 | parser: 'babel-eslint' 12 | }, 13 | rules: { 14 | 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 15 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.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 | # journal 2 | 3 | ## Project setup 4 | ``` 5 | yarn install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | yarn serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | yarn build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | yarn lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "journal", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "bootstrap": "^5.0.2", 12 | "core-js": "^3.6.5", 13 | "vue": "^3.0.0", 14 | "vue-router": "^4.0.0-0", 15 | "vuex": "^4.0.2" 16 | }, 17 | "devDependencies": { 18 | "@vue/cli-plugin-babel": "~4.5.0", 19 | "@vue/cli-plugin-eslint": "~4.5.0", 20 | "@vue/cli-plugin-router": "~4.5.0", 21 | "@vue/cli-service": "~4.5.0", 22 | "@vue/compiler-sfc": "^3.0.0", 23 | "babel-eslint": "^10.1.0", 24 | "eslint": "^6.7.2", 25 | "eslint-plugin-vue": "^7.0.0", 26 | "sass": "^1.35.2", 27 | "sass-loader": "10" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/vue-journal-vuex/2ebf8cdc4b5352f18141bf7ee80dd0636524e5aa/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 12 | 13 | 16 |
17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Klerith/vue-journal-vuex/2ebf8cdc4b5352f18141bf7ee80dd0636524e5aa/src/assets/logo.png -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import store from './store' 5 | 6 | import './styles/styles.scss' 7 | 8 | createApp(App) 9 | .use( store ) 10 | .use( router ) 11 | .mount('#app') 12 | -------------------------------------------------------------------------------- /src/modules/daybook/components/Entry.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /src/modules/daybook/components/EntryList.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 29 | 30 | 31 | 32 | 43 | -------------------------------------------------------------------------------- /src/modules/daybook/components/Fab.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 20 | 21 | -------------------------------------------------------------------------------- /src/modules/daybook/components/Navbar.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/modules/daybook/layouts/DayBookLayout.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/modules/daybook/router/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | export default { 4 | 5 | name: 'daybook', 6 | component: () => import(/* webpackChunkName: "daybook" */ '@/modules/daybook/layouts/DayBookLayout.vue'), 7 | children: [ 8 | { 9 | path: '', 10 | name: 'no-entry', 11 | component: () => import(/* webpackChunkName: "daybook-no-entry" */ '@/modules/daybook/views/NoEntrySelected.vue'), 12 | }, 13 | { 14 | path: ':id', 15 | name: 'entry', 16 | component: () => import(/* webpackChunkName: "daybook-no-entry" */ '@/modules/daybook/views/EntryView.vue'), 17 | } 18 | ] 19 | 20 | } -------------------------------------------------------------------------------- /src/modules/daybook/store/journal/actions.js: -------------------------------------------------------------------------------- 1 | 2 | // export const myAction = async ({ commit }) => { 3 | 4 | // } 5 | 6 | export const loadEntries = async (/*{ commit }*/) => { 7 | 8 | } 9 | 10 | export const updateEntry = async (/*{ commit }*/) => { 11 | 12 | } 13 | 14 | 15 | export const createEntry = async (/*{ commit }*/) => { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/modules/daybook/store/journal/getters.js: -------------------------------------------------------------------------------- 1 | 2 | // export const myGetter = ( state ) => { 3 | // return state 4 | // } 5 | 6 | export const getEntriesByTerm = ( /*state*/ ) => { 7 | 8 | } 9 | 10 | export const getEntryById = ( /*state*/ ) => { 11 | 12 | } 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/modules/daybook/store/journal/index.js: -------------------------------------------------------------------------------- 1 | 2 | import state from './state' 3 | import * as actions from './actions' 4 | import * as getters from './getters' 5 | import * as mutations from './mutations' 6 | 7 | 8 | const journalModule = { 9 | namespaced: true, 10 | actions, 11 | getters, 12 | mutations, 13 | state 14 | } 15 | 16 | 17 | export default journalModule 18 | -------------------------------------------------------------------------------- /src/modules/daybook/store/journal/mutations.js: -------------------------------------------------------------------------------- 1 | 2 | // export const myAction = ( state ) => { 3 | 4 | // } 5 | 6 | export const setEntries = (/* state */ ) => { 7 | 8 | } 9 | 10 | export const updateEntry = (/* state */ ) => { 11 | 12 | } 13 | 14 | export const addEntry = (/* state */ ) => { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/modules/daybook/store/journal/state.js: -------------------------------------------------------------------------------- 1 | 2 | export default () => ({ 3 | isLoading: true, 4 | entries: [ 5 | { 6 | id: new Date().getTime(), // 12371298317892 7 | date: new Date().toDateString(), // sat 23, julio 8 | text: 'Minim exercitation ad nulla occaecat eiusmod qui enim amet voluptate incididunt esse. Consequat aute cillum laborum in. Est ullamco cillum aute do consequat culpa do non est consequat anim aliqua. Proident nostrud aute sit nisi velit. Tempor officia mollit quis eu aute deserunt laborum est ullamco minim. Do consectetur irure eu dolore reprehenderit dolor qui fugiat aliquip enim qui duis nisi sit. Aliqua velit non nostrud reprehenderit aliquip exercitation anim tempor sint irure aliquip.', 9 | picture: null, // https:// 10 | }, 11 | { 12 | id: new Date().getTime() + 1000, // 12371298317892 13 | date: new Date().toDateString(), // sat 23, julio 14 | text: 'Voluptate culpa sit ea nisi labore amet fugiat cupidatat duis culpa ex adipisicing enim quis. Ea aliquip laboris Lorem do irure amet qui fugiat. Officia laboris consectetur sint mollit est est aute mollit ut labore quis id do.', 15 | picture: null, // https:// 16 | }, 17 | { 18 | id: new Date().getTime() + 2000, // 12371298317892 19 | date: new Date().toDateString(), // sat 23, julio 20 | text: 'Fugiat consequat consectetur deserunt esse labore proident sit cupidatat nisi commodo eiusmod occaecat occaecat. Aute dolore voluptate ut id reprehenderit cupidatat cillum. Duis nisi magna est fugiat ut eu. Veniam consectetur in nulla officia eiusmod qui ad pariatur culpa eiusmod duis sint Lorem sit. Sunt proident veniam culpa labore sit enim ad ad.', 21 | picture: null, // https:// 22 | }, 23 | ] 24 | }) -------------------------------------------------------------------------------- /src/modules/daybook/views/EntryView.vue: -------------------------------------------------------------------------------- 1 | 40 | 41 | 52 | 53 | -------------------------------------------------------------------------------- /src/modules/daybook/views/NoEntrySelected.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 19 | 20 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHashHistory } from 'vue-router' 2 | import Home from '../views/Home.vue' 3 | 4 | import daybookRouter from '../modules/daybook/router' 5 | 6 | const routes = [ 7 | { 8 | path: '/', 9 | name: 'Home', 10 | component: Home 11 | }, 12 | { 13 | path: '/about', 14 | name: 'About', 15 | // route level code-splitting 16 | // this generates a separate chunk (about.[hash].js) for this route 17 | // which is lazy-loaded when the route is visited. 18 | component: () => import(/* webpackChunkName: "about" */ '../views/About.vue') 19 | }, 20 | { 21 | path: '/daybook', 22 | ...daybookRouter 23 | } 24 | ] 25 | 26 | const router = createRouter({ 27 | history: createWebHashHistory(), 28 | routes 29 | }) 30 | 31 | export default router 32 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import { createStore } from 'vuex' 2 | 3 | import journal from '../modules/daybook/store/journal' 4 | 5 | 6 | const store = createStore({ 7 | modules: { 8 | journal 9 | } 10 | }) 11 | 12 | 13 | 14 | 15 | export default store -------------------------------------------------------------------------------- /src/store/module-template/actions.js: -------------------------------------------------------------------------------- 1 | 2 | // export const myAction = async ({ commit }) => { 3 | 4 | // } 5 | 6 | -------------------------------------------------------------------------------- /src/store/module-template/getters.js: -------------------------------------------------------------------------------- 1 | 2 | // export const myGetter = ( state ) => { 3 | // return state 4 | // } 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/store/module-template/index.js: -------------------------------------------------------------------------------- 1 | 2 | import state from './state' 3 | import * as actions from './actions' 4 | import * as getters from './getters' 5 | import * as mutations from './mutations' 6 | 7 | 8 | const myCustomModule = { 9 | namespaced: true, 10 | actions, 11 | getters, 12 | mutations, 13 | state 14 | } 15 | 16 | 17 | export default myCustomModule 18 | -------------------------------------------------------------------------------- /src/store/module-template/mutations.js: -------------------------------------------------------------------------------- 1 | 2 | // export const myAction = ( state ) => { 3 | 4 | // } 5 | -------------------------------------------------------------------------------- /src/store/module-template/state.js: -------------------------------------------------------------------------------- 1 | 2 | // export default () => ({ 3 | 4 | // }) -------------------------------------------------------------------------------- /src/styles/styles.scss: -------------------------------------------------------------------------------- 1 | $theme-colors: ( 2 | "primary": #2c3e50, 3 | "secondary": #1d6042, 4 | "success": #198754, 5 | "info": #0dcaf0, 6 | "warning": #ffc107, 7 | "danger": #dc3545, 8 | "light": #f8f9fa, 9 | "dark": #343a40, 10 | ); 11 | 12 | 13 | 14 | @import 'node_modules/bootstrap/scss/bootstrap.scss'; 15 | 16 | .pointer { 17 | cursor: pointer; 18 | } -------------------------------------------------------------------------------- /src/views/About.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 24 | 25 | --------------------------------------------------------------------------------