#General
This is Iteration Zero
for projects implemented as Micro Services using CQRS, DDD and Event Sourcing.
This project uses
- ASP.NET Web API using attribute routing
- GetEventStore 3.0.3 for Windows
- MongoDB 3.0.3 (Windows 64-bit 2009 R2+)
- ElasticSearch
- StructureMap for DI
- PostSharp for AOP to provide things like logging
- Psake to build and test the solution
- NUnit and Rhino Mocks for Unit and Integration tests
- OctoPack to generate Nuget as artifacts for deployment
#Prerequisites You need to have the following installed on your system
- Visual Studio 2013 Professional or higher
- PostSharp
#Instructions
- Clone the Git repository to your local drive (https://github.com/gnschenker/ES-workshop)
- Execute the batch file
ClickToBuild.cmd
located in the folder containing the cloned repository to build and test the solution. - Alternatively open a PowerShell command prompt and navigate to the folder containing the cloned repository. Build the solution by invoking the following command
.\psake\psake.ps1 .\default.ps1 Test
##MongoDB
Please create a sub-folder logs\mongodb
and a folder data\mongodb
in the root folder of the repository
Either run MongoDB from the command line or run it as a service
- Open a Powershell console, navigate to the root of the repository and run MongoDB by using this command
$path = Get-Location
echo "systemLog:" > .\MongoDb\mongod.cfg
echo " destination: file" >> .\MongoDb\mongod.cfg
echo " path: $path\logs\mongodb\mongod.log" >> .\MongoDb\mongod.cfg
echo "storage:" >> .\MongoDb\mongod.cfg
echo " dbPath: $path\data\mongodb" >> .\MongoDb\mongod.cfg
&"$path\mongodb\mongod.exe" --config=$path\mongodb\mongod.cfg
- or, open a Powershell console, navigate to the root of the repository and run MongoDB as a Windows service by using this command
$path = Get-Location
echo "systemLog:" > .\MongoDb\mongod.cfg
echo " destination: file" >> .\MongoDb\mongod.cfg
echo " path: $path\logs\mongodb\mongod.log" >> .\MongoDb\mongod.cfg
echo "storage:" >> .\MongoDb\mongod.cfg
echo " dbPath: $path\data\mongodb" >> .\MongoDb\mongod.cfg
sc.exe create MongoDB binPath= "$path\mongodb\mongod.exe --service --config=$path\mongodb\mongod.cfg" DisplayName= "MongoDB" start= "auto"
Start-Service MongoDB
##GetEventStore
- Execute the batch file
RunGetEventStore.cmd
in the root folder of the repository to run GetEventStore. This will start GES with the data directory..\Data\EventStore\Projects
listening at the default tcp-ip port 1113 and http port 2113. The default username is equal toadmin
and the default password ischangeit
.
##ElasticSearch
- Make sure you have Java installed. Either JRE or JDK
- Make sure you have the environment variable JAVA_HOME set (in my case C:\Program Files (x86)\Java\jre7)
- Unzip the ElasticSearch zip file.
- Run ElasticSearch (double click the elasticsearch.bat in the bin folder of ElasticSearch)
#Admin GES
Open a browser and navigate to localhost:2113/web/index.html
. Enter the credentials when asked (admin
/changeit
). Navigate to the Stream Browser
tab. You should see a list of streams. Click on the one whose events you want to see, e.g. SampleAggregate-<ID>
where <ID>
is a Guid representing the ID of the aggregate instance. The list of events in the stream will be displayed starting with the most recent event.
#How to use
Run the application. By default IIS Express will listen at port 3030. You can use the Postman REST client for Google Chrome to test the application. Iteration zero implements a Samples
controller with multiple endpoints
##GET requests
1 localhost:3030/api/samples/<sampleId>
2 localhost:3030/api/samples?name=<some name>
##POST requests
1 localhost:3030/api/samples/start
2 localhost:3030/api/samples/<sampleId>/step1
3 localhost:3030/api/samples/<sampleId>/approve
4 localhost:3030/api/samples/<sampleId>/cancel
the POST requests to the first endpoint expects a body
{ name: "Some sample name" }
whilst the POST requests to the second endpoint expects a body like this
{ quantity: 12, dueDate: "2015-05-20" }
the POST requests to the third and fourth endpoints expect no body
es-workshop's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.