• Stars
    star
    102
  • Rank 334,013 (Top 7 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A .NET Core demo application which uses the Onion Architecture

OnionArch

A .NET Core demo application which uses the Onion Architecture

Licence Used

License: MIT

See the contents of the LICENSE file for details

Support This Project

If you have found this project helpful, either as a library that you use or as a learning tool, please consider buying me a coffee:

Buy Me A Coffee

Pull Requests

PRs Welcome

Pull requests are welcome, but please take a moment to read the Code of Conduct before submitting them or commenting on any work in this repo.

Code of Conduct

OnionArch has a Code of Conduct which all contributors, maintainers and forkers must adhere to. When contributing, maintaining, forking or in any other way changing the code presented in this repository, all users must agree to this Code of Conduct.

See Code of Conduct.md for details.

Installing the Template

To use the template locally, it will need to be installed. You can do this from either the NuGet package (see the next section) or by installing it from source. To install from source, please seen the NuGetReadMe.md file for instructions.

NuGet Package

This project is now available as a NuGet package

Running The Application

  1. Ensure that the appsettings.json file contains a valid ConnectionStrings section.

You will need two connection strings:

  • onionDataConnection

This is the database which will contain all of the Book and Series information

  • onionAuthConnection

This is the database which will contain all of the ASP.NET MVC Core auth information.

Example ConnectionStrings section:

"ConnectionStrings": {
  "onionDataConnection": "DataSource=onionData.db",
  "onionAuthConnection": "DataSource=onionAuth.db"
},
  1. Open a command prompt in the Onion.Web directory

Issue the following commands to set up the databases:

dotnet restore

Check for migrations in the Onion.Repo.Identity directory. If there isn't a directory labelled Migrations, then run the following (from the Onion.Web) directory to generate them:

dotnet ef migrations add CreateIdentitySchema -c AppIdentityDbContext -p ../Onion.Repo/Onion.Repo.csproj -s Onion.Web.csproj

Similarly, check for migrations in the Onion.Repo.Data directory. If there isn't a directory labelled Migrations, then run the following (from the Onion.Web) directory to generate them:

dotnet ef migrations add InitialMigration -c DataContext -p ../Onion.Repo/Onion.Repo.csproj -s Onion.Web.csproj

Apply all migrations to the databases by running the following commands (from the Onion.Web directory):

dotnet ef database update -c DataContext -p ../Onion.Repo/Onion.Repo.csproj -s Onion.Web.csproj
dotnet ef database update -c AppIdentityDbContext -p ../Onion.Repo/Onion.Repo.csproj -s Onion.Web.csproj
  1. Build the front end

Issue the following commands from the Onion.Web directory:

npm i
npm run build
  1. Run the application and seed the database

Issue the following command from the Onion.Web directory:

dotnet run

More Repositories

1

OwaspHeaders.Core

Inject OWASP recommended HTTP Headers for increased security in a single line
C#
276
star
2

dwCheckApi

An ASP.NET Core WebAPI project for all Discworld novels
C#
27
star
3

BugTracker

A basic bug tracker, implemented in ASP NET Core
C#
19
star
4

FullStackTemplate

A full stack ASP.NET Core template
C#
13
star
5

UmBlazor

An example of client side Blazor using Headless Umbraco
C#
11
star
6

PokeBlazor

A Blazor app for requesting data from the Pokemon API
HTML
8
star
7

NET-Core-Podast-Transcriptions

Transcriptions for all released episodes of The .NET Core Podcast - used for generating all show notes for the website
HTML
8
star
8

ClacksMiddleware

An ASP.NET Core middlware for injecting the GNU Terry Pratchett header into all HTTP responses
C#
7
star
9

Bro-As-A-Service

An extremely simple ReactJs Client and .NET Core Server application for giving Hi Fives
C#
5
star
10

LaTeXDocuments

A collectin of my documents prepared in LaTeX
TeX
4
star
11

RaffleIdGenerator

A .NET Core global tool for generating a pseudo-random winner id - for raffle draws
C#
2
star
12

Talks

Slide decks for talks and presentations that I have given
JavaScript
2
star
13

bookApi

An API and UI for a fake book search engine - built entirely in the open, on Twitch
C#
2
star
14

dwCheckUI

A collection of .NET Core MVVM applications which use the dwCheckApi project
TypeScript
2
star
15

Hi-n

Code listings for the Esoteric Language Hi\n
JavaScript
1
star
16

Narrativia

A blog written in ASP.NET Core and Angular
C#
1
star
17

NazeBesto

TeX
1
star
18

WDTV-Live-Meta-Gen

A small C# app to generate XML metadata for media on WDTV Live (and compatibles)
C#
1
star
19

Blog-Tutorials

A repository for full code listings used in tutorials on my .NET Core blog
C#
1
star
20

Wilf

A .NET Core MVC application for choosing a random TV show within a given TV series
C#
1
star
21

SmsFixer

A C# console application to remove duplicate sms text messages contained within a SMSBackupAndRestore XML file
C#
1
star
22

Wordpress-x-Docker-Talk

Code generated for my Wordpress x Docker talk
Shell
1
star