- Receive messages from RabbitMq server
- Sort messages by message type
- Update message in the database. Updating should be multithreaded.
- Project structure
- Database schema
- WebApi
- Import service
- Documentation
- Prepare Microsoft SQL Database. For example you can name it as
LocalTestDatabase
. - Create two tables:
Sports
andEvents
. You can use files from thedb
folder. - Add stored procedure
UpsertEvent
to the database. Seedb/dbo.UpsertEvent.sql
. - Configure
appsettings.json
for the WebApi andappconfig.json
for the importer service. - Build the Solution.
- Run
build/ImportService.exe
console app or implement your own one. - Start WebApi service from
build/Alterview.Web.exe
.
- /db. Data base helper files
dbo.Events.sql
. Table creation script. TheEvents
table.dbo.Sports.data.sql
. Test data forSports
tabledbo.Sports.sql
. Table creation script. TheSports
table.dbo.UpsertEvent.sql
. Stored procedure for insert-or-update (upsert) database action.
- /src. Project source code
Alterview.Core
. Core classes and interfaces. Does not depend on any networks, frameworks etc.Alterview.ImportService
. Console application that do all the import from RabbitMq and export messages to the database.Alterview.Infrastructure
. Business logic of the project components.Alterview.Web
. WebApi service based onKestrel
web server.
- /tests. Unit tests.
- /build. Build folder for binaries and assemblies.
/api/sports
. Returns list of the sports with events count linked to sport./api/sports/{sport-id}/events/date/{date}
. Returns list of events bysport-id
for the givendate
. Ex.:/api/sports/149/events/date/2019-12-16
.
/api/events/{event-id}
. Returns event description byevent-id
.