Coder Social home page Coder Social logo

pdevito3 / peaklimsapisample Goto Github PK

View Code? Open in Web Editor NEW
50.0 2.0 9.0 820 KB

🧬 A complex DDD based web API to model the accessioning workflow within a LIMS.

C# 99.92% Dockerfile 0.08%
cqrs ddd docker dotnet vertical-slice-architecture design-patterns domain-driven-design integration-testing testing unit-testing

peaklimsapisample's Introduction

PeakLimsApi

This project was created with Craftsman.

Getting Started

  1. Run docker-compose up --build from your .sln directory to spin up your database(s) and other supporting infrastructure depending on your configuration (e.g. RabbitMQ, Keycloak, Jaeger, etc.).
  2. If using a Keycloak auth server, you'll need to configure it manually (new realm, client, etc) or use the scaffolded Pulumi setup.
    1. Install the pulumi CLI
    2. cd to your scaffolded Pulumi project
    3. Run pulumi up to start the scaffolding process
    4. Create a new stack by pressing Enter when prompted and then typing the name of the stack (e.g. dev). Alternatively you can use the pulumi stack init command to make a new stack first.

      Note: The stack name must match the extension on your yaml config file (e.g. Pulumi.dev.yaml) would have a stack of dev.

    5. Select yes to apply the configuration to your local Keycloak instance.
  3. If running a BFF:
    1. Make sure you have yarn installed
    2. Run the project with dotnet run or your IDE

Running Your Project(s)

Once you have your database(s) running, you can run your API(s), BFF, and Auth Servers by using the dotnet run command or running your project(s) from your IDE of choice.

Migrations

Migrations should be applied for you automatically on startup, but if you have any any issues, you can do the following: 1. Make sure you have a migrations in your boundary project (there should be a Migrations directory in the project directory). If there isn't see Running Migrations below. 2. Confirm your environment (ASPNETCORE_ENVIRONMENT) is set to Development using $Env:ASPNETCORE_ENVIRONMENT = "Development" for powershell or export ASPNETCORE_ENVIRONMENT=Development for bash. 3. cd to the boundary project root (e.g. cd RecipeManagement/src/RecipeManagement) 4. Run your project and your migrations should be applied automatically. Alternatively, you can run dotnet ef database update to apply your migrations manually.

> You can also stay in the `sln` root and run something like `dotnet ef database update --project RecipeManagement/src/RecipeManagement`

Running Integration Tests

To run integration tests:

  1. Ensure that you have docker installed.
  2. Go to your src directory for the bounded context that you want to test.
  3. Confirm that you have migrations in your infrastructure project. If you need to add them, see the instructions below.
  4. Run the tests

⏳ If you don't have the database image pulled down to your machine, they will take some time on the first run.

Troubleshooting

  • If your entity has foreign keys, you might need to adjust some of your tests after scaffolding to accomodate them.

Running Migrations

To create a new migration, make sure your environment is set to Development:

Powershell

$Env:ASPNETCORE_ENVIRONMENT = "Development"

Bash

export ASPNETCORE_ENVIRONMENT=Development

Then run the following:

cd YourBoundedContextName/src/YourBoundedContextName
dotnet ef migrations add "MigrationDescription"

To apply your migrations to your local db, make sure your database is running in docker run the following:

cd YourBoundedContextName/src/YourBoundedContextName
dotnet ef database update

peaklimsapisample's People

Contributors

pdevito3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.