Skip to content

Commit 3aeb4f3

Browse files
committed
First commit, pre-rendered dynamic pages from static content, pending lambdas
0 parents  commit 3aeb4f3

39 files changed

+1115
-0
lines changed

.babelrc

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"env": {
3+
"test": {
4+
"presets": [
5+
[
6+
"@babel/preset-env",
7+
{
8+
"targets": {
9+
"node": "current"
10+
}
11+
}
12+
]
13+
]
14+
}
15+
}
16+
}

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false

.eslintrc.js

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true
6+
},
7+
parserOptions: {
8+
parser: 'babel-eslint'
9+
},
10+
extends: [
11+
'@nuxtjs',
12+
'plugin:nuxt/recommended',
13+
'plugin:prettier/recommended',
14+
'prettier',
15+
'prettier/vue'
16+
],
17+
plugins: [
18+
'prettier'
19+
],
20+
// add your custom rules here
21+
rules: {
22+
}
23+
}

.gitignore

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Node template
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
10+
# Runtime data
11+
pids
12+
*.pid
13+
*.seed
14+
*.pid.lock
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# nyc test coverage
23+
.nyc_output
24+
25+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26+
.grunt
27+
28+
# Bower dependency directory (https://bower.io/)
29+
bower_components
30+
31+
# node-waf configuration
32+
.lock-wscript
33+
34+
# Compiled binary addons (https://nodejs.org/api/addons.html)
35+
build/Release
36+
37+
# Dependency directories
38+
node_modules/
39+
jspm_packages/
40+
41+
# TypeScript v1 declaration files
42+
typings/
43+
44+
# Optional npm cache directory
45+
.npm
46+
47+
# Optional eslint cache
48+
.eslintcache
49+
50+
# Optional REPL history
51+
.node_repl_history
52+
53+
# Output of 'npm pack'
54+
*.tgz
55+
56+
# Yarn Integrity file
57+
.yarn-integrity
58+
59+
# dotenv environment variables file
60+
.env
61+
62+
# parcel-bundler cache (https://parceljs.org/)
63+
.cache
64+
65+
# next.js build output
66+
.next
67+
68+
# nuxt.js build output
69+
.nuxt
70+
71+
# Nuxt generate
72+
dist
73+
74+
# vuepress build output
75+
.vuepress/dist
76+
77+
# Serverless directories
78+
.serverless
79+
80+
# IDE
81+
.idea
82+
83+
# Service worker
84+
sw.*

.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true
4+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Alexander Schwartzberg
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# nuxt-netlify-lambda-starter
2+
3+
This is a basic starter project for a prerendered [Vue](https://vuejs.org/) + [Nuxt](https://nuxtjs.org/) frontend with a [Netlify lambda function](https://www.netlify.com/docs/functions/) backend.
4+
5+
##### [You can view the deployed app here](https://nuxt-netlify-lambda-starter.netlify.com/)
6+
7+
The Vue app is prerendered for improved SEO - you can learn more about server-side rendering and prerendering with Vue [here](https://ssr.vuejs.org/#ssr-vs-prerendering).
8+
9+
**NOTE:** this project can only be deployed via Netlify with [continuous deployment](https://www.netlify.com/docs/continuous-deployment/) enabled.
10+
11+
## Build Setup
12+
13+
``` bash
14+
# install dependencies
15+
$ yarn install
16+
17+
# serve with hot reload at localhost:3000
18+
$ yarn run dev
19+
20+
# build for production and launch server
21+
$ yarn run build
22+
$ yarn start
23+
24+
# generate static project
25+
$ yarn run generate
26+
```
27+
28+
For detailed explanation on how things work, checkout [Nuxt.js docs](https://nuxtjs.org).
29+
30+
Includes Nuxt `README.md` files for context

assets/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# ASSETS
2+
3+
**This directory is not required, you can delete it if you don't want to use it.**
4+
5+
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
6+
7+
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).

assets/content/items.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[
2+
{
3+
"id": "node",
4+
"label": "Node.js",
5+
"icon": "https://jaystack.com/wp-content/uploads/2015/12/nodejs-logo-e1497443346889.png",
6+
"description": "Node.js is useful!"
7+
},
8+
{
9+
"id": "postman",
10+
"label": "Postman",
11+
"icon": "https://raw.githubusercontent.com/codotype/codotype-postman-collection-generator/master/postman.png",
12+
"description": "Postman is cool!"
13+
},
14+
{
15+
"id": "vue",
16+
"label": "Vue.js",
17+
"icon": "https://res.cloudinary.com/codotype/image/upload/v1551192656/tech-logos/vue.png",
18+
"description": "Vue.js is fun!"
19+
},
20+
{
21+
"id": "python",
22+
"label": "Python",
23+
"icon": "https://raw.githubusercontent.com/codotype/codotype-python-falcon-mongodb-generator/master/python.png",
24+
"description": "Python is simple, in a good way!"
25+
},
26+
{
27+
"id": "react",
28+
"label": "React",
29+
"icon": "https://res.cloudinary.com/codotype/image/upload/v1553197668/tech-logos/react.png",
30+
"description": "React is versatile!"
31+
}
32+
]

assets/sass/main.sass

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
// Bootstrap Variable Overrides (customize things here)
3+
@import './variables'
4+
5+
// Bootstrap Required Core
6+
@import 'node_modules/bootstrap/scss/functions'
7+
@import 'node_modules/bootstrap/scss/variables'
8+
@import 'node_modules/bootstrap/scss/mixins'
9+
10+
// Boostrap Optional Components
11+
// PROTIP - only include the Bootstrap modules you're actually using - this will keep your CSS bundle nice and slim :)
12+
@import 'node_modules/bootstrap/scss/reboot'
13+
@import 'node_modules/bootstrap/scss/type'
14+
@import 'node_modules/bootstrap/scss/images'
15+
@import 'node_modules/bootstrap/scss/code'
16+
@import 'node_modules/bootstrap/scss/grid'
17+
@import 'node_modules/bootstrap/scss/tables'
18+
@import 'node_modules/bootstrap/scss/forms'
19+
@import 'node_modules/bootstrap/scss/buttons'
20+
@import 'node_modules/bootstrap/scss/transitions'
21+
@import 'node_modules/bootstrap/scss/dropdown'
22+
@import 'node_modules/bootstrap/scss/button-group'
23+
@import 'node_modules/bootstrap/scss/input-group'
24+
@import 'node_modules/bootstrap/scss/custom-forms'
25+
@import 'node_modules/bootstrap/scss/nav'
26+
@import 'node_modules/bootstrap/scss/navbar'
27+
@import 'node_modules/bootstrap/scss/card'
28+
@import 'node_modules/bootstrap/scss/breadcrumb'
29+
@import 'node_modules/bootstrap/scss/pagination'
30+
@import 'node_modules/bootstrap/scss/badge'
31+
@import 'node_modules/bootstrap/scss/jumbotron'
32+
@import 'node_modules/bootstrap/scss/alert'
33+
@import 'node_modules/bootstrap/scss/progress'
34+
@import 'node_modules/bootstrap/scss/media'
35+
@import 'node_modules/bootstrap/scss/list-group'
36+
@import 'node_modules/bootstrap/scss/close'
37+
@import 'node_modules/bootstrap/scss/modal'
38+
@import 'node_modules/bootstrap/scss/tooltip'
39+
@import 'node_modules/bootstrap/scss/popover'
40+
@import 'node_modules/bootstrap/scss/carousel'
41+
@import 'node_modules/bootstrap/scss/utilities'
42+
@import 'node_modules/bootstrap/scss/print'

assets/sass/variables.sass

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// This is where you can customize Bootstrap to look just the way your like
2+
// It includes all variables by default copied and pasted from Bootstrap's example
3+
// Doc: https://getbootstrap.com/docs/4.0/getting-started/theming/
4+
5+
// // // //
6+
7+
$bg-color: #f5f6f9 !default // Example that makes your background color slightly off-white

components/Item.vue

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<template>
2+
<div class="card card-body mb-2">
3+
<div class="row">
4+
<div class="col-lg-12 d-flex justify-content-between align-items-center">
5+
<p
6+
class="lead mb-0 w-100 d-flex justify-content-between align-items-center"
7+
>
8+
<router-link :to="'/items/' + model.id">
9+
<img class="item-icon" :src="model.icon" />
10+
{{ model.label }}
11+
</router-link>
12+
</p>
13+
</div>
14+
15+
<div class="col-lg-12">
16+
<p class="card-text mb-2">
17+
{{ model.description }}
18+
</p>
19+
</div>
20+
</div>
21+
</div>
22+
</template>
23+
24+
<script>
25+
export default {
26+
name: 'Item',
27+
props: {
28+
model: {
29+
type: Object,
30+
required: true
31+
}
32+
}
33+
}
34+
</script>
35+
36+
<style lang="sass">
37+
img.item-icon
38+
width: 2rem
39+
</style>

components/Navbar.vue

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<template>
2+
<b-navbar toggleable="md" type="light" variant="light">
3+
<b-navbar-brand to="/">
4+
<strong>Nuxt Netlify Lambda Starter</strong>
5+
</b-navbar-brand>
6+
7+
<b-navbar-toggle target="nav_collapse"></b-navbar-toggle>
8+
<b-collapse id="nav_collapse" is-nav>
9+
<b-navbar-nav class="mr-auto">
10+
<b-nav-item to="/items">
11+
Items
12+
</b-nav-item>
13+
</b-navbar-nav>
14+
15+
<b-navbar-nav class="ml-auto">
16+
<b-nav-item to="/about">
17+
<font-awesome-icon icon="question-circle" />
18+
About
19+
</b-nav-item>
20+
21+
<b-nav-item target="_blank" href="https://twitter.com/aeksco">
22+
<font-awesome-icon :icon="['fab', 'twitter']" class="text-primary" />
23+
Twitter
24+
</b-nav-item>
25+
26+
<b-nav-item
27+
target="_blank"
28+
href="https://github.com/aeksco/nuxt-netlify-lambda-starter"
29+
>
30+
<font-awesome-icon :icon="['fab', 'github']" />
31+
GitHub
32+
</b-nav-item>
33+
</b-navbar-nav>
34+
</b-collapse>
35+
</b-navbar>
36+
</template>
37+
38+
<script>
39+
export default {
40+
name: 'Navbar'
41+
}
42+
</script>
43+
44+
<style>
45+
nav.navbar {
46+
border-bottom: 1px solid #d3d3d3;
47+
}
48+
</style>

components/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# COMPONENTS
2+
3+
**This directory is not required, you can delete it if you don't want to use it.**
4+
5+
The components directory contains your Vue.js Components.
6+
7+
_Nuxt.js doesn't supercharge these components._

0 commit comments

Comments
 (0)