├── .gitignore ├── README.md ├── e-vents-api ├── .editorconfig ├── .env.example ├── .eslintignore ├── .eslintrc ├── .gitignore ├── README.md ├── api │ ├── .gitkeep │ ├── category │ │ ├── config │ │ │ └── routes.json │ │ ├── controllers │ │ │ └── category.js │ │ ├── models │ │ │ ├── category.js │ │ │ └── category.settings.json │ │ └── services │ │ │ └── category.js │ └── event │ │ ├── config │ │ └── routes.json │ │ ├── controllers │ │ └── event.js │ │ ├── models │ │ ├── event.js │ │ └── event.settings.json │ │ └── services │ │ └── event.js ├── config │ ├── database.js │ ├── functions │ │ ├── bootstrap.js │ │ ├── cron.js │ │ └── responses │ │ │ └── 404.js │ └── server.js ├── extensions │ ├── .gitkeep │ └── users-permissions │ │ └── config │ │ └── jwt.js ├── favicon.ico ├── package.json ├── public │ ├── robots.txt │ └── uploads │ │ └── .gitkeep └── yarn.lock └── e-vents-front ├── .gitignore ├── README.md ├── gridsome.config.js ├── gridsome.server.js ├── package-lock.json ├── package.json ├── src ├── components │ └── README.md ├── favicon.png ├── layouts │ ├── Default.vue │ └── README.md ├── main.js ├── pages │ ├── Index.vue │ └── README.md └── templates │ ├── Event.vue │ └── README.md ├── static └── README.md └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,vim,visualstudiocode 2 | # Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,linux,vim,visualstudiocode 3 | 4 | ### Linux ### 5 | *~ 6 | 7 | # temporary files which can be created if a process still has a handle open of a deleted file 8 | .fuse_hidden* 9 | 10 | # KDE directory preferences 11 | .directory 12 | 13 | # Linux trash folder which might appear on any partition or disk 14 | .Trash-* 15 | 16 | # .nfs files are created when an open file is removed but is still being accessed 17 | .nfs* 18 | 19 | ### macOS ### 20 | # General 21 | .DS_Store 22 | .AppleDouble 23 | .LSOverride 24 | 25 | # Icon must end with two \r 26 | Icon 27 | 28 | # Thumbnails 29 | ._* 30 | 31 | # Files that might appear in the root of a volume 32 | .DocumentRevisions-V100 33 | .fseventsd 34 | .Spotlight-V100 35 | .TemporaryItems 36 | .Trashes 37 | .VolumeIcon.icns 38 | .com.apple.timemachine.donotpresent 39 | 40 | # Directories potentially created on remote AFP share 41 | .AppleDB 42 | .AppleDesktop 43 | Network Trash Folder 44 | Temporary Items 45 | .apdisk 46 | 47 | ### Vim ### 48 | # Swap 49 | [._]*.s[a-v][a-z] 50 | !*.svg # comment out if you don't need vector files 51 | [._]*.sw[a-p] 52 | [._]s[a-rt-v][a-z] 53 | [._]ss[a-gi-z] 54 | [._]sw[a-p] 55 | 56 | # Session 57 | Session.vim 58 | Sessionx.vim 59 | 60 | # Temporary 61 | .netrwhist 62 | # Auto-generated tag files 63 | tags 64 | # Persistent undo 65 | [._]*.un~ 66 | 67 | ### VisualStudioCode ### 68 | .vscode/* 69 | !.vscode/settings.json 70 | !.vscode/tasks.json 71 | !.vscode/launch.json 72 | !.vscode/extensions.json 73 | *.code-workspace 74 | 75 | ### VisualStudioCode Patch ### 76 | # Ignore all local history of files 77 | .history 78 | 79 | ### Windows ### 80 | # Windows thumbnail cache files 81 | Thumbs.db 82 | Thumbs.db:encryptable 83 | ehthumbs.db 84 | ehthumbs_vista.db 85 | 86 | # Dump file 87 | *.stackdump 88 | 89 | # Folder config file 90 | [Dd]esktop.ini 91 | 92 | # Recycle Bin used on file shares 93 | $RECYCLE.BIN/ 94 | 95 | # Windows Installer files 96 | *.cab 97 | *.msi 98 | *.msix 99 | *.msm 100 | *.msp 101 | 102 | # Windows shortcuts 103 | *.lnk 104 | 105 | # End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux,vim,visualstudiocode 106 | 107 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Gridsome and Strapi Tutorial 2 | 3 | This repo was built for a YouTube tutorial. 4 | 5 | ## Running Locally 6 | 7 | **Front-end:** 8 | 9 | 1. `npm install` 10 | 1. `npm run develop` 11 | 1. App will run on port `8080` 12 | 13 | **Back-end:** 14 | 15 | 1. `npm install` 16 | 1. `npm run develop` 17 | 1. App will run on port `1337` 18 | 1. Go to [http://localhost:1337/admin](http://localhost:1337/admin) and create a new user. 19 | 1. Follow the tutorial on YouTube to create events and categories that the front-end can display. 20 | 1. Don't forget to allow get request permissions for events. 21 | -------------------------------------------------------------------------------- /e-vents-api/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [{package.json,*.yml}] 12 | indent_style = space 13 | indent_size = 2 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /e-vents-api/.env.example: -------------------------------------------------------------------------------- 1 | HOST=0.0.0.0 2 | PORT=1337 3 | -------------------------------------------------------------------------------- /e-vents-api/.eslintignore: -------------------------------------------------------------------------------- 1 | .cache 2 | build 3 | **/node_modules/** 4 | -------------------------------------------------------------------------------- /e-vents-api/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "extends": "eslint:recommended", 4 | "env": { 5 | "commonjs": true, 6 | "es6": true, 7 | "node": true, 8 | "browser": false 9 | }, 10 | "parserOptions": { 11 | "ecmaFeatures": { 12 | "experimentalObjectRestSpread": true, 13 | "jsx": false 14 | }, 15 | "sourceType": "module" 16 | }, 17 | "globals": { 18 | "strapi": true 19 | }, 20 | "rules": { 21 | "indent": ["error", 2, { "SwitchCase": 1 }], 22 | "linebreak-style": ["error", "unix"], 23 | "no-console": 0, 24 | "quotes": ["error", "single"], 25 | "semi": ["error", "always"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /e-vents-api/.gitignore: -------------------------------------------------------------------------------- 1 | ############################ 2 | # OS X 3 | ############################ 4 | 5 | .DS_Store 6 | .AppleDouble 7 | .LSOverride 8 | Icon 9 | .Spotlight-V100 10 | .Trashes 11 | ._* 12 | 13 | 14 | ############################ 15 | # Linux 16 | ############################ 17 | 18 | *~ 19 | 20 | 21 | ############################ 22 | # Windows 23 | ############################ 24 | 25 | Thumbs.db 26 | ehthumbs.db 27 | Desktop.ini 28 | $RECYCLE.BIN/ 29 | *.cab 30 | *.msi 31 | *.msm 32 | *.msp 33 | 34 | 35 | ############################ 36 | # Packages 37 | ############################ 38 | 39 | *.7z 40 | *.csv 41 | *.dat 42 | *.dmg 43 | *.gz 44 | *.iso 45 | *.jar 46 | *.rar 47 | *.tar 48 | *.zip 49 | *.com 50 | *.class 51 | *.dll 52 | *.exe 53 | *.o 54 | *.seed 55 | *.so 56 | *.swo 57 | *.swp 58 | *.swn 59 | *.swm 60 | *.out 61 | *.pid 62 | 63 | 64 | ############################ 65 | # Logs and databases 66 | ############################ 67 | 68 | .tmp 69 | *.log 70 | *.sql 71 | *.sqlite 72 | *.sqlite3 73 | 74 | 75 | ############################ 76 | # Misc. 77 | ############################ 78 | 79 | *# 80 | ssl 81 | .idea 82 | nbproject 83 | public/uploads/* 84 | !public/uploads/.gitkeep 85 | 86 | ############################ 87 | # Node.js 88 | ############################ 89 | 90 | lib-cov 91 | lcov.info 92 | pids 93 | logs 94 | results 95 | node_modules 96 | .node_history 97 | 98 | 99 | ############################ 100 | # Tests 101 | ############################ 102 | 103 | testApp 104 | coverage 105 | 106 | ############################ 107 | # Strapi 108 | ############################ 109 | 110 | .env 111 | exports 112 | .cache 113 | build 114 | -------------------------------------------------------------------------------- /e-vents-api/README.md: -------------------------------------------------------------------------------- 1 | # Strapi application 2 | 3 | A quick description of your strapi application 4 | -------------------------------------------------------------------------------- /e-vents-api/api/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwenf/gridsome-strapi-tutorial/b3c7887b9bd7371b8b4b57daa03aeec588249591/e-vents-api/api/.gitkeep -------------------------------------------------------------------------------- /e-vents-api/api/category/config/routes.json: -------------------------------------------------------------------------------- 1 | { 2 | "routes": [ 3 | { 4 | "method": "GET", 5 | "path": "/categories", 6 | "handler": "category.find", 7 | "config": { 8 | "policies": [] 9 | } 10 | }, 11 | { 12 | "method": "GET", 13 | "path": "/categories/count", 14 | "handler": "category.count", 15 | "config": { 16 | "policies": [] 17 | } 18 | }, 19 | { 20 | "method": "GET", 21 | "path": "/categories/:id", 22 | "handler": "category.findOne", 23 | "config": { 24 | "policies": [] 25 | } 26 | }, 27 | { 28 | "method": "POST", 29 | "path": "/categories", 30 | "handler": "category.create", 31 | "config": { 32 | "policies": [] 33 | } 34 | }, 35 | { 36 | "method": "PUT", 37 | "path": "/categories/:id", 38 | "handler": "category.update", 39 | "config": { 40 | "policies": [] 41 | } 42 | }, 43 | { 44 | "method": "DELETE", 45 | "path": "/categories/:id", 46 | "handler": "category.delete", 47 | "config": { 48 | "policies": [] 49 | } 50 | } 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /e-vents-api/api/category/controllers/category.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers) 5 | * to customize this controller 6 | */ 7 | 8 | module.exports = {}; 9 | -------------------------------------------------------------------------------- /e-vents-api/api/category/models/category.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Read the documentation (https://strapi.io/documentation/v3.x/concepts/models.html#lifecycle-hooks) 5 | * to customize this model 6 | */ 7 | 8 | module.exports = {}; 9 | -------------------------------------------------------------------------------- /e-vents-api/api/category/models/category.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "collectionType", 3 | "collectionName": "categories", 4 | "info": { 5 | "name": "Category" 6 | }, 7 | "options": { 8 | "increments": true, 9 | "timestamps": true 10 | }, 11 | "attributes": { 12 | "name": { 13 | "type": "string" 14 | }, 15 | "events": { 16 | "via": "categories", 17 | "collection": "event", 18 | "dominant": true 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /e-vents-api/api/category/services/category.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Read the documentation (https://strapi.io/documentation/v3.x/concepts/services.html#core-services) 5 | * to customize this service 6 | */ 7 | 8 | module.exports = {}; 9 | -------------------------------------------------------------------------------- /e-vents-api/api/event/config/routes.json: -------------------------------------------------------------------------------- 1 | { 2 | "routes": [ 3 | { 4 | "method": "GET", 5 | "path": "/events", 6 | "handler": "event.find", 7 | "config": { 8 | "policies": [] 9 | } 10 | }, 11 | { 12 | "method": "GET", 13 | "path": "/events/count", 14 | "handler": "event.count", 15 | "config": { 16 | "policies": [] 17 | } 18 | }, 19 | { 20 | "method": "GET", 21 | "path": "/events/:id", 22 | "handler": "event.findOne", 23 | "config": { 24 | "policies": [] 25 | } 26 | }, 27 | { 28 | "method": "POST", 29 | "path": "/events", 30 | "handler": "event.create", 31 | "config": { 32 | "policies": [] 33 | } 34 | }, 35 | { 36 | "method": "PUT", 37 | "path": "/events/:id", 38 | "handler": "event.update", 39 | "config": { 40 | "policies": [] 41 | } 42 | }, 43 | { 44 | "method": "DELETE", 45 | "path": "/events/:id", 46 | "handler": "event.delete", 47 | "config": { 48 | "policies": [] 49 | } 50 | } 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /e-vents-api/api/event/controllers/event.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers) 5 | * to customize this controller 6 | */ 7 | 8 | module.exports = {}; 9 | -------------------------------------------------------------------------------- /e-vents-api/api/event/models/event.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Read the documentation (https://strapi.io/documentation/v3.x/concepts/models.html#lifecycle-hooks) 5 | * to customize this model 6 | */ 7 | 8 | module.exports = {}; 9 | -------------------------------------------------------------------------------- /e-vents-api/api/event/models/event.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "collectionType", 3 | "collectionName": "events", 4 | "info": { 5 | "name": "Event" 6 | }, 7 | "options": { 8 | "increments": true, 9 | "timestamps": true 10 | }, 11 | "attributes": { 12 | "title": { 13 | "type": "string" 14 | }, 15 | "description": { 16 | "type": "text" 17 | }, 18 | "date": { 19 | "type": "datetime" 20 | }, 21 | "duration": { 22 | "type": "decimal" 23 | }, 24 | "price": { 25 | "type": "decimal" 26 | }, 27 | "categories": { 28 | "collection": "category", 29 | "via": "events" 30 | }, 31 | "image": { 32 | "model": "file", 33 | "via": "related", 34 | "allowedTypes": [ 35 | "images", 36 | "files", 37 | "videos" 38 | ], 39 | "plugin": "upload", 40 | "required": false 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /e-vents-api/api/event/services/event.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Read the documentation (https://strapi.io/documentation/v3.x/concepts/services.html#core-services) 5 | * to customize this service 6 | */ 7 | 8 | module.exports = {}; 9 | -------------------------------------------------------------------------------- /e-vents-api/config/database.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ env }) => ({ 2 | defaultConnection: 'default', 3 | connections: { 4 | default: { 5 | connector: 'bookshelf', 6 | settings: { 7 | client: 'sqlite', 8 | filename: env('DATABASE_FILENAME', '.tmp/data.db'), 9 | }, 10 | options: { 11 | useNullAsDefault: true, 12 | }, 13 | }, 14 | }, 15 | }); 16 | -------------------------------------------------------------------------------- /e-vents-api/config/functions/bootstrap.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * An asynchronous bootstrap function that runs before 5 | * your application gets started. 6 | * 7 | * This gives you an opportunity to set up your data model, 8 | * run jobs, or perform some special logic. 9 | * 10 | * See more details here: https://strapi.io/documentation/v3.x/concepts/configurations.html#bootstrap 11 | */ 12 | 13 | module.exports = () => {}; 14 | -------------------------------------------------------------------------------- /e-vents-api/config/functions/cron.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | /** 4 | * Cron config that gives you an opportunity 5 | * to run scheduled jobs. 6 | * 7 | * The cron format consists of: 8 | * [SECOND (optional)] [MINUTE] [HOUR] [DAY OF MONTH] [MONTH OF YEAR] [DAY OF WEEK] 9 | * 10 | * See more details here: https://strapi.io/documentation/v3.x/concepts/configurations.html#cron-tasks 11 | */ 12 | 13 | module.exports = { 14 | /** 15 | * Simple example. 16 | * Every monday at 1am. 17 | */ 18 | // '0 1 * * 1': () => { 19 | // 20 | // } 21 | }; 22 | -------------------------------------------------------------------------------- /e-vents-api/config/functions/responses/404.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = async (/* ctx */) => { 4 | // return ctx.notFound('My custom message 404'); 5 | }; 6 | -------------------------------------------------------------------------------- /e-vents-api/config/server.js: -------------------------------------------------------------------------------- 1 | module.exports = ({ env }) => ({ 2 | host: env('HOST', '0.0.0.0'), 3 | port: env.int('PORT', 1337), 4 | }); 5 | -------------------------------------------------------------------------------- /e-vents-api/extensions/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwenf/gridsome-strapi-tutorial/b3c7887b9bd7371b8b4b57daa03aeec588249591/e-vents-api/extensions/.gitkeep -------------------------------------------------------------------------------- /e-vents-api/extensions/users-permissions/config/jwt.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | jwtSecret: process.env.JWT_SECRET || 'b5b2e3e7-b2bd-4576-b9cb-d378d438dab3' 3 | }; -------------------------------------------------------------------------------- /e-vents-api/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwenf/gridsome-strapi-tutorial/b3c7887b9bd7371b8b4b57daa03aeec588249591/e-vents-api/favicon.ico -------------------------------------------------------------------------------- /e-vents-api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "e-vents-api", 3 | "private": true, 4 | "version": "0.1.0", 5 | "description": "A Strapi application", 6 | "scripts": { 7 | "develop": "strapi develop", 8 | "start": "strapi start", 9 | "build": "strapi build", 10 | "strapi": "strapi" 11 | }, 12 | "devDependencies": {}, 13 | "dependencies": { 14 | "strapi": "3.0.6", 15 | "strapi-admin": "3.0.6", 16 | "strapi-utils": "3.0.6", 17 | "strapi-plugin-content-type-builder": "3.0.6", 18 | "strapi-plugin-content-manager": "3.0.6", 19 | "strapi-plugin-users-permissions": "3.0.6", 20 | "strapi-plugin-email": "3.0.6", 21 | "strapi-plugin-upload": "3.0.6", 22 | "strapi-connector-bookshelf": "3.0.6", 23 | "knex": "<0.20.0", 24 | "sqlite3": "latest" 25 | }, 26 | "author": { 27 | "name": "A Strapi developer" 28 | }, 29 | "strapi": { 30 | "uuid": "af235907-6c0d-4b66-a342-d80d498e66b8" 31 | }, 32 | "engines": { 33 | "node": ">=10.0.0", 34 | "npm": ">=6.0.0" 35 | }, 36 | "license": "MIT" 37 | } 38 | -------------------------------------------------------------------------------- /e-vents-api/public/robots.txt: -------------------------------------------------------------------------------- 1 | # To prevent search engines from seeing the site altogether, uncomment the next two lines: 2 | # User-Agent: * 3 | # Disallow: / 4 | -------------------------------------------------------------------------------- /e-vents-api/public/uploads/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwenf/gridsome-strapi-tutorial/b3c7887b9bd7371b8b4b57daa03aeec588249591/e-vents-api/public/uploads/.gitkeep -------------------------------------------------------------------------------- /e-vents-front/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .cache 3 | .DS_Store 4 | src/.temp 5 | node_modules 6 | dist 7 | .env 8 | .env.* 9 | -------------------------------------------------------------------------------- /e-vents-front/README.md: -------------------------------------------------------------------------------- 1 | # Default starter for Gridsome 2 | 3 | This is the project you get when you run `gridsome create new-project`. 4 | 5 | ### 1. Install Gridsome CLI tool if you don't have 6 | 7 | `npm install --global @gridsome/cli` 8 | 9 | ### 2. Create a Gridsome project 10 | 11 | 1. `gridsome create my-gridsome-site` to install default starter 12 | 2. `cd my-gridsome-site` to open the folder 13 | 3. `gridsome develop` to start a local dev server at `http://localhost:8080` 14 | 4. Happy coding 🎉🙌 15 | -------------------------------------------------------------------------------- /e-vents-front/gridsome.config.js: -------------------------------------------------------------------------------- 1 | // This is where project configuration and plugin options are located. 2 | // Learn more: https://gridsome.org/docs/config 3 | 4 | // Changes here require a server restart. 5 | // To restart press CTRL + C in terminal and run `gridsome develop` 6 | 7 | module.exports = { 8 | siteName: 'E-vents', 9 | siteDescription: 'Post or find online events.', 10 | plugins: [] 11 | } 12 | -------------------------------------------------------------------------------- /e-vents-front/gridsome.server.js: -------------------------------------------------------------------------------- 1 | // Server API makes it possible to hook into various parts of Gridsome 2 | // on server-side and add custom data to the GraphQL data layer. 3 | // Learn more: https://gridsome.org/docs/server-api/ 4 | 5 | // Changes here require a server restart. 6 | // To restart press CTRL + C in terminal and run `gridsome develop` 7 | const axios = require('axios') 8 | 9 | module.exports = function (api) { 10 | api.chainWebpack((config, { isServer }) => { 11 | if (isServer) { 12 | config.externals([ 13 | nodeExternals({ 14 | whitelist: [/^vuetify/] 15 | }) 16 | ]) 17 | } 18 | }) 19 | 20 | api.loadSource(async actions => { 21 | const { data } = await axios.get('http://localhost:1337/events') 22 | 23 | const collection = actions.addCollection({ 24 | typeName: 'Event', 25 | path: '/events/:id' 26 | }) 27 | 28 | for (const event of data) { 29 | collection.addNode({ 30 | id: event.id, 31 | path: '/events/' + event.id, 32 | title: event.title, 33 | description: event.description, 34 | price: event.price, 35 | date: event.date, 36 | duration: event.duration, 37 | thumbnail: event.image.formats.thumbnail.url, 38 | image: event.image.formats.medium.url, 39 | category: event.categories[0].id 40 | }) 41 | } 42 | }) 43 | } 44 | -------------------------------------------------------------------------------- /e-vents-front/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "e-vents-front", 3 | "private": true, 4 | "scripts": { 5 | "build": "gridsome build", 6 | "develop": "gridsome develop", 7 | "explore": "gridsome explore" 8 | }, 9 | "dependencies": { 10 | "axios": "0.19.2", 11 | "gridsome": "^0.7.0", 12 | "moment": "2.27.0", 13 | "vuetify": "2.3.6" 14 | }, 15 | "devDependencies": { 16 | "webpack-node-externals": "2.5.0" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /e-vents-front/src/components/README.md: -------------------------------------------------------------------------------- 1 | Add components that will be imported to Pages and Layouts to this folder. 2 | Learn more about components here: https://gridsome.org/docs/components/ 3 | 4 | You can delete this file. 5 | -------------------------------------------------------------------------------- /e-vents-front/src/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwenf/gridsome-strapi-tutorial/b3c7887b9bd7371b8b4b57daa03aeec588249591/e-vents-front/src/favicon.png -------------------------------------------------------------------------------- /e-vents-front/src/layouts/Default.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | 38 | query { 39 | metadata { 40 | siteName, 41 | siteDescription 42 | } 43 | } 44 | 45 | 46 | 55 | 56 | 62 | -------------------------------------------------------------------------------- /e-vents-front/src/layouts/README.md: -------------------------------------------------------------------------------- 1 | Layout components are used to wrap pages and templates. Layouts should contain components like headers, footers or sidebars that will be used across the site. 2 | 3 | Learn more about Layouts: https://gridsome.org/docs/layouts/ 4 | 5 | You can delete this file. 6 | -------------------------------------------------------------------------------- /e-vents-front/src/main.js: -------------------------------------------------------------------------------- 1 | // This is the main.js file. Import global CSS and scripts here. 2 | // The Client API can be used here. Learn more: gridsome.org/docs/client-api 3 | 4 | import Vuetify from 'vuetify' 5 | import 'vuetify/dist/vuetify.min.css' 6 | import DefaultLayout from '~/layouts/Default.vue' 7 | 8 | export default function (Vue, { appOptions, head }) { 9 | head.link.push({ 10 | rel: 'stylesheet', 11 | href: 'https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css', 12 | }) 13 | 14 | head.link.push({ 15 | rel: 'stylesheet', 16 | href: 'https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900', 17 | }); 18 | 19 | const opts = {} 20 | Vue.use(Vuetify) 21 | 22 | appOptions.vuetify = new Vuetify(opts); 23 | 24 | // Set default layout as a global component 25 | Vue.component('Layout', DefaultLayout) 26 | } 27 | -------------------------------------------------------------------------------- /e-vents-front/src/pages/Index.vue: -------------------------------------------------------------------------------- 1 | 38 | 39 | 40 | query { 41 | events: allEvent { 42 | edges { 43 | node { 44 | id 45 | title 46 | description 47 | price 48 | duration 49 | date 50 | thumbnail 51 | image 52 | category 53 | } 54 | } 55 | } 56 | } 57 | 58 | 59 | 104 | 105 | 110 | -------------------------------------------------------------------------------- /e-vents-front/src/pages/README.md: -------------------------------------------------------------------------------- 1 | Pages are usually used for normal pages or for listing items from a GraphQL collection. 2 | Add .vue files here to create pages. For example **About.vue** will be **site.com/about**. 3 | Learn more about pages: https://gridsome.org/docs/pages/ 4 | 5 | You can delete this file. 6 | -------------------------------------------------------------------------------- /e-vents-front/src/templates/Event.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | query ($id: ID!) { 11 | event(id: $id) { 12 | id 13 | title 14 | description 15 | duration 16 | price 17 | date 18 | image 19 | } 20 | } 21 | 22 | 23 | 32 | -------------------------------------------------------------------------------- /e-vents-front/src/templates/README.md: -------------------------------------------------------------------------------- 1 | Templates for **GraphQL collections** should be added here. 2 | To create a template for a collection called `WordPressPost` 3 | create a file named `WordPressPost.vue` in this folder. 4 | 5 | Learn more: https://gridsome.org/docs/templates/ 6 | 7 | You can delete this file. 8 | -------------------------------------------------------------------------------- /e-vents-front/static/README.md: -------------------------------------------------------------------------------- 1 | Add static files here. Files in this directory will be copied directly to `dist` folder during build. For example, /static/robots.txt will be located at https://yoursite.com/robots.txt. 2 | 3 | This file should be deleted. --------------------------------------------------------------------------------