-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b238ce9
commit 2f5bf6c
Showing
25 changed files
with
4,475 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/node_modules/ | ||
**/dist/ | ||
**/*.d.ts | ||
/src/types/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Editor configuration, see http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/node_modules/* | ||
# build artifacts | ||
dist/*coverage/* | ||
|
||
# data definition files | ||
**/*.d.ts | ||
|
||
# custom definition files | ||
/src/types/ | ||
|
||
!.eslintrc.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"env": { | ||
"es2023": true, | ||
"node": true | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"plugin:prettier/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2023, | ||
"sourceType": "module", | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": { | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" } | ||
], | ||
"@typescript-eslint/no-misused-promises": ["off"], | ||
"@typescript-eslint/prefer-namespace-keyword": "off" | ||
}, | ||
"settings": { | ||
"import/resolver": { | ||
"typescript": {} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v20.11.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
**/dist/ | ||
**/lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"tabWidth": 2, | ||
"singleQuote": true | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug current file", | ||
"type": "node", | ||
"request": "launch", | ||
|
||
// Debug current file in VSCode | ||
"program": "${file}", | ||
|
||
/* | ||
Path to tsx binary | ||
Assuming locally installed | ||
*/ | ||
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/tsx", | ||
|
||
/* | ||
Open terminal when debugging starts (Optional) | ||
Useful to see console.logs | ||
*/ | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen", | ||
|
||
// Files to exclude from debugger (e.g. call stack) | ||
"skipFiles": [ | ||
// Node.js internal core modules | ||
"<node_internals>/**", | ||
|
||
// Ignore all dependencies (optional) | ||
"${workspaceFolder}/node_modules/**" | ||
] | ||
}, | ||
{ | ||
"name": "Debug All Tests (Node)", | ||
"type": "node", | ||
"request": "launch", | ||
"skipFiles": ["<node_internals>/**"], | ||
"runtimeExecutable": "npm", | ||
"runtimeArgs": [ | ||
"run-script", | ||
"test", | ||
"--inspect-brk=9229", | ||
"--preserve-symlinks" | ||
], // Use --inspect-brk for debugging | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen", | ||
"cwd": "${workspaceFolder}", | ||
"sourceMaps": true, | ||
"smartStep": true, | ||
"resolveSourceMapLocations": [ | ||
"${workspaceFolder}/**", | ||
"!**/node_modules/**", | ||
"node_modules/@event-driven.io/emmett-expressjs/**/*.*" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnPaste": false, | ||
"editor.formatOnSave": true, | ||
|
||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "explicit", | ||
"source.fixAll.eslint": "explicit", | ||
"source.addMissingImports": "always" | ||
}, | ||
|
||
"editor.tabSize": 2, | ||
|
||
"files.exclude": { | ||
"**/*.tsbuildinfo": true | ||
}, | ||
"files.eol": "\n", | ||
|
||
"typescript.preferences.importModuleSpecifier": "relative", | ||
"eslint.workingDirectories": [{ "mode": "auto" }], | ||
"debug.javascript.terminalOptions": { | ||
"nodeVersionHint": 20 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "build:ts:watch", | ||
"group": "build", | ||
"problemMatcher": [], | ||
"label": "npm: build:ts:watch", | ||
"detail": "tsc --watch" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
[![](https://dcbadge.vercel.app/api/server/fTpqUTMmVa?style=flat)](https://discord.gg/fTpqUTMmVa) [<img src="https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white" height="20px" />](https://www.linkedin.com/in/oskardudycz/) [![Github Sponsors](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&link=https://github.com/sponsors/oskardudycz/)](https://github.com/sponsors/oskardudycz/) [![blog](https://img.shields.io/badge/blog-event--driven.io-brightgreen)](https://event-driven.io/?utm_source=event_sourcing_nodejs) [![blog](https://img.shields.io/badge/%F0%9F%9A%80-Architecture%20Weekly-important)](https://www.architecture-weekly.com/?utm_source=event_sourcing_nodejs) | ||
|
||
![](./docs/public/logo.png) | ||
|
||
# Emmett - Sample showing event-sourced WebApi with Express.js and EventStoreDB | ||
|
||
Read more in [Emmett getting started guide](https://event-driven-io.github.io/emmett/getting-started.html). | ||
|
||
## Prerequisities | ||
|
||
Sample require EventStoreDB, you can start it by running | ||
|
||
```bash | ||
docker-compose up | ||
``` | ||
|
||
You need to install packages with | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
## Running | ||
|
||
Just run | ||
|
||
```bash | ||
npm run start | ||
``` | ||
|
||
## Running inside Docker | ||
|
||
To build application: | ||
|
||
```bash | ||
docker-compose --profile app build | ||
``` | ||
|
||
To run application: | ||
|
||
```bash | ||
docker-compose --profile app up | ||
``` | ||
|
||
### Testing | ||
|
||
You can either run tests with | ||
|
||
``` | ||
npm run test | ||
``` | ||
|
||
Or manually with prepared [.http](.http) file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: "3.8" # Specify Docker Compose version | ||
|
||
services: | ||
postgres: | ||
image: postgres:15.1-alpine | ||
ports: | ||
- "5432:5432" | ||
environment: | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_USER=postgres | ||
|
||
pgadmin: | ||
container_name: pgadmin_container | ||
image: dpage/pgadmin4 | ||
environment: | ||
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL:[email protected]} | ||
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD:-postgres} | ||
- PGADMIN_CONFIG_SERVER_MODE=False | ||
- PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED=False | ||
ports: | ||
- "${PGADMIN_PORT:-5050}:80" | ||
entrypoint: /bin/sh -c "chmod 600 /pgpass; /entrypoint.sh;" | ||
user: root | ||
volumes: | ||
- ./docker/pgAdmin/pgpass:/pgpass | ||
- ./docker/pgAdmin/servers.json:/pgadmin4/servers.json | ||
depends_on: | ||
- postgres | ||
restart: unless-stopped |
Oops, something went wrong.