Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MogageNicolae authored Aug 21, 2024
0 parents commit f73b53e
Show file tree
Hide file tree
Showing 112 changed files with 26,549 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env.devnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NETWORK=devnet
API_URL=https://devnet-api.multiversx.com
2 changes: 2 additions & 0 deletions .env.mainnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NETWORK=mainnet
API_URL=https://api.multiversx.com
2 changes: 2 additions & 0 deletions .env.testnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NETWORK=testnet
API_URL=https://testnet-api.multiversx.com
149 changes: 149 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
// 'plugin:prettier/recommended',
'plugin:boundaries/strict',
],
root: true,
env: {
node: true,
jest: true,
},
settings: {
"import/resolver": {
typescript: {
alwaysTryTypes: true,
project: 'tsconfig.json'
},
},
'boundaries/elements': [
{
type: 'apps/api',
pattern: 'apps/api',
},
{
type: 'apps/cache-warmer',
pattern: 'apps/cache-warmer',
},
{
type: 'apps/queue-worker',
pattern: 'apps/queue-worker',
},
{
type: 'apps/transactions-processor',
pattern: 'apps/transactions-processor',
},
{
type: 'libs/common',
pattern: 'libs/common'
},
{
type: 'libs/database',
pattern: 'libs/database'
},
{
type: 'libs/entities',
pattern: 'libs/entities'
},
{
type: 'libs/services',
pattern: 'libs/services'
},
]
},
rules: {
"@typescript-eslint/no-explicit-any": ["off"],
"@typescript-eslint/no-unused-vars": ["off"],
"@typescript-eslint/ban-ts-comment": ["off"],
"@typescript-eslint/no-empty-function": ["off"],
"@typescript-eslint/ban-types": ["off"],
"@typescript-eslint/no-var-requires": ["off"],
"@typescript-eslint/no-inferrable-types": ["off"],
"require-await": ["error"],
"@typescript-eslint/no-floating-promises": ["error"],
"max-len": ["off"],
"semi": ["error"],
"comma-dangle": ["error", "always-multiline"],
"eol-last": ["error"],
'no-restricted-imports': ['error', {
patterns: ['libs/*', 'apps/*', '**/apps', '**/libs'],
}],
"boundaries/element-types": ["error", {
default: 'disallow',
rules: [
{
from: 'apps/api',
allow: ['libs/common', 'libs/entities', 'libs/services']
},
{
from: 'apps/cache-warmer',
allow: ['libs/common', 'libs/entities', 'libs/services']
},
{
from: 'apps/queue-worker',
allow: ['libs/common', 'libs/entities', 'libs/services']
},
{
from: 'apps/transactions-processor',
allow: ['libs/common', 'libs/entities', 'libs/services']
},
{
from: 'libs/database',
allow: ['libs/common', 'libs/entities']
},
{
from: 'libs/services',
allow: ['libs/common', 'libs/entities', 'libs/database']
},
{
from: 'libs/common',
allow: ['libs/entities']
}
]
}],
'boundaries/no-unknown': [2],
'boundaries/no-unknown-files': [2],
'boundaries/no-private': [0]
},
ignorePatterns: ['.eslintrc.js'],
"overrides": [
{
"files": ["libs/common/**/*.ts"],
"rules": {
"no-restricted-imports": ["error", {
"patterns": ["@libs/common*"]
}]
}
},
{
"files": ["libs/database/**/*.ts"],
"rules": {
"no-restricted-imports": ["error", {
"patterns": ["@libs/database*"]
}]
}
},
{
"files": ["libs/entities/**/*.ts"],
"rules": {
"no-restricted-imports": ["error", {
"patterns": ["@libs/entities*"]
}]
}
},
{
"files": ["libs/services/**/*.ts"],
"rules": {
"no-restricted-imports": ["error", {
"patterns": ["@libs/services*"]
}]
}
}
]
};
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Type

- [ ] Bug
- [ ] Feature
- [ ] Refactoring
- [ ] Performance improvement

## Problem setting

-
-
-

## Proposed Changes

-
-
-

## How to test

-
-
-
29 changes: 29 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: ESLint

on:
push:
branches: [main, development]
pull_request:
branches: [main, development]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run lint
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# compiled output
/dist
/node_modules
build.yaml

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Configs
**/*/config/config.yaml
**/*/config/config.custom.yaml

**/*/config/schema.json
**/*/config/config.yaml
**/*/config/schema.yaml

!.multiversx/config/config.yaml

# Environment
.env
.env.custom
3 changes: 3 additions & 0 deletions .multiversx/config/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NODE_ENV=infra
NETWORK=
API_URL=
34 changes: 34 additions & 0 deletions .multiversx/config/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apps:
api:
port: 3000
privatePort: 4000
useCachingInterceptor: true
cacheWarmer:
port: 4001
queueWorker:
port: 4002
transactionsProcessor:
port: 4003
maxLookBehind: 100
libs:
common:
network: ${NETWORK}
urls:
api: ${API_URL}
database:
host: 'localhost'
port: 27017
# username: 'root'
# password: 'root'
name: 'example'
tlsAllowInvalidCertificates: true
redis:
host: '127.0.0.1'
port: 6379
nativeAuth:
# maxExpirySeconds:
acceptedOrigins:
- utils.multiversx.com
security:
admins: []
# rateLimiterSecret:
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach NestJS WS",
"port": 9229,
"restart": true,
"stopOnEntry": false,
"protocol": "inspector"
}
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.validate": ["javascript"],
"editor.formatOnSave": true
}
Loading

0 comments on commit f73b53e

Please sign in to comment.