-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project init with nuxt and vuetifyjs #24
Merged
Merged
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5ebd24d
Scaffold the vue app
rickmak 75c4051
Add docker-compose setup
rickmak 253cc9d
Add postgresql to docker compose
rickmak 23a69d6
Add and install ipfs related lib/dockerfile
rickmak 8d8188e
Include example call for ipfs-api inside nuxt.js
rickmak 731bfdd
Add prettierrc and editorconfig that algin with existing lint rule
rickmak c183945
Update Dockerfile & docker-compose
inDream 3882ff4
Add pg & sequelize modules
inDream 7e4edb7
Add database migration
inDream c243a16
Add user api & model
inDream 5a1ab9c
Add sequelize db
rickmak f519426
Use buildtime directory for node_module
rickmak aec2568
Move to docker-compose and npm base command for db migration
rickmak 3081381
Add Vuetify
inDream 0d6ee56
Replace scaffolding image with puttyimages image
rickmak fb6065c
Ping vue-template-compiler and vue-server-renderer version too
rickmak 998ece0
Remove placeholder image from all vue files
rickmak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.git | ||
node_modules | ||
dist | ||
packages/*/node_modules | ||
packages/*/dist | ||
packages/*/*.tgz | ||
Dockerfile* | ||
**/*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
root: true, | ||
parser: 'babel-eslint', | ||
env: { | ||
browser: true, | ||
node: true, | ||
}, | ||
extends: 'airbnb-base', | ||
// required to lint *.vue files | ||
plugins: [ | ||
'html', | ||
], | ||
// add your custom rules here | ||
rules: { | ||
// don't require .vue extension when importing | ||
'import/extensions': ['error', 'always', { | ||
js: 'never', | ||
vue: 'never' | ||
}], | ||
}, | ||
globals: {}, | ||
settings: { | ||
'import/resolver': { | ||
webpack: 'webpack.config.js', | ||
}, | ||
}, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# dependencies | ||
node_modules | ||
|
||
# logs | ||
npm-debug.log | ||
|
||
# Nuxt build | ||
.nuxt | ||
|
||
# Nuxt generate | ||
dist | ||
|
||
# Backpack build | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"singleQuote": true, | ||
"bracketSpacing": true, | ||
"arrowParens": "always", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
'config': path.resolve('config', 'database.js'), | ||
'models-path': path.resolve('server', 'models'), | ||
'seeders-path': path.resolve('server', 'seeders'), | ||
'migrations-path': 'migrations' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:10 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package.json package-lock.json /usr/src/app/ | ||
|
||
RUN npm install | ||
|
||
COPY . /usr/src/app | ||
|
||
CMD ["npm", "run", "dev"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:10 | ||
|
||
COPY . /usr/src/app | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# TODO: make it multi-build and only run npm install production | ||
RUN npm install | ||
RUN npm run build | ||
|
||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# puttyimages | ||
|
||
Puttyimegs is an open stock image DApp that live within the | ||
[LikeCoin](https://like.co/) ecosystem. | ||
|
||
## Development Setup | ||
|
||
The suggested way of development environment is docker based. This guide will | ||
assume you have Docker Community Edition 18+ installed. Please download at | ||
[https://store.docker.com](https://store.docker.com) and follow the | ||
installation instruction. | ||
|
||
After you setup docker, fun the following command to setup the docker image | ||
and basic DB schema. Also kick start the docker container for development. | ||
|
||
``` bash | ||
# Build the docker images, run it for the first time or you have dependency | ||
# updates | ||
$ docker-compose build | ||
|
||
# Run the DB migration and reseed the DB for the first time run or after you | ||
# pull an update. | ||
$ docker-compose run nuxt npm run sequelize db:migrate | ||
$ docker-compose run nuxt npm run sequelize db:seed:all | ||
|
||
# Kick of the development setup | ||
$ docker-compose up | ||
``` | ||
|
||
Local files are mount into docker you can modify file in your fs and will | ||
hot reload. | ||
|
||
## Production | ||
|
||
``` bash | ||
$ docker-compose -f docker-compose.production.yml build | ||
$ docker-compose -f docker-compose.production.yml up | ||
``` | ||
|
||
For detailed explanation on how things work, checkout the [Nuxt.js | ||
docs](https://github.com/nuxt/nuxt.js). | ||
|
||
## Backpack | ||
|
||
We use [backpack](https://github.com/palmerhq/backpack) to watch and build the | ||
application, so you can use the latest ES6 features (module syntax, | ||
async/await, etc.). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@import 'node_modules/vuetify/dist/vuetify.min.css'; | ||
|
||
html, body | ||
{ | ||
background-color: #fff; | ||
color: #000; | ||
letter-spacing: 0.5px; | ||
font-family: "Source Sans Pro", Arial, sans-serif; | ||
height: 100vh; | ||
margin: 0; | ||
} | ||
|
||
footer | ||
{ | ||
padding: 20px; | ||
text-align: center; | ||
border-top: 1px solid #ddd; | ||
} | ||
|
||
a, a:hover, a:focus, a:visited | ||
{ | ||
color: #000; | ||
} | ||
|
||
.logo { | ||
width: 100%; | ||
height: auto; | ||
max-width: 400px; | ||
max-height: 289px; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
webpack: (config, options, webpack) => { // eslint-disable-line no-unused-vars | ||
config.entry.main = './server/index.js'; // eslint-disable-line no-param-reassign | ||
return config; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<template> | ||
<footer> | ||
Visit our website for more documentation : <a href="https://nuxtjs.org" target="_blank">nuxtjs.org</a> | ||
</footer> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
development: { | ||
username: process.env.DB_USERNAME || 'postgres', | ||
database: process.env.DB_NAME || 'postgres', | ||
host: process.env.DB_HOSTNAME || 'db', | ||
dialect: 'postgres', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: '2' | ||
|
||
services: | ||
nuxt: | ||
extends: | ||
file: docker-compose.yml | ||
service: nuxt | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.production | ||
volumes: | ||
- /usr/src/app | ||
db: | ||
extends: | ||
file: docker-compose.yml | ||
service: db | ||
|
||
ipfs: | ||
extends: | ||
file: docker-compose.yml | ||
service: ipfs | ||
|
||
volumes: | ||
db_data: | ||
driver: local | ||
ipfs_data: | ||
driver: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
version: '3' | ||
|
||
services: | ||
nuxt: | ||
build: | ||
context: . | ||
depends_on: | ||
- db | ||
- ipfs | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- ./:/usr/src/app | ||
- /usr/src/app/node_modules | ||
environment: | ||
HOST: 0.0.0.0 | ||
IPFS_HOST: ipfs | ||
|
||
db: | ||
image: postgres:10.4 | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- db_data:/var/lib/postgresql/data | ||
|
||
ipfs: | ||
image: ipfs/go-ipfs:v0.4.15 | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- ipfs_data:/data/ipfs | ||
|
||
volumes: | ||
db_data: | ||
driver: local | ||
ipfs_data: | ||
driver: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<template> | ||
<v-app> | ||
<v-toolbar> | ||
<v-toolbar-title>PuttyImage</v-toolbar-title> | ||
<v-spacer></v-spacer> | ||
<v-toolbar-items class="hidden-sm-and-down"> | ||
<v-btn flat>Login</v-btn> | ||
</v-toolbar-items> | ||
</v-toolbar> | ||
<v-content> | ||
<v-container fluid> | ||
<nuxt/> | ||
<my-footer/> | ||
</v-container> | ||
</v-content> | ||
</v-app> | ||
</template> | ||
|
||
<script> | ||
import MyFooter from '~/components/Footer'; | ||
|
||
export default { | ||
components: { | ||
MyFooter, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
.container | ||
{ | ||
margin: 0; | ||
width: 100%; | ||
padding: 0; | ||
text-align: center; | ||
} | ||
|
||
.content { | ||
padding-top: 56px !important; | ||
} | ||
|
||
.button, .button:visited | ||
{ | ||
display: inline-block; | ||
color: black; | ||
letter-spacing: 1px; | ||
background-color: #fff; | ||
border: 2px solid #000; | ||
text-decoration: none; | ||
text-transform: uppercase; | ||
padding: 15px 45px; | ||
} | ||
|
||
.button:hover, .button:focus | ||
{ | ||
color: #fff; | ||
background-color: #000; | ||
} | ||
|
||
.title | ||
{ | ||
color: #000; | ||
font-weight: 300; | ||
font-size: 2.5em; | ||
margin: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<section class="container"> | ||
<img src="../assets/img/logo.png" alt="Nuxt.js Logo" class="logo" /> | ||
<h1 class="title"> | ||
{{ error.statusCode }} | ||
</h1> | ||
<h2 class="info"> | ||
{{ error.message }} | ||
</h2> | ||
<nuxt-link class="button" to="/" v-if="error.statusCode === 404"> | ||
Homepage | ||
</nuxt-link> | ||
</section> | ||
</template> | ||
<script> | ||
export default { | ||
props: ['error'], | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.title | ||
{ | ||
margin-top: 15px; | ||
font-size: 5em; | ||
} | ||
.info | ||
{ | ||
font-weight: 300; | ||
color: #9aabb1; | ||
margin: 0; | ||
} | ||
.button | ||
{ | ||
margin-top: 50px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
up: (queryInterface, Sequelize) => | ||
queryInterface.createTable('user', { | ||
id: { | ||
allowNull: false, | ||
autoIncrement: true, | ||
primaryKey: true, | ||
type: Sequelize.INTEGER, | ||
}, | ||
name: { | ||
allowNull: false, | ||
type: Sequelize.TEXT, | ||
}, | ||
}), | ||
down: queryInterface => queryInterface.dropTable('user'), | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
../assets/img/logo.png
is missingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not missing on my setting. The file is checking here: https://github.com/rickmak/puttyimages-web/blob/0d6ee56c849ddbe65795099d5abbea773f8359b0/assets/img/logo.png
Just to confirm the path resolve setting is right. I will remove the dummy img.