A boilerplate / template for a WebAPI server based on ASP.Net.
This API boilerplate includes the following:
- Role based JWT authentication.
- Web API Helpers which standardizes responses, maps errors, etc...
- An implementation of CSV Error logger.
- A business library and model projects for code separation.
- A core library with the following
- Custom data model attributes
- Database adapter
- Helper functions for hashing, encrypting, compression, etc...
- A constants library for commonly used constants.
Before using the code in production
- In Config.cs in Core.Constants
- Security.EncryptionKey
- In appsettings.json
- Database connection string.
- This string should be in encrypted format. Encrypted with the new encryption key.
- JWT secret, issuer and audience
- Database connection string.
- In launchsettings.json,
- Change SSL port
- Change applicationURL
- In Base class in BusinessLib, uncomment the line that establishes db connection
- HelpersLib in BusinessLib
- HelpersController in API