cleanup vault packages
This commit is contained in:
@@ -27,6 +27,10 @@ services:
|
|||||||
- rush-character-net
|
- rush-character-net
|
||||||
ports:
|
ports:
|
||||||
- 8081:8080
|
- 8081:8080
|
||||||
|
environment:
|
||||||
|
MONGO_URI: mongodb://rushvault:rushvault@mongo:27017/
|
||||||
|
depends_on:
|
||||||
|
- mongo
|
||||||
develop:
|
develop:
|
||||||
watch:
|
watch:
|
||||||
- action: sync
|
- action: sync
|
||||||
@@ -45,11 +49,20 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
MONGO_INITDB_ROOT_USERNAME: rushvault
|
MONGO_INITDB_ROOT_USERNAME: rushvault
|
||||||
MONGO_INITDB_ROOT_PASSWORD: rushvault
|
MONGO_INITDB_ROOT_PASSWORD: rushvault
|
||||||
|
MONGO_INITDB_DATABASE: DB
|
||||||
|
networks:
|
||||||
|
- rush-character-net
|
||||||
|
ports:
|
||||||
|
- 27017:27017
|
||||||
mongo-express:
|
mongo-express:
|
||||||
image: mongo-express
|
image: mongo-express
|
||||||
restart: always
|
restart: always
|
||||||
|
networks:
|
||||||
|
- rush-character-net
|
||||||
ports:
|
ports:
|
||||||
- 8083:8081
|
- 8083:8081
|
||||||
|
depends_on:
|
||||||
|
- mongo
|
||||||
environment:
|
environment:
|
||||||
ME_CONFIG_MONGODB_ADMINUSERNAME: rushvault
|
ME_CONFIG_MONGODB_ADMINUSERNAME: rushvault
|
||||||
ME_CONFIG_MONGODB_ADMINPASSWORD: rushvault
|
ME_CONFIG_MONGODB_ADMINPASSWORD: rushvault
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
"env": {
|
|
||||||
"browser": true,
|
|
||||||
"es2021": true
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"eslint:recommended",
|
|
||||||
"plugin:@typescript-eslint/recommended"
|
|
||||||
],
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"env": {
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
".eslintrc.{js,cjs}"
|
|
||||||
],
|
|
||||||
"parserOptions": {
|
|
||||||
"sourceType": "script"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": "latest",
|
|
||||||
"sourceType": "module"
|
|
||||||
},
|
|
||||||
"plugins": [
|
|
||||||
"@typescript-eslint"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
3
vault/.prettierignore
Normal file
3
vault/.prettierignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Ignore artifacts:
|
||||||
|
build
|
||||||
|
coverage
|
||||||
11
vault/eslint.config.mjs
Normal file
11
vault/eslint.config.mjs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import js from "@eslint/js";
|
||||||
|
import globals from "globals";
|
||||||
|
import tseslint from "typescript-eslint";
|
||||||
|
import { defineConfig } from "eslint/config";
|
||||||
|
|
||||||
|
|
||||||
|
export default defineConfig([
|
||||||
|
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], plugins: { js }, extends: ["js/recommended"] },
|
||||||
|
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], languageOptions: { globals: globals.node } },
|
||||||
|
tseslint.configs.recommended,
|
||||||
|
]);
|
||||||
6476
vault/package-lock.json
generated
6476
vault/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,44 +1,33 @@
|
|||||||
{
|
{
|
||||||
"name": "vault",
|
"name": "vault",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "backend for rush cahracter archive",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"build": "tsc",
|
||||||
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
"start": "tsc && node dist/app.js",
|
||||||
"format": "prettier --write src/",
|
|
||||||
"dev": "npx ts-node-dev src/app.ts",
|
"dev": "npx ts-node-dev src/app.ts",
|
||||||
"build": "webpack && cp package.json ./dist/package.json"
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"format": "npx prettier . --write",
|
||||||
|
"lint": "npx eslint . --ext .ts"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"author": "iamBadgers",
|
||||||
"author": "",
|
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/express": "^4.17.21",
|
"@eslint/js": "^9.28.0",
|
||||||
"@types/sequelize": "^4.28.20",
|
"@types/express": "^5.0.3",
|
||||||
"@types/sqlite3": "^3.1.11",
|
"@types/node": "^22.15.30",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
"eslint": "^9.28.0",
|
||||||
"@typescript-eslint/parser": "^7.1.1",
|
"globals": "^16.2.0",
|
||||||
"crossenv": "^0.0.2-security",
|
"prettier": "3.5.3",
|
||||||
"eslint": "^8.57.0",
|
"ts-node": "^10.9.2",
|
||||||
"node-polyfill-webpack-plugin": "^4.0.0",
|
"typescript": "^5.8.3",
|
||||||
"prettier": "^3.2.5",
|
"typescript-eslint": "^8.33.1"
|
||||||
"ts-loader": "^9.5.1",
|
|
||||||
"typescript": "^5.4.5",
|
|
||||||
"webpack-cli": "^5.1.4"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/body-parser": "^1.19.5",
|
"@grpc/grpc-js": "^1.13.4",
|
||||||
"asty-astq": "^1.14.0",
|
"@protobuf-ts/protoc": "^2.11.0",
|
||||||
"body-parser": "^1.20.2",
|
"express": "^5.1.0",
|
||||||
"express": "^4.21.2",
|
"mongodb": "^6.17.0"
|
||||||
"memcached": "^2.2.2",
|
|
||||||
"net": "^1.0.2",
|
|
||||||
"pg": "^8.16.0",
|
|
||||||
"pg-hstore": "^2.3.4",
|
|
||||||
"sequelize": "^6.37.1",
|
|
||||||
"sqlite3": "^5.1.7",
|
|
||||||
"tokenizr": "^1.7.0",
|
|
||||||
"webpack-node-externals": "^3.0.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
16
vault/proto/character.proto
Normal file
16
vault/proto/character.proto
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
service CharacterManager {
|
||||||
|
rpc createCharacter(CreateCharacterRequest) returns (CreateCharacterResponse);
|
||||||
|
rpc getCharacter(GetCharacterRequest) returns (GetCharacterResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
message Character {}
|
||||||
|
|
||||||
|
message CreateCharacterRequest {}
|
||||||
|
|
||||||
|
message CreateCharacterResponse {}
|
||||||
|
|
||||||
|
message GetCharacterRequest {}
|
||||||
|
|
||||||
|
message GetCharacterResponse {}
|
||||||
@@ -1,9 +1,7 @@
|
|||||||
import express from 'express'
|
import express from 'express'
|
||||||
import { buildClient } from './db'
|
|
||||||
|
|
||||||
const app = express()
|
const app = express()
|
||||||
|
|
||||||
const dbClient = buildClient('db', 'rushvault', 'rushvault', 'rushvault')
|
|
||||||
|
|
||||||
app.get('/api/person', async (req, res) => {
|
app.get('/api/person', async (req, res) => {
|
||||||
res.status(200).send('potato!')
|
res.status(200).send('potato!')
|
||||||
@@ -11,6 +9,4 @@ app.get('/api/person', async (req, res) => {
|
|||||||
|
|
||||||
app.listen(8080, async () => {
|
app.listen(8080, async () => {
|
||||||
console.log('starting on 8080')
|
console.log('starting on 8080')
|
||||||
dbClient.connect()
|
|
||||||
console.log(await dbClient.query('SELECT NOW()'))
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
import { Client } from 'pg'
|
|
||||||
|
|
||||||
export function buildClient(
|
|
||||||
host: string,
|
|
||||||
user: string,
|
|
||||||
password: string,
|
|
||||||
database: string,
|
|
||||||
) {
|
|
||||||
return new Client({ user, password, host, database })
|
|
||||||
}
|
|
||||||
|
|
||||||
// export class VaultDbClient {
|
|
||||||
// client: Client
|
|
||||||
|
|
||||||
// constructor(
|
|
||||||
// host: string,
|
|
||||||
// port: number,
|
|
||||||
// user: string,
|
|
||||||
// password: string,
|
|
||||||
// database: string,
|
|
||||||
// ) {
|
|
||||||
// this.client = new Client({ user, password, host, port, database })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
|
|
||||||
const nodeExternals = require('webpack-node-externals');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
mode: 'production',
|
|
||||||
entry: './src/app.ts',
|
|
||||||
module: {
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
test: /\.tsx?$/,
|
|
||||||
use: 'ts-loader',
|
|
||||||
exclude: /node_modules/,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}, node: {
|
|
||||||
__dirname: false
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
extensions: ['.tsx', '.ts', '.js'],
|
|
||||||
},
|
|
||||||
output: {
|
|
||||||
filename: 'app.js',
|
|
||||||
path: path.resolve(__dirname, './dist'),
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
new NodePolyfillPlugin(),
|
|
||||||
],
|
|
||||||
externals: [nodeExternals()],
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user