https://github.com/neckerfree/techtest
Web API for the program that plays Rock, Paper, Scissors against a human.
https://github.com/neckerfree/techtest
Last synced: about 2 months ago
JSON representation
Web API for the program that plays Rock, Paper, Scissors against a human.
- Host: GitHub
- URL: https://github.com/neckerfree/techtest
- Owner: NeckerFree
- Created: 2023-01-25T20:09:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-27T00:09:19.000Z (over 3 years ago)
- Last Synced: 2025-01-13T10:35:49.353Z (over 1 year ago)
- Language: C#
- Size: 7.26 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ο»Ώ# TechTest
Web API for the program that plays Rock, Paper, Scissors against a human.
# π Table of Contents
- [π About the Project](#about-project)
- [π Built With](#built-with)
- [Tech Stack](#tech-stack)
- [Key Features](#key-features)
- [π» Getting Started](#getting-started)
- [Setup](#setup)
- [Prerequisites](#prerequisites)
- [Install](#install)
- [Usage](#usage)
- [π₯ Authors](#authors)
- [βοΈ Show your support](#support)
- [β FAQ (OPTIONAL)](#faq)
- [π License](#license)
**TechTest** is a .NET Solution that uses a layer architecture to expose a minimal Web API
for the program that plays Rock, Paper, Scissors against a human..
## Web API Service Images:
***Swagger Index:***

***Start Game Method:***

***Make Move Method:***

***End Game Method:***

***Historic Results Request:***

***Historic Results Response:***

.NET Core Minimal API,
Server
Database
> Describe between 1-3 key features of the application.
- **EF Core Database First**
- **Unit of Work and Repository Pattern**
- **Services Dependency Injection**
- **Data Annotations**
- **Extension Methods**
- **Dependency Injection**
- **Paging**
- **GIT Flow**
To get a local copy up and running, follow these steps:
### Prerequisites
In order to run this project you need:
- Visual Studio .NET 2022 updated to use NET Core 7
- SQL Server Database
### Setup
1. Clone this repository to your desired folder:
```
cd my-folder
git clone https://github.com/NeckerFree/TechTest
```
2. Run next commands to generate the database from TT.DataAccess project:
```
dotnet ef migrations add InitialCreate
dotnet ef database update
```
3. Create a User as db_owner of this batabase
4. Modify the connection string (GamesConnection) in the file \TT.MinApi\appsettings.json to point your database
### Install
Install this project with:
1. Build the solution and assure that doesn't have errors
2. Set the project TT.MinApi as default
### Usage
To run the project,
Start the application (F5), the /swagger/index.html page is displayed
π€ **Elio CortΓ©s**
- GitHub: [@NeckerFree](https://github.com/NeckerFree)
- Twitter: [@ElioCortesM](https://twitter.com/ElioCortesM)
- LinkedIn: [elionelsoncortes](https://www.linkedin.com/in/elionelsoncortes/)
Contributions, issues, and feature requests are welcome!
Feel free to check the [issues page](../../issues/).
If you like this project please start my project
- **What command are required to Scaffold from Scratch a DB First?**
- Run next commands:
```
dotnet add TT.DataAccess package Microsoft.EntityFrameworkCore.Design
dotnet add TT.DataAccess package Microsoft.EntityFrameworkCore.SqlServer
dotnet add TT.DataAccess package Microsoft.EntityFrameworkCore.Tools
dotnet tool update --global dotnet-ef
dotnet ef dbcontext scaffold "Data Source=localhost\ELIO_SQL;Initial Catalog=[your DB]; User Id=[your User];Password=[your Pwd];Encrypt=False" Microsoft.EntityFrameworkCore.SqlServer --project TT.DataAccess --output-dir "TT.Models\Models" --context-dir "TT.DataAccess\Data" --namespace TT.Models --context-namespace TT.DataAccess --context GamesContext -f --no-onconfiguring --data-annotations
dotnet tool install --global dotnet-ef
dotnet tool update --global dotnet-ef
```
- **How to Implement Unit Of Work and Generic Repository pattern?**
- [Unit Of Work And Generic Repository pattern](https://www.c-sharpcorner.com/article/implement-unit-of-work-and-generic-repository-pattern-in-a-web-api-net-core-pro)
- [Repository Pattern and Unit of Work](https://enlear.academy/repository-pattern-and-unit-of-work-with-asp-net-core-web-api-6802e1aa4f78)
This project is [MIT](./LICENSE) licensed.
[MIT license](https://choosealicense.com/licenses/mit/)