https://github.com/defra/tdm-prototype-backend
Git repository for service tdm-prototype-backend
https://github.com/defra/tdm-prototype-backend
backend cdp dotnet service
Last synced: over 1 year ago
JSON representation
Git repository for service tdm-prototype-backend
- Host: GitHub
- URL: https://github.com/defra/tdm-prototype-backend
- Owner: DEFRA
- Created: 2024-08-22T15:51:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-26T15:06:16.000Z (over 1 year ago)
- Last Synced: 2025-01-12T19:09:01.769Z (over 1 year ago)
- Topics: backend, cdp, dotnet, service
- Language: C#
- Size: 547 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tdm-prototype-backend
Core delivery C# ASP.NET backend template.
### Install MongoDB
- Install [MongoDB](https://www.mongodb.com/docs/manual/tutorial/#installation) on your local machine
- Start MongoDB:
```bash
sudo mongod --dbpath ~/mongodb-cdp
```
### Inspect MongoDB
To inspect the Database and Collections locally:
```bash
mongosh
```
### Testing
Run the tests with:
Tests run by running a full `WebApplication` backed by [Ephemeral MongoDB](https://github.com/asimmon/ephemeral-mongo).
Tests do not use mocking of any sort and read and write from the in-memory database.
```bash
dotnet test
````
### Running
Run CDP-Deployments application:
```bash
dotnet run --project TdmPrototypeBackend --launch-profile Development
```
### Testing push
# tdm-prototype-backend-cli
This is a git style command line interface to be able to quickly automate common tasks that can be run manually or automated.
## Project Dependencies
|Package| Description |
|--|--|
| [CommandLineParser](https://github.com/commandlineparser/commandline)| Used for parsing command line arguments |
| [MediatR](https://github.com/jbogard/MediatR) | Used as a mediator to segregate the commands the CLI will support |
| [Humanizer](https://github.com/Humanizr/Humanizer)| Used for converting strings |
| [RazorLight](https://github.com/toddams/RazorLight)| Used for the templating engine for generating CSharp classes |
| [JsonSchema.Net](https://github.com/jsonsystems/json-schema)| Used to convert the JsonSchema into an object model to be parsed |
## Commands
### generate-csharp-from-json-schema
|Verb| Description |
|--|--|
|generate-csharp-from-json-schema | Generates Csharp classes from Json Schema. |
|Option| Description |
|--|--|
| -s, --schema | The Json schema file, which to use to generate the csharp classes. |
| -o, --outputPath | The path to save the generated csharp classes. |
### Example
generate-csharp-from-json-schema --schema C:\jsonschema.json --outputPath C:\output