Skip to content
This repository has been archived by the owner on Oct 29, 2020. It is now read-only.

cds-snc/hello-esdc

Repository files navigation

hello-esdc

Project structure/files

  • database (for seed .sql files)
  • src
    • HelloESDC.API (.NET Core webapi project)
    • Web
      • WebSPA (where we'll build our sample SPA frontend)
      • WebWxT (where we'll build our sample WxT frontend)
  • test (for tests - may move to sub-project folders?)

Docker

There is a Dockerfile for the HelloESDC.API sub-project that will build a container for the API:

cd src/HelloESDC.API
docker build -t hello-esdc-api .

There are also empty Dockerfiles in the src/Web/WebSPA and src/Web/WebWxT folders for future use.

Running

There is a basic docker-compose.yml file at the root that will bring up the api and a postgres database. This is just taken from some example code (see References below), we don't have to stick with Postgres.

There currently is no interaction between the containers, just sample code at the moment.

You can bring up the containers by doing this:

  1. Navigate to project root in terminal
  2. Generate migration script: sh util/build_migrations.sh
  3. Launch Docker containers: docker-compose up --build

And the api will be available at: localhost:8000/api/values

To stop and reset:

  1. Exit the apps: CTRL+C
  2. Remove volumes: docker-compose down

Todo

There are quite a few pieces still missing, including:

  • Tests
  • CI

References

Medium post example of .net core webapi project with postgresql database:

Indepth article about Microservices Architecture in .NET, plus a reference application