• This repository has been archived on 29/Feb/2024
  • Stars
    star
    191
  • Rank 201,864 (Top 4 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 7 months ago

Reviews

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

Repository Details

A full-featured starter template for `dotnet new` to quickly scaffold an Asp.Net 8 Web-Api project with MongoDB as the data store.

MongoWebApiStarter

A full-featured starter template for dotnet new to quickly scaffold an Asp.Net 6 Web-Api project using pure vertical slice architecture with MongoDB as the data store.

Install & Scaffold

  dotnet new install MongoWebApiStarter
  dotnet new mongowebapi -n MyAwesomeApp

Features

Platform

  • base framework: .net 6
  • api/web-service framework: FastEndpoints
  • language: c#
  • database: mongodb

Vertical Slice Architecture

  • each use case/action/feature is isolated in it's own namespace (vertical slice).
  • there is no cross contamination between feature slices.
  • domain entities are contained in a separate namespace as they are cross contaminating by nature.
  • does not use the mediator pattern like most other templates.

Misc. Features

  • strongly typed app settings which binds to appsettings.json
  • JWT token authentication with embedded claims & permissions
  • permission & claim based authorization
  • custom middleware for putting site offline (maintenance mode)

Api Features

  • input validation with fluentvalidation rules
  • account creation, email validation, login
  • salted hash password storage and verification with bcrypt
  • email queue with background service for sending emails with smtp
  • image uploading & retrieval

Data Access

  • data access done using mongodb.entities library
  • most data access logic is self contained in each vertical slice.
  • shared data access logic is located in the Logic.* namespace.

Integration Tests

Bonuses

Visual Studio New Item Template

a visual studio extension is available to enable you to quickly add a new vertical slice feature file set. after you install the vsix, you will have a new item called "FastEndpoints Feature FileSet" in the "add > new item" dialog of visual studio.

Linux Server Configuration

instructions & config files for setting up a linux server for deployment are available in the .linux-server-setup folder

More Repositories

1

FastEndpoints

A light-weight REST Api framework for ASP.Net 6 that implements REPR (Request-Endpoint-Response) Pattern
C#
1,397
star
2

MongoDB.Entities

A data access library for MongoDB with an elegant api, LINQ support and built-in entity relationship management
C#
517
star
3

MiniDevTo

Source code of the Dev.To article "Building REST APIs In .Net 8 The Easy Way!"
C#
88
star
4

Hybrid-Inverter-Monitor

Monitoring application for hybrid inverters using the Voltronic communication protocol & JK BMS via USB port.
C#
75
star
5

Rider-Settings-For-VS-Users

Heavily customized Rider settings to help make Visual Studio users feel right at home.
17
star
6

Pandorian

Pandora client with built-in proxy support written in VB.Net
Visual Basic
12
star
7

MongoDB-Entities-Repository-Pattern

Example project showcasing how to use the repository pattern with the MongoDB.Entities data access library
C#
11
star
8

jk-bms-test

test console app for reading live data from jk bms via rs485 port.
C#
4
star
9

VisitorLog

A free and open source visitor logging system
C#
3
star
10

DiffWords

Generates a word based inline diff, given 2 pieces of text
C#
3
star
11

WordDiff

A class library for diffing two blocks of text word-by-word and marking the differences with <ins> and <del> tags.
C#
3
star
12

FastEndpoints-FileHandling-Demo

sample project showcasing image storage and retrieval in mongodb using FastEndpoints & MongoDB.Entities
C#
2
star
13

IMDb_Watchlist_Remove

Automate removal of movies from your imdb watchlist
Visual Basic
2
star
14

FastEndpoints-Auth0-Demo

demo application for auth0 usage with permissions
C#
1
star
15

Tuya-Device-Monitor

C#
1
star