create-meh-app v1.15.4
Create MEH App
Quickly scaffold a new Node.js project by creating a GitLab repository, setting up linting/formatting, automatic Kubernetes deployment, local dotenv ⇄ Kubernetes secrets syncing, and more.
Usage
yarn create meh-app <app-name>Examples:
yarn create meh-app my-app
yarn create meh-app relative-folder/my-app
yarn create meh-app /root-folder/my-appFeatures
- Creates and clones a GitLab project and repository
- Initial scaffold commit on
masteranddevelop - Automatic Kubernetes deployment through GitLab
- Two-way dotenv/secrets sync through
yarn upload-envandyarn download-env - Lints & formats
.js(x),.ts(x), and.vuefiles on commit - Formats
.graphql,.html,.json,.md,.(s)css, and.ymlfiles on commit - Optional Airflow DAG(s) (automatic deployment through GitLab)
- Optional Redis and/or MongoDB database
- Optional Uptime Robot monitoring
Prerequisites
- Node.js >=16 (LTS)
- Yarn
- Kubectl v1.14.9
- GitLab personal access token ("api"-scoped)
Recommended: Add
export GITLAB_PERSONAL_ACCESS_TOKEN=<token>to your~/.bash_profile(and/or~/.zshrc) so you can useyarn download-envandyarn upload-envwithout configuration.
Functionality
yarn upload-env
Converts any local .env.<test|acc|prod> files to secrets, and applies them remotely through kubectl. Add the --restart or -r flag to restart any web pods afterwards (to pick up your new secrets).
Requires a
GITLAB_PERSONAL_ACCESS_TOKENas environment variable.
yarn download-env
Converts any remote project secrets to local dotenv files, and stores them as .env.<test|acc|prod>. Add the --force or -f flag to overwrite any pre-existing .env.<test|acc|prod> files.
Requires a
GITLAB_PERSONAL_ACCESS_TOKENas environment variable.
pre-commit git hook
- Lints (and formats), and attempts to autofix your staged (
.js(x),.ts(x), and.vue) files through ESLint (extending Airbnb and Prettier) - Formats and attempts to autoformat your staged (
.graphql,.html,.json,.md,.(s)css, and.yml) files through Prettier
pre-push git hook
- Runs
yarn test
Airflow DAGs
If you opted in for Airflow DAG(s) during setup, the following will be added to your project:
/airflow/<dagName>.py(containing the interval and description you entered)"start:<dagName>"script inpackage.json(the Airflow pod will runyarn start:<dagName>)- Automatic deployment of any
/airflow/*.pyfiles, when pushing to themasterbranch
Recommended Visual Studio Code settings
Extensions
settings.json
To open these settings, press: ⌘-Shift-P → "Preferences: Open Settings (JSON)"
{
"editor.codeActionsOnSave": { "source.fixAll": true },
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.tabSize": 2,
"eslint.options": { "ignorePath": ".gitignore" },
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"prettier.disableLanguages": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
"prettier.ignorePath": ".gitignore"
}Note: We use
prettier.disableLanguagesto disable Prettier from handling JS(X) and TS(X) files, because ESLint already formats these (using Prettier under the hood).
Roadmap
- Dotenv ⇄ secrets sync without a cluster key
- DAG OTAP
3 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago