Skip to content

gdyrrahitis/exercise-paper-rulez

Repository files navigation

exercise-paper-rulez

Description

An application that performs processing on files grouped in folders per client.

Processing is performed on files with naming convention: <document-id>_<document-name>.<content-type>.

File is processed, unique keywords that match are stored in a database.

After keywords are stored in database, file is removed from file system.

How it works

Event driven solution.

User uses the web application to view in screen all files per client. Then a file can be selected to be processed by pressing the button with the file name highlighted. Then, application performes some orchestrated series of events to lookup, store and delete the file.

After the file is deleted, a real time event will be broadcasted to client application. An alert message will show, informing that the file for that specific client is deleted.

Technologies

Front end is build with ASP.NET MVC.

UI uses a RESTful API, by ASP.NET Web API to send the request to backend. The API uses an underlying blob storage, which can be easily varied from File System to Azure Blob Storage, to load the file and get its contents in binary format. Then Web API broadcasts a command to another service, the Processing service. This is responsible of performing processing on the file based on the parameter <type-of-processing> in first line of the file. A factory is varying the algorithms based on this input. After processing is performed, new event is broadcasted to the store service, which stores the results in Sql Server database.

Upon successfull storing the keywords in database, a new event is broadcasted to the Finalizer service, which removes the file and then issues a new event for the SignalR server to catch and inform the UI that file is removed. Button is disabled when event is broadcasted to client.

All underlying services are using RabbitMq service broker.

For persistence, a wrapper library over Dapper, Syrx is used (disclaimer, I am contributor).

For real time events, SignalR is used.

Setup

For setting up the database, open the PaperRulez.Repositories project and then the sql folder. Run the setup.cmd to setup the database.

For setting up the client files:

  • In solution root folder you will find the MyClients folder. Copy it in Documents in order to run the application as is. If you want to have it in different location open the CastleWindsorConfig.cs in PaperRulez.Web.Api project and update the "root" value this piece of code:
container.Register(Component.For<IBlobStorage>().ImplementedBy<FileSystemBlobStorage>()
    .DependsOn(Dependency.OnValue("root", Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "MyClients")))
    .LifestyleTransient());

Video

Video here

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published