Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

collinbarrett/TwitterStreamAnalytics

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

TwitterStreamAnalytics

Analyzing the Twitter 1% Sample Stream in .NET

Get Started

Configuration

Add a Twitter App Bearer Token as an environment variable:

Twitter__AppBearerToken=

or secret:

"Twitter:AppBearerToken": ""

Run

  1. Start the TwitterStreamAnalytics.Api project in Visual Studio.
  2. Use the Swagger UI that appears to interact with the app.

Architecture

By design, the Consumers application could be extracted to one or more independent instances supporting high-throughput via the competing consumers pattern. The message bus transport could be swapped from in-memory to a persistent/scalable provider such as RabbitMQ. The Entity Framework Core provider could be swapped from in-memory to a persistent/scalable provider such as Cosmos DB. The app seeks to align with DDD and CQRS patterns to support increasing feature complexity.

Dependency Diagram

flowchart TB;  
	Api-->SharedKernel.Infrastructure.MessageBus.InMem;

	subgraph Message Bus
		SharedKernel.Infrastructure.MessageBus.InMem-->N3([MassTransit]);
	end

	SharedKernel.Infrastructure.MessageBus.InMem-->Api.Application;
	SharedKernel.Infrastructure.MessageBus.InMem-->Consumers.Application;
  
	subgraph Api App
		Api-->N1([Swashbuckle.AspNetCore]);
		Api.Application-->Api.Infrastructure;
		Api.Infrastructure-->N4([TweetinviAPI]);
		Api.Infrastructure-->N5([MassTransit.Abstractions]);  
	end

	subgraph Consumers App
		Consumers.Application-->Consumers.Infrastructure;
		Consumers.Infrastructure-->Consumers.Domain;
		Consumers.Infrastructure-->N6([MassTransit.Abstractions]);
		Consumers.Infrastructure-->N7([Scrutor]);
	end

	Api.Infrastructure-->SharedKernel.Domain;
	Consumers.Domain-->SharedKernel.Domain;
	Api.Infrastructure-->SharedKernel.Infrastructure.Persistence.InMem;
	Consumers.Infrastructure-->SharedKernel.Infrastructure.Persistence.InMem;

	subgraph Persistence
		SharedKernel.Infrastructure.Persistence.InMem-->N8([Microsoft.EntityFrameworkCore.InMemory]);
	end