https://github.com/nikvoronin/alterview
Yet another interview
https://github.com/nikvoronin/alterview
ado-dotnet asp-net-core-3 dapper moq-framework mssql-database rabbitmq-consumer rabbitmq-producer webapi-core xunit-tests
Last synced: 3 months ago
JSON representation
Yet another interview
- Host: GitHub
- URL: https://github.com/nikvoronin/alterview
- Owner: nikvoronin
- License: mit
- Created: 2019-12-02T18:10:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-25T12:05:17.000Z (over 5 years ago)
- Last Synced: 2025-01-16T11:27:06.517Z (5 months ago)
- Topics: ado-dotnet, asp-net-core-3, dapper, moq-framework, mssql-database, rabbitmq-consumer, rabbitmq-producer, webapi-core, xunit-tests
- Language: C#
- Size: 62.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Alterview
- Receive messages from RabbitMq server
- Sort messages by message type
- Update message in the database. Updating should be multithreaded.## Agenda
1. Project structure
1. Database schema
1. WebApi
1. Import service
1. Documentation## Installation
- Prepare Microsoft SQL Database. For example you can name it as `LocalTestDatabase`.
- Create two tables: `Sports` and `Events`. You can use files from the `db` folder.
- Add stored procedure `UpsertEvent` to the database. See `db/dbo.UpsertEvent.sql`.
- Configure `appsettings.json` for the WebApi and `appconfig.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`.## Project structure
- __/db__. Data base helper files
- `dbo.Events.sql`. Table creation script. The `Events` table.
- `dbo.Sports.data.sql`. Test data for `Sports` table
- `dbo.Sports.sql`. Table creation script. The `Sports` 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 on `Kestrel` web server.
- __/tests__. Unit tests.
- __/build__. Build folder for binaries and assemblies.## WebApi
### Sports
- `/api/sports`. Returns list of the sports with events count linked to sport.
- `/api/sports/{sport-id}/events/date/{date}`. Returns list of events by `sport-id` for the given `date`. Ex.: `/api/sports/149/events/date/2019-12-16`.### Events
- `/api/events/{event-id}`. Returns event description by `event-id`.