├── .gitignore ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.toptal.com/developers/gitignore/api/macos,visualstudiocode,node,windows,linux,vim,go 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=macos,visualstudiocode,node,windows,linux,vim,go 4 | 5 | ### Go ### 6 | # Binaries for programs and plugins 7 | *.exe 8 | *.exe~ 9 | *.dll 10 | *.so 11 | *.dylib 12 | 13 | # Test binary, built with `go test -c` 14 | *.test 15 | 16 | # Output of the go coverage tool, specifically when used with LiteIDE 17 | *.out 18 | 19 | # Dependency directories (remove the comment below to include it) 20 | # vendor/ 21 | 22 | ### Go Patch ### 23 | /vendor/ 24 | /Godeps/ 25 | 26 | ### Linux ### 27 | *~ 28 | 29 | # temporary files which can be created if a process still has a handle open of a deleted file 30 | .fuse_hidden* 31 | 32 | # KDE directory preferences 33 | .directory 34 | 35 | # Linux trash folder which might appear on any partition or disk 36 | .Trash-* 37 | 38 | # .nfs files are created when an open file is removed but is still being accessed 39 | .nfs* 40 | 41 | ### macOS ### 42 | # General 43 | .DS_Store 44 | .AppleDouble 45 | .LSOverride 46 | 47 | # Icon must end with two \r 48 | Icon 49 | 50 | 51 | # Thumbnails 52 | ._* 53 | 54 | # Files that might appear in the root of a volume 55 | .DocumentRevisions-V100 56 | .fseventsd 57 | .Spotlight-V100 58 | .TemporaryItems 59 | .Trashes 60 | .VolumeIcon.icns 61 | .com.apple.timemachine.donotpresent 62 | 63 | # Directories potentially created on remote AFP share 64 | .AppleDB 65 | .AppleDesktop 66 | Network Trash Folder 67 | Temporary Items 68 | .apdisk 69 | 70 | ### Node ### 71 | # Logs 72 | logs 73 | *.log 74 | npm-debug.log* 75 | yarn-debug.log* 76 | yarn-error.log* 77 | lerna-debug.log* 78 | .pnpm-debug.log* 79 | 80 | # Diagnostic reports (https://nodejs.org/api/report.html) 81 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 82 | 83 | # Runtime data 84 | pids 85 | *.pid 86 | *.seed 87 | *.pid.lock 88 | 89 | # Directory for instrumented libs generated by jscoverage/JSCover 90 | lib-cov 91 | 92 | # Coverage directory used by tools like istanbul 93 | coverage 94 | *.lcov 95 | 96 | # nyc test coverage 97 | .nyc_output 98 | 99 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 100 | .grunt 101 | 102 | # Bower dependency directory (https://bower.io/) 103 | bower_components 104 | 105 | # node-waf configuration 106 | .lock-wscript 107 | 108 | # Compiled binary addons (https://nodejs.org/api/addons.html) 109 | build/Release 110 | 111 | # Dependency directories 112 | node_modules/ 113 | jspm_packages/ 114 | 115 | # Snowpack dependency directory (https://snowpack.dev/) 116 | web_modules/ 117 | 118 | # TypeScript cache 119 | *.tsbuildinfo 120 | 121 | # Optional npm cache directory 122 | .npm 123 | 124 | # Optional eslint cache 125 | .eslintcache 126 | 127 | # Microbundle cache 128 | .rpt2_cache/ 129 | .rts2_cache_cjs/ 130 | .rts2_cache_es/ 131 | .rts2_cache_umd/ 132 | 133 | # Optional REPL history 134 | .node_repl_history 135 | 136 | # Output of 'npm pack' 137 | *.tgz 138 | 139 | # Yarn Integrity file 140 | .yarn-integrity 141 | 142 | # dotenv environment variables file 143 | .env 144 | .env.test 145 | .env.production 146 | 147 | # parcel-bundler cache (https://parceljs.org/) 148 | .cache 149 | .parcel-cache 150 | 151 | # Next.js build output 152 | .next 153 | out 154 | 155 | # Nuxt.js build / generate output 156 | .nuxt 157 | dist 158 | 159 | # Gatsby files 160 | .cache/ 161 | # Comment in the public line in if your project uses Gatsby and not Next.js 162 | # https://nextjs.org/blog/next-9-1#public-directory-support 163 | # public 164 | 165 | # vuepress build output 166 | .vuepress/dist 167 | 168 | # Serverless directories 169 | .serverless/ 170 | 171 | # FuseBox cache 172 | .fusebox/ 173 | 174 | # DynamoDB Local files 175 | .dynamodb/ 176 | 177 | # TernJS port file 178 | .tern-port 179 | 180 | # Stores VSCode versions used for testing VSCode extensions 181 | .vscode-test 182 | 183 | # yarn v2 184 | .yarn/cache 185 | .yarn/unplugged 186 | .yarn/build-state.yml 187 | .yarn/install-state.gz 188 | .pnp.* 189 | 190 | ### Vim ### 191 | # Swap 192 | [._]*.s[a-v][a-z] 193 | !*.svg # comment out if you don't need vector files 194 | [._]*.sw[a-p] 195 | [._]s[a-rt-v][a-z] 196 | [._]ss[a-gi-z] 197 | [._]sw[a-p] 198 | 199 | # Session 200 | Session.vim 201 | Sessionx.vim 202 | 203 | # Temporary 204 | .netrwhist 205 | # Auto-generated tag files 206 | tags 207 | # Persistent undo 208 | [._]*.un~ 209 | 210 | ### VisualStudioCode ### 211 | .vscode/* 212 | !.vscode/settings.json 213 | !.vscode/tasks.json 214 | !.vscode/launch.json 215 | !.vscode/extensions.json 216 | *.code-workspace 217 | 218 | # Local History for Visual Studio Code 219 | .history/ 220 | 221 | ### VisualStudioCode Patch ### 222 | # Ignore all local history of files 223 | .history 224 | .ionide 225 | 226 | ### Windows ### 227 | # Windows thumbnail cache files 228 | Thumbs.db 229 | Thumbs.db:encryptable 230 | ehthumbs.db 231 | ehthumbs_vista.db 232 | 233 | # Dump file 234 | *.stackdump 235 | 236 | # Folder config file 237 | [Dd]esktop.ini 238 | 239 | # Recycle Bin used on file shares 240 | $RECYCLE.BIN/ 241 | 242 | # Windows Installer files 243 | *.cab 244 | *.msi 245 | *.msix 246 | *.msm 247 | *.msp 248 | 249 | # Windows shortcuts 250 | *.lnk 251 | 252 | # End of https://www.toptal.com/developers/gitignore/api/macos,visualstudiocode,node,windows,linux,vim,go 253 | .envrc 254 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Lucas Santos 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JavaScript With Event Sourcing 2 | 3 | > A JavaScript event sourcing example from scratch 4 | 5 | ## Branches 6 | 7 | - `basic`: Basic implementation of a simple event sourced domain model 8 | - `complex`: A more complex example of a ship manager API using event sourcing and [Tardis](https://github.com/irontitan/tardis) 9 | 10 | Switch to the desired branch and start exploring. 11 | --------------------------------------------------------------------------------