- Single Page Application
- Integration with ElasticSearch for smart search of books (via keywords inside the title/description/author)
- Authentication as a service (IdentityServer, JWT)
- Swagger API documentation
- Add/edit/delete books
- Book search
- Sign in/Sign up
- Restore nuget packages (
dotnet-restore
) - Apply migrations in NetReact.Infrastructure and NetReact.IdentityServer projects (execute
dotnet ef database update
in both projects directories, MS SQL Server required) - If you want to use Elastic Search functionality, you need to download and run local instance of ES (Elastic.co)
- Build solution, run
NetReact.API
andNetReact.IdentityServer
projects
- Install packages (
npm i
) - run
npm run start
to start dev server (client app will be available viahttp://localhost:3000
)
- Run
generate_self_signed_cert.ps1
Powershell scenario as administrator to generate self-signed root certificate and individual certificates for NetReact.API and NetReact.IdentityServer applications (trusted root certificate will be used to sign them). If scenario fails with pCertContext descriptor/handler error, add generated src\certs\aspnetapp-root-cert.cer manually as local machine trusted root certificate. Or you can skip this part and use your legit non-dev trusted certificate issued by third-party authority (e.g. Let's Encrypt). Very informative article on topic for anyone interested - Securing an API while running IdentityServer4 on Docker with HTTPS enabled locally - Build and run Docker containers by executing
docker-compose up --build -d
- Increase memory limit for Elastic Search if ES docker container keeps shutting down. Guide - Elastic.co
# Windows only
wsl -d docker-desktop
sysctl -w vm.max_map_count=262144
- Restore clean state of application - remove .vs, .idea, .vscode or any other IDE-specific folders, remove bin, obj and cert folders
- (RIDER) Press
More Templates
menu entry inNew Solution
menu, thenInstall Template
, then choose root folder of NetReact repository - (dotnet) In repository's root, execute below command:
dotnet new --install .
You may explore database with DBeaver/SQL Server Management Studio/DataGrip via
127.0.0.1\sql-server-db,1433
User: sa
Password: StrongP@ssw0rd
SQL Server service needs to be stopped in SQL Server Configuration Manager to be able to connect to Docker container with SQL Server instance.
- src/NetReact.API - ASP.NET Core Web API (CQRS pattern)
- src/NetReact.Application
- src/NetReact.Domain
- src/NetReact.Infrastructure - Entity Framework Core, ElasticSearch
- src/NetReact.IdentityServer - authentication as a service (IdentityServer 6)
- src/NetReact.React - Client (React with Typescript)
The design of the Web API follows CQRS pattern, that allows intercating with the main database (SQL Server) and ElasticSearch, for smart search of books.
Application layer of the web application, containing queries and commands for each entity, as well as the book recommendation service, based on the content-filtering algorithm.
Contain domain models, their configurations and repositories
Contains the implementation of repositories for interacting with databases and dbContext.
SQL Server acts as a main database, which contains all of the data. ElasticSearch db contains only the information of books and allows to perform smart queries.
Authentication is implemented as a server, following resource owner credentials workflow and using IdentityServer.
Client side of the application. React with Typescript.
Book Exchange App (dimatrubca)