Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Development on a bounded context

Gard Njåtun Krøyer edited this page May 29, 2019 · 3 revisions

Running the code for a bounded context

Each bounded context has its own subfolder in the Source folder, containing a .sln file. The folder name per bounded context can be found in the table above.

Everything you need to build and run the bounded context can be found within the specified folder for said bounded context. For example, everything you need to build and run the "Reporting" bounded context, can be found in the Reporting folder under Source.

For simplicity, we have also added a generalized guide for running a bounded context below. This step-by-step guide applies to all bounded contexts except Analytics. To run Analytics see here

In all steps below, replace {Bounded Context Folder} with the folder of the bounded context you would like to run.

Step 1: Run MongoDB in a Docker container

docker run -p 27017:27017 mongo

Step 2: Build and run the .NET Core backend on your local machine

(Active path: cbs\Source\{Bounded Context Folder})

Download nuget dependencies

dotnet restore

Build

dotnet build

(Active path: cbs\Source\{Bounded Context Folder}\Core)

Run locally

dotnet run

Open browser at address http://localhost:5000/swagger to access Swagger.

Step 3: Building and running the Node.js/Angular.js frontend on your local machine

(Active path: cbs/Source/{Bounded Context Folder}/Web)

Restore dependencies

npm install

Build and host locally

npm start

Open http://localhost:4200/ in your browser to access the UI.

Step 4: (Optional) Populating the database with test data

To populate the database with test data, go to http://localhost:5000/swagger and use the TestDataGenerator API. This will retrieve test data from the /Web/TestData folder and add it to the database.

Running Analytics

The analytics bounded context is coded differently than the others. Here the backend project is in the Web/ folder and the frontend in the Web.Frontend folder. To run it:

Go to Source/Analytics/Web/ and install all dependencies

dotnet restore

Run the backend

dotnet run

Go to Source/Analytics/Web.Frontend/ and install dependencies

npm install

Run the frontend

npm start

To populate test data go to http://localhost:5000/swagger and run the TestDataGenerator.

Backlog

Each bounded context has its own backlog that can be found on the GitHub project page.
For example: The backlog for the "Reporting" bounded context can be found on the "Reporting" project page.

Any issue labeled "good first issue" will also have a label referencing the bounded context it belongs to so that you will be able to find the source code for the bounded context as explained above.

Next steps

  1. Find an issue you want to work on. Issues labeled "good first issues" are issues that should be relatively easy to get started on without too much background information.
  2. Create a fork. In order to contribute to this project, you will need to fork this repository.
  3. Create a branch, make changes and test them. All commits must be related to an issue by adding a #{number of issue} to the comment.
  4. Synchronize your fork. Keep your fork synchronized with the CBS repository to avoid conflicts, as described here.
  5. Create a pull request. Once your changes are ready, create a pull request and reference the issues you have worked on.