Skip to content

Commit 4e59489

Browse files
committed
Initial commit
0 parents  commit 4e59489

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+17824
-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

.env.example

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
APP_NAME='Daks.ts'
2+
APP_DESCRIPTION='By kabaluyot'
3+
APP_HOST=localhost
4+
APP_PORT=3000
5+
APP_URL=http://localhost:3000
6+
7+
API_URL=https://jsonplaceholder.typicode.com

.eslintrc.js

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true
6+
},
7+
extends: [
8+
'@nuxtjs/eslint-config-typescript',
9+
'prettier',
10+
'prettier/vue',
11+
'plugin:prettier/recommended',
12+
'plugin:nuxt/recommended'
13+
],
14+
plugins: ['prettier'],
15+
// add your custom rules here
16+
rules: {
17+
'prettier/prettier': 'error',
18+
semi: 0,
19+
'space-before-function-paren': ['error', 'never'],
20+
'no-unused-vars': 'off', // disable default
21+
'@typescript-eslint/no-unused-vars': [
22+
'error',
23+
{
24+
vars: 'all',
25+
args: 'after-used',
26+
ignoreRestSiblings: false
27+
}
28+
],
29+
'@typescript-eslint/member-delimiter-style': 0,
30+
'@typescript-eslint/ban-ts-ignore': 'error',
31+
'@typescript-eslint/explicit-function-return-type': 'off', // disable default
32+
'@typescript-eslint/no-explicit-any': 'error',
33+
camelcase: 'off',
34+
'@typescript-eslint/camelcase': ['warn']
35+
},
36+
overrides: [
37+
{
38+
// enable the rule specifically for TypeScript files
39+
files: ['*.ts', '*.tsx', '*.vue'],
40+
rules: {
41+
'@typescript-eslint/explicit-function-return-type': ['error']
42+
}
43+
},
44+
{
45+
// allow explicit any in these files and missing return type
46+
files: [
47+
'state.ts',
48+
'getters.ts',
49+
'repository.ts',
50+
'*.repository.ts',
51+
'test/**/*'
52+
],
53+
rules: {
54+
'@typescript-eslint/no-explicit-any': 'off',
55+
'@typescript-eslint/explicit-function-return-type': ['off']
56+
}
57+
}
58+
]
59+
}

.gitignore

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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 / Editor
81+
.idea
82+
83+
# Service worker
84+
sw.*
85+
86+
# macOS
87+
.DS_Store
88+
89+
# Vim swap files
90+
*.swp

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": false,
3+
"arrowParens": "always",
4+
"singleQuote": true,
5+
"endOfLine": "auto"
6+
}

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# daks.ts
2+
3+
> A minimalistic Nuxt starter template using TypeScript, Vuetify, and Repository Pattern. Daks!
4+
5+
## Build Setup
6+
7+
```bash
8+
# install dependencies
9+
$ npm install
10+
11+
# run lints
12+
$ npm run lint
13+
$ npm run lint:fix
14+
15+
# serve with hot reload at localhost:3000
16+
$ npm run dev
17+
18+
# build for production and launch server
19+
$ npm run build
20+
$ npm run start
21+
22+
# generate static project
23+
$ npm run generate
24+
```
25+
26+
For detailed explanation on how things work, check out [TypeScript Nuxt.js docs](https://typescript.nuxtjs.org/).

api/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Repository from './repository'
2+
3+
export { Repository }

api/repository.ts

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { AxiosInstance } from 'axios'
2+
3+
/**
4+
* Default implementation of the axios repository.
5+
* You may access this and use the basic axios without invoking $axios in your files.
6+
*
7+
* When using solely this, you don't access to intellisense feature because you need to
8+
* define the interfaces and bind to your responses. See the social.repository.ts example
9+
* for reference.
10+
*
11+
* @return
12+
*/
13+
export default ($axios: AxiosInstance) => (resource: string): any => ({
14+
index(): any {
15+
return $axios.get(`${resource}`)
16+
},
17+
18+
show(id: string): any {
19+
return $axios.get(`${resource}/${id}`)
20+
},
21+
22+
create(payload: any): any {
23+
return $axios.post(`${resource}`, payload)
24+
},
25+
26+
update(id: string, payload: any): any {
27+
return $axios.post(`${resource}/${id}`, payload)
28+
},
29+
30+
delete(id: string): any {
31+
return $axios.delete(`${resource}/${id}`)
32+
}
33+
})

api/social/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { CommentInterface } from './social.types'
2+
import SocialRepository from './social.repository'
3+
4+
export { CommentInterface, SocialRepository }

api/social/social.repository.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { AxiosInstance, AxiosResponse, AxiosError } from 'axios'
2+
import { CommentInterface } from './social.types'
3+
4+
const API_URL: string = '/comments'
5+
6+
export default ($axios: AxiosInstance) => ({
7+
/**
8+
* Get all comments
9+
*
10+
* @return {Promise}
11+
*/
12+
GetComments(): Promise<CommentInterface[]> {
13+
return $axios
14+
.get(`${API_URL}`)
15+
.then((response: AxiosResponse<CommentInterface[]>) => {
16+
const { data } = response
17+
18+
const comments: CommentInterface[] = data
19+
20+
return comments
21+
})
22+
.catch((error: AxiosError) => {
23+
throw error
24+
})
25+
}
26+
})

api/social/social.types.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export interface CommentInterface {
2+
readonly postId: number
3+
readonly id: number
4+
readonly email: string
5+
readonly body?: string
6+
}

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/variables.scss

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Ref: https://github.com/nuxt-community/vuetify-module#customvariables
2+
//
3+
// The variables you want to modify
4+
// $font-size-root: 20px;

0 commit comments

Comments
 (0)