Templates
AvantiPoint provides project templates and an in-repo production host for a fully-featured NuGet feed.
In-repo production host (recommended)
For new deployments, use AvantiPoint.Packages.Host and the root Dockerfile instead of generating a standalone project from the legacy template package.
| Capability | In-repo host |
|---|---|
| Docker | Root Dockerfile → docker run (see Hosting) |
| Databases | Sqlite, SQL Server, MySQL, PostgreSQL (auto-discovered) |
| UI auth | Microsoft Entra, Microsoft Account, Google, GitHub |
| API tokens | Scoped read/write, hashed storage |
| Postmark (default), SendGrid, SMTP, Amazon SES, Azure Communication Services, Mailgun, Resend | |
| Admin UI | API keys, users, settings, package sources |
See Hosting — Production host and Host email.
The standalone AvantiPoint.Packages.Templates NuGet package remains available for teams that want a generated project; feature parity is moving to the in-repo host.
Package Feed Template
The complete package feed template includes:
- Azure Active Directory integration for authentication
- API token management (create, revoke, regenerate)
- SendGrid email notifications for:
- Package publishing
- Token creation/revocation
- New IP address detection
- Token usage tracking
- User interface for token management
Installation
Install the template package:
dotnet new install AvantiPoint.Packages.Templates
Check available templates:
dotnet new list avantipoint
Creating a New Feed
Create a new project from the template:
dotnet new avantipoint-feed -n MyCompanyFeed
cd MyCompanyFeed
Configuration
The template requires configuration for:
-
Azure AD - For user authentication
{"AzureAd": {"Instance": "https://login.microsoftonline.com/","TenantId": "your-tenant-id","ClientId": "your-client-id","CallbackPath": "/signin-oidc"}} -
SendGrid - For email notifications
{"SendGrid": {"ApiKey": "your-sendgrid-api-key","FromEmail": "noreply@yourcompany.com","FromName": "Your Company Package Feed"}} -
Database - SQL Server connection
{"ConnectionStrings": {"SqlServer": "Server=localhost;Database=PackageFeed;Integrated Security=true;"}}
Features
API Token Management
Users can manage their API tokens through a web interface:
- Create new tokens with custom names
- View all active tokens
- Revoke tokens
- See token usage history
Email Notifications
Automatic email notifications for:
- Token Created: Sent when a user creates a new API token
- Token Revoked: Sent when a token is revoked
- Token Regenerated: Sent when a token is regenerated
- Package Published: Sent when a user publishes a package
- New IP Address: Sent when a token is used from a new IP address
Security Features
- IP address tracking for all token usage
- Token expiration support
- Token revocation
- Azure AD single sign-on
- Automatic email alerts for suspicious activity
Customization
The template provides a starting point. You can customize:
- Authentication: Switch from Azure AD to another provider
- Email: Switch from SendGrid to another email service
- UI: Customize the web interface
- Business Logic: Modify token policies, IP tracking, etc.
Running the Template
- Configure settings in
appsettings.json - Create the database:
dotnet ef database update
- Run the application:
dotnet run
- Access the web interface at
https://localhost:5001
Deployment
The template is ready to deploy to:
- Azure App Service
- IIS
- Linux with Nginx
- Docker containers
See Hosting for deployment guides.
Building Your Own Template
If the provided template doesn't meet your needs, you can create your own:
- Start with a sample - Use
OpenFeedorAuthenticatedFeedfrom the samples - Add your features - Authentication, UI, business logic
- Create a template - Package it as a
dotnet newtemplate - Share - Publish to NuGet.org or your private feed
Creating a Template Package
- Create a
.template.configfolder in your project - Add
template.json:{"name": "My NuGet Feed","identity": "MyCompany.Packages.Template","shortName": "mycompany-feed","tags": {"language": "C#","type": "project"},"sourceName": "MyCompanyFeed","preferNameDirectory": true} - Package and publish:
dotnet packdotnet nuget push MyCompany.Packages.Template.1.0.0.nupkg
See Also
- Getting Started - Build a feed from scratch
- Authentication - Implement authentication
- Hosting - Deploy your feed
- Samples - Example projects