Coder Social home page Coder Social logo

afroukh / onionarch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gaprogman/onionarch

0.0 1.0 0.0 877 KB

A .NET Core demo application which uses the Onion Architecture

License: MIT License

C# 68.56% CSS 0.50% JavaScript 0.03% Dockerfile 0.31% HTML 30.61%

onionarch's Introduction

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. Run the application and seed the database

Issue the following command from the Onion.Web directory:

dotnet run

onionarch's People

Contributors

gaprogman avatar dillonad avatar

Watchers

James Cloos 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.