@vulkano/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +8 -0
- package/.gitattributes +108 -0
- package/.nvmrc +1 -0
- package/LICENSE +9 -0
- package/README.md +121 -0
- package/bootstrap/responses.js +32 -0
- package/bootstrap/server.js +619 -0
- package/bootstrap/services.js +42 -0
- package/bun.lockb +0 -0
- package/controllers/ScaffoldController.js +108 -0
- package/controllers/controllers.js +149 -0
- package/database/models.js +90 -0
- package/database/mongodb.js +232 -0
- package/database/scaffold.js +118 -0
- package/init.js +254 -0
- package/libs/Crontab.js +19 -0
- package/libs/Encrypter.js +45 -0
- package/libs/Filter.js +55 -0
- package/libs/Jwt.js +220 -0
- package/libs/VSError.js +33 -0
- package/libs/filters/ltrim.js +24 -0
- package/libs/filters/number.js +14 -0
- package/libs/filters/objectId.js +14 -0
- package/libs/filters/prefix.js +22 -0
- package/libs/filters/rtrim.js +24 -0
- package/libs/filters/saveinteger.js +21 -0
- package/libs/filters/suffix.js +19 -0
- package/libs/filters/trim.js +15 -0
- package/libs/i18n.js +51 -0
- package/package.json +67 -0
- package/responses/vsr.js +87 -0
package/.eslintignore
ADDED
package/.gitattributes
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# From https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes
|
|
2
|
+
|
|
3
|
+
# Handle line endings automatically for files detected as text
|
|
4
|
+
# and leave all files detected as binary untouched.
|
|
5
|
+
* text=auto
|
|
6
|
+
|
|
7
|
+
#
|
|
8
|
+
# The above will handle all files NOT found below
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
#
|
|
12
|
+
## These files are text and should be normalized (Convert crlf => lf)
|
|
13
|
+
#
|
|
14
|
+
|
|
15
|
+
# source code
|
|
16
|
+
*.php text
|
|
17
|
+
*.css text
|
|
18
|
+
*.sass text
|
|
19
|
+
*.scss text
|
|
20
|
+
*.less text
|
|
21
|
+
*.styl text
|
|
22
|
+
*.js text eol=lf
|
|
23
|
+
*.jsx text eol=lf
|
|
24
|
+
*.coffee text
|
|
25
|
+
*.json text
|
|
26
|
+
*.htm text
|
|
27
|
+
*.html text
|
|
28
|
+
*.xml text
|
|
29
|
+
*.svg text
|
|
30
|
+
*.txt text
|
|
31
|
+
*.ini text
|
|
32
|
+
*.inc text
|
|
33
|
+
*.pl text
|
|
34
|
+
*.rb text
|
|
35
|
+
*.py text
|
|
36
|
+
*.scm text
|
|
37
|
+
*.sql text
|
|
38
|
+
*.sh text
|
|
39
|
+
*.bat text
|
|
40
|
+
|
|
41
|
+
# templates
|
|
42
|
+
*.ejs text
|
|
43
|
+
*.hbt text
|
|
44
|
+
*.jade text
|
|
45
|
+
*.haml text
|
|
46
|
+
*.hbs text
|
|
47
|
+
*.dot text
|
|
48
|
+
*.tmpl text
|
|
49
|
+
*.phtml text
|
|
50
|
+
|
|
51
|
+
# server config
|
|
52
|
+
.htaccess text
|
|
53
|
+
|
|
54
|
+
# git config
|
|
55
|
+
.gitattributes text
|
|
56
|
+
.gitignore text
|
|
57
|
+
.gitconfig text
|
|
58
|
+
|
|
59
|
+
# code analysis config
|
|
60
|
+
.jshintrc text
|
|
61
|
+
.jscsrc text
|
|
62
|
+
.jshintignore text
|
|
63
|
+
.csslintrc text
|
|
64
|
+
.eslintrc text
|
|
65
|
+
|
|
66
|
+
# misc config
|
|
67
|
+
*.yaml text
|
|
68
|
+
*.yml text
|
|
69
|
+
.editorconfig text
|
|
70
|
+
|
|
71
|
+
# build config
|
|
72
|
+
*.npmignore text
|
|
73
|
+
*.bowerrc text
|
|
74
|
+
|
|
75
|
+
# Heroku
|
|
76
|
+
Procfile text
|
|
77
|
+
.slugignore text
|
|
78
|
+
|
|
79
|
+
# Documentation
|
|
80
|
+
*.md text
|
|
81
|
+
LICENSE text
|
|
82
|
+
AUTHORS text
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
#
|
|
86
|
+
## These files are binary and should be left untouched
|
|
87
|
+
#
|
|
88
|
+
|
|
89
|
+
# (binary is a macro for -text -diff)
|
|
90
|
+
*.png binary
|
|
91
|
+
*.jpg binary
|
|
92
|
+
*.jpeg binary
|
|
93
|
+
*.gif binary
|
|
94
|
+
*.ico binary
|
|
95
|
+
*.mov binary
|
|
96
|
+
*.mp4 binary
|
|
97
|
+
*.mp3 binary
|
|
98
|
+
*.flv binary
|
|
99
|
+
*.fla binary
|
|
100
|
+
*.swf binary
|
|
101
|
+
*.gz binary
|
|
102
|
+
*.zip binary
|
|
103
|
+
*.7z binary
|
|
104
|
+
*.ttf binary
|
|
105
|
+
*.eot binary
|
|
106
|
+
*.woff binary
|
|
107
|
+
*.pyc binary
|
|
108
|
+
*.pdf binary
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v18
|
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 VulkanoJS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://avatars.githubusercontent.com/u/42077334?s=200&v=4" alt="Nodemon Logo">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# Vulkano
|
|
6
|
+
|
|
7
|
+
Vulkano is a small, simple, and fast framework for creating web applications using NodeJS. Inspired by KumbiaPHP.
|
|
8
|
+
|
|
9
|
+
[](#backers)
|
|
10
|
+
[](#sponsors)
|
|
11
|
+
|
|
12
|
+
## Backers
|
|
13
|
+
|
|
14
|
+
Thank you to all [our backers](https://opencollective.com/vulkanojs#backer)! 🙏
|
|
15
|
+
|
|
16
|
+
[](https://opencollective.com/vulkanojs#backers)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Stack
|
|
20
|
+
|
|
21
|
+
### API
|
|
22
|
+
|
|
23
|
+
- Node.js
|
|
24
|
+
- [Express](http://expressjs.com)
|
|
25
|
+
- [Mongoose](http://mongoosejs.com/)
|
|
26
|
+
- [Nunjucks](http://mozilla.github.io/nunjucks/) (Template Engine)
|
|
27
|
+
- [Nodemon](http://nodemon.io/) (Reload automatically for dev mode)
|
|
28
|
+
- [PM2](http://pm2.keymetrics.io/) (Deployment)
|
|
29
|
+
- [Gulp](https://gulpjs.com/) (Automate and enhance your workflow)
|
|
30
|
+
- [BrowserSync](https://www.browsersync.io/) (Time-saving synchronised browser testing)
|
|
31
|
+
- [WebPack](https://webpack.js.org/) (Bundle your scripts)
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
### System
|
|
36
|
+
|
|
37
|
+
- Unix
|
|
38
|
+
- Node.js v12+
|
|
39
|
+
|
|
40
|
+
### Packages
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
$ yarn install
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Workflow
|
|
47
|
+
|
|
48
|
+
| Command | Description |
|
|
49
|
+
| :------------------------------ | :---------------------------------------- |
|
|
50
|
+
| `npm run dev` | Run development server and watch changes |
|
|
51
|
+
| `npm run start` | Start development server |
|
|
52
|
+
| `npm run gulp` | Start browsersync & sass |
|
|
53
|
+
| `npm run webpack` | Start webpack |
|
|
54
|
+
| `npm run build` | Task to buils assets in production mode |
|
|
55
|
+
| `npm run deploy:heroku` | Update Heroku app |
|
|
56
|
+
| `npm run deploy:server` | Deploy app into server |
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
## Structure
|
|
60
|
+
|
|
61
|
+
- `app/`
|
|
62
|
+
- `client/`
|
|
63
|
+
- `cms/`
|
|
64
|
+
- `core/`
|
|
65
|
+
- `public/` - HTTP Public folder
|
|
66
|
+
- `Procfile` - Heroku entry point
|
|
67
|
+
- `README.md`
|
|
68
|
+
- `app.js` - Server entry point
|
|
69
|
+
- `nodemon.json` - Nodemon entry point
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## Your App Folder
|
|
73
|
+
|
|
74
|
+
### Config
|
|
75
|
+
You can create any config enviroments as needed. By default, vulcano runs with NODE_ENV=development, in development mode. In productions servers, you should change NODE_ENV to _production_.
|
|
76
|
+
|
|
77
|
+
#### connections.js
|
|
78
|
+
|
|
79
|
+
#### policies.js
|
|
80
|
+
|
|
81
|
+
#### routes.js
|
|
82
|
+
|
|
83
|
+
#### server.js
|
|
84
|
+
|
|
85
|
+
### Controllers
|
|
86
|
+
|
|
87
|
+
### Helpers
|
|
88
|
+
|
|
89
|
+
#### Filters
|
|
90
|
+
|
|
91
|
+
### Models
|
|
92
|
+
|
|
93
|
+
### Responses
|
|
94
|
+
|
|
95
|
+
#### vsr.js
|
|
96
|
+
|
|
97
|
+
### Services
|
|
98
|
+
|
|
99
|
+
#### ActiveRecord.js
|
|
100
|
+
|
|
101
|
+
#### AppController.js
|
|
102
|
+
|
|
103
|
+
#### Filter.js
|
|
104
|
+
|
|
105
|
+
#### Jwt.js (Json Web Token)
|
|
106
|
+
|
|
107
|
+
#### Paginate.js
|
|
108
|
+
|
|
109
|
+
#### Upload.js
|
|
110
|
+
|
|
111
|
+
#### VSError.js
|
|
112
|
+
|
|
113
|
+
### Views.js
|
|
114
|
+
|
|
115
|
+
#### _shared
|
|
116
|
+
|
|
117
|
+
##### Errors
|
|
118
|
+
|
|
119
|
+
##### Partials
|
|
120
|
+
|
|
121
|
+
##### Templates
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
// Include all user's responses
|
|
4
|
+
const VulkanoResponses = require('include-all')({
|
|
5
|
+
dirname: path.join(CORE_PATH, '/responses'),
|
|
6
|
+
optional: true,
|
|
7
|
+
filter: /(.+)\.js$/
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const CustomResponses = require('include-all')({
|
|
11
|
+
dirname: path.join(APP_PATH, '/responses'),
|
|
12
|
+
optional: true,
|
|
13
|
+
filter: /(.+)\.js$/
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
module.exports = function loadResponsesApplication(req, res, next) {
|
|
17
|
+
|
|
18
|
+
// add custom user reponses
|
|
19
|
+
Object.keys(VulkanoResponses || {}).forEach((response) => {
|
|
20
|
+
const reponseName = response.split('.')[0];
|
|
21
|
+
res[reponseName] = VulkanoResponses[response];
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// add custom user reponses
|
|
25
|
+
Object.keys(CustomResponses || {}).forEach((response) => {
|
|
26
|
+
const reponseName = response.split('.')[0];
|
|
27
|
+
res[reponseName] = CustomResponses[response];
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
next();
|
|
31
|
+
|
|
32
|
+
};
|