Skip to content

dannyrb/Simple.MVC

Repository files navigation

About

A .NET MVC project with pre-installed nuget packages, project setup, and basic CRUD to reduce new project startup time.

TODO:

Listed in order of priority

  • Boilerplate controller for CRUD
    • Automatic table/list generation
    • Paging, sorting, filtering
    • View/Edit detail
  • Add SAMMY.JS
  • Boilerplate WebAPI controller for CRUD
  • Add simple model errors
  • Add simple "anywhere alerts"
  • Add simple "anywhere "
  • Base promises?
  • Example external API boilerplate?
  • Add Select2.JS

Dependencies

  • Node + NPM
  • Bower

First Time...

  • Clone Repo
  • Open and build project in VS
    • Downloads project dependencies
  • Update Web.Config's connection string to point to a DB
  • Run database-update in Package Manager Console (target MVC project)
  • Open Command Prompt
    • Navigate to MVC directory of project
    • Run npm install
    • Run bower install

Project Structure

  • Domain Project
  • ViewModel Project
  • MVC Project

Installed:

Swapping/Similar Tools

  • AutoMapper is a very powerful tool that makes it easy to map from one class to another. Common use cases are from forms to domain object, or from domain objects to view models.
    • Dapper is a commonly used alternative.
  • Bogus is a port of faker.js. It's used to seed your database with some tasy fake (but realistic looking) data. It's one of the newer ports, and has decent adoption. This is the first time I've used it over Faker.NET

What's Next?

This is for small/simple projects. If you wanted to abstract things out further, you may want to consider the following:

  • Create additional projects:
    • Simple.Repository
    • Simple.Service
    • Simple.Identity (Identity is IN MVC right now. Killing full AutoMapper maps in VM Proj [User])
    • Simple.ExternalServices
  • Implement Dependency Injection using Unity
  • Flush out Base/Common/AggregateRoot classes
  • Move migrations to the new Repository project
  • Implement Command/Query Responsibility Segregation in the Service layer
  • Implement Unit of Work design pattern

We DO NOT do this in the current project because it adds a lot of boiler plate code that increases the time to dev. However, it big time increases maintainability, consistancy across projects, etc. To reduce development time, it may be worth looking into code scaffolding via:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published