diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..6287fe9
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,34 @@
+image: mcr.microsoft.com/dotnet/sdk:8.0
+
+stages:
+ - build
+ - test
+ - publish
+
+before_script:
+ - echo "Setting up environment"
+ - 'dotnet --version'
+
+build:
+ stage: build
+ script:
+ - dotnet restore
+ - dotnet build --configuration Release --no-restore
+ artifacts:
+ paths:
+ - "**/bin/Release"
+
+test:
+ stage: test
+ script:
+ - dotnet test --no-restore --verbosity normal
+
+publish:
+ stage: publish
+ script:
+ - dotnet pack -c Release -o .
+ - for nupkg in *.nupkg; do dotnet nuget push $nupkg -k $NUGET_API_KEY -s https://api.nuget.org/v3/index.json; done
+ only:
+ - main
+ variables:
+ NUGET_API_KEY: $NUGET_API_KEY
diff --git a/README.md b/README.md
index 26ad808..4d53003 100644
--- a/README.md
+++ b/README.md
@@ -5,21 +5,15 @@ A simple backend management api for ASP.NET Core Web APIs
- [x] Database management
- [x] User authentication
- [x] Permission management
-- [x] Frontend dashboards
-
-## 2.0 Todo list
-- [x] 1.0 bug fixes
-- [x] Code cleanup
-- [x] Relations in database
-- [x] Generated Admin pages
-- [x] Pretty Login page for administration
-- [ ] Clean documentation
+- [x] Generated frontend administration boards
# Usage
There are two different versions of HopFrame, either the Web API version or the full Blazor web version.
## Ho to use the Web API version
+> **Hint:** For more information about the HopFrame installation and usage go to the [docs](./docs).
+
1. Add the HopFrame.Api library to your project:
```
diff --git a/src/HopFrame.Api/HopFrame.Api.csproj b/src/HopFrame.Api/HopFrame.Api.csproj
index 614e37a..744a466 100644
--- a/src/HopFrame.Api/HopFrame.Api.csproj
+++ b/src/HopFrame.Api/HopFrame.Api.csproj
@@ -7,7 +7,7 @@
disableHopFrame.Api
- 1.1.0
+ 2.0.0README.mdMITtrue
diff --git a/src/HopFrame.Api/README.md b/src/HopFrame.Api/README.md
index 67b946b..94966e4 100644
--- a/src/HopFrame.Api/README.md
+++ b/src/HopFrame.Api/README.md
@@ -1,100 +1,4 @@
# HopFrame API module
This module contains some useful endpoints for user login / register management.
-## Ho to use the Web API version
-
-1. Add the HopFrame.Api library to your project:
-
- ```
- dotnet add package HopFrame.Api
- ```
-
-2. Create a DbContext that inherits the ``HopDbContext`` and add a data source
-
- ```csharp
- public class DatabaseContext : HopDbContextBase {
- protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
- base.OnConfiguring(optionsBuilder);
-
- optionsBuilder.UseSqlite("...");
- }
- }
- ```
-
-3. Add the DbContext and HopFrame to your services
-
- ```csharp
- builder.Services.AddDbContext();
- builder.Services.AddHopFrame();
- ```
-
-# Endpoints
-By default, the module provides a controller for handling authentication based requests by the user.
-You can explore the contoller by the build in swagger site from ASP .NET.
-
-## Disable the Endpoints
-
-```csharp
-builder.Services.AddDbContext();
-//builder.Services.AddHopFrame();
-services.AddHopFrameNoEndpoints();
-```
-
-# Services added in this module
-You can use these services by specifying them as a dependency. All of them are scoped dependencies.
-
-## LogicResult
-Logic result is an extension of the ActionResult for an ApiController. It provides simple Http status results with either a message or data by specifying the generic type.
-
-```csharp
-public class LogicResult : ILogicResult {
- public static LogicResult Ok();
-
- public static LogicResult BadRequest();
-
- public static LogicResult BadRequest(string message);
-
- public static LogicResult Forbidden();
-
- public static LogicResult Forbidden(string message);
-
- public static LogicResult NotFound();
-
- public static LogicResult NotFound(string message);
-
- public static LogicResult Conflict();
-
- public static LogicResult Conflict(string message);
-
- public static LogicResult Forward(LogicResult result);
-
- public static LogicResult Forward(ILogicResult result);
-
- public static implicit operator ActionResult(LogicResult v);
-}
-
-public class LogicResult : ILogicResult {
- public static LogicResult Ok();
-
- public static LogicResult Ok(T result);
-
- ...
-}
-```
-
-## IAuthLogic
-This service handles all logic needed to provide the authentication endpoints by using the LogicResults.
-
-```csharp
-public interface IAuthLogic {
- Task>> Login(UserLogin login);
-
- Task>> Register(UserRegister register);
-
- Task>> Authenticate();
-
- Task Logout();
-
- Task Delete(UserPasswordValidation validation);
-}
-```
\ No newline at end of file
+For more information about the HopFrame visit the [docs](https://git.leon-hoppe.de/leon.hoppe/HopFrame).
\ No newline at end of file
diff --git a/src/HopFrame.Database/HopFrame.Database.csproj b/src/HopFrame.Database/HopFrame.Database.csproj
index f2bcba7..de55cd5 100644
--- a/src/HopFrame.Database/HopFrame.Database.csproj
+++ b/src/HopFrame.Database/HopFrame.Database.csproj
@@ -7,7 +7,7 @@
disableHopFrame.Database
- 1.1.0
+ 2.0.0README.mdMITtrue
diff --git a/src/HopFrame.Database/README.md b/src/HopFrame.Database/README.md
index 0aacfa2..25d0bda 100644
--- a/src/HopFrame.Database/README.md
+++ b/src/HopFrame.Database/README.md
@@ -1,2 +1,4 @@
# HopFrame Database module
-This module contains all the logic for the database communication
+This module contains all the logic for the database communication.
+
+For more information about the HopFrame visit the [docs](https://git.leon-hoppe.de/leon.hoppe/HopFrame).
diff --git a/src/HopFrame.Security/HopFrame.Security.csproj b/src/HopFrame.Security/HopFrame.Security.csproj
index b8a814b..74c1d50 100644
--- a/src/HopFrame.Security/HopFrame.Security.csproj
+++ b/src/HopFrame.Security/HopFrame.Security.csproj
@@ -8,7 +8,7 @@
HopFrame.SecurityHopFrame.Security
- 1.1.0
+ 2.0.0README.mdMITtrue
diff --git a/src/HopFrame.Security/README.md b/src/HopFrame.Security/README.md
index cc4b5d0..9dfdbb4 100644
--- a/src/HopFrame.Security/README.md
+++ b/src/HopFrame.Security/README.md
@@ -1,74 +1,4 @@
# HopFrame Security module
this module contains all handlers for the login and register validation. It also checks the user permissions.
-# Services added in this module
-You can use these services by specifying them as a dependency. All of them are scoped dependencies.
-
-## ITokenContext
-This service provides the information given by the current request
-
-```csharp
-public interface ITokenContext {
- bool IsAuthenticated { get; }
-
- User User { get; }
-
- Guid AccessToken { get; }
-}
-```
-
-## IUserService
-This service simplifies the data access of the user table in the database.
-
-```csharp
-public interface IUserService {
- Task> GetUsers();
-
- Task GetUser(Guid userId);
-
- Task GetUserByEmail(string email);
-
- Task GetUserByUsername(string username);
-
- Task AddUser(UserRegister user);
-
- Task UpdateUser(User user);
-
- Task DeleteUser(User user);
-
- Task CheckUserPassword(User user, string password);
-
- Task ChangePassword(User user, string password);
-}
-```
-
-## IPermissionService
-This service handles all permission and group interactions with the data source.
-
-```csharp
-public interface IPermissionService {
- Task HasPermission(string permission, Guid user);
-
- Task> GetPermissionGroups();
-
- Task GetPermissionGroup(string name);
-
- Task EditPermissionGroup(PermissionGroup group);
-
- Task> GetUserPermissionGroups(User user);
-
- Task RemoveGroupFromUser(User user, PermissionGroup group);
-
- Task CreatePermissionGroup(string name, bool isDefault = false, string description = null);
-
- Task DeletePermissionGroup(PermissionGroup group);
-
- Task GetPermission(string name, IPermissionOwner owner);
-
- Task AddPermission(IPermissionOwner owner, string permission);
-
- Task RemovePermission(Permission permission);
-
- Task GetFullPermissions(string user);
-}
-```
+For more information about the HopFrame visit the [docs](https://git.leon-hoppe.de/leon.hoppe/HopFrame).
diff --git a/src/HopFrame.Web.Admin/Generators/IAdminPageGenerator.cs b/src/HopFrame.Web.Admin/Generators/IAdminPageGenerator.cs
index 30a6ef5..65998bd 100644
--- a/src/HopFrame.Web.Admin/Generators/IAdminPageGenerator.cs
+++ b/src/HopFrame.Web.Admin/Generators/IAdminPageGenerator.cs
@@ -78,11 +78,11 @@ public interface IAdminPageGenerator {
IAdminPageGenerator DefaultSort(Expression> propertyExpression, ListSortDirection direction);
///
- /// Specifies the repository for the page
+ /// Specifies the repository provider for the page
///
- /// The specified repository
+ /// The specified provider
///
- IAdminPageGenerator ConfigureRepository() where TRepository : ModelRepository;
+ IAdminPageGenerator ConfigureProvider() where TRepository : ModelProvider;
///
diff --git a/src/HopFrame.Web.Admin/Generators/Implementation/AdminPageGenerator.cs b/src/HopFrame.Web.Admin/Generators/Implementation/AdminPageGenerator.cs
index d2fb6ec..eb61f7d 100644
--- a/src/HopFrame.Web.Admin/Generators/Implementation/AdminPageGenerator.cs
+++ b/src/HopFrame.Web.Admin/Generators/Implementation/AdminPageGenerator.cs
@@ -91,7 +91,7 @@ internal sealed class AdminPageGenerator : IAdminPageGenerator,
return this;
}
- public IAdminPageGenerator ConfigureRepository() where TRepository : ModelRepository {
+ public IAdminPageGenerator ConfigureProvider() where TRepository : ModelProvider {
Page.RepositoryProvider = typeof(TRepository);
return this;
}
diff --git a/src/HopFrame.Web.Admin/HopFrame.Web.Admin.csproj b/src/HopFrame.Web.Admin/HopFrame.Web.Admin.csproj
index 096a35f..e1a0004 100644
--- a/src/HopFrame.Web.Admin/HopFrame.Web.Admin.csproj
+++ b/src/HopFrame.Web.Admin/HopFrame.Web.Admin.csproj
@@ -4,10 +4,20 @@
net8.0enabledisable
+
+ HopFrame.Web.Admin
+ 2.0.0
+ README.md
+ MIT
+ true
+
+
+
+
diff --git a/src/HopFrame.Web.Admin/ModelRepository.cs b/src/HopFrame.Web.Admin/ModelProvider.cs
similarity index 89%
rename from src/HopFrame.Web.Admin/ModelRepository.cs
rename to src/HopFrame.Web.Admin/ModelProvider.cs
index 45de247..7725bf5 100644
--- a/src/HopFrame.Web.Admin/ModelRepository.cs
+++ b/src/HopFrame.Web.Admin/ModelProvider.cs
@@ -1,6 +1,6 @@
namespace HopFrame.Web.Admin;
-public abstract class ModelRepository : IModelRepository {
+public abstract class ModelProvider : IModelProvider {
public abstract Task> ReadAll();
public abstract Task Create(TModel model);
public abstract Task Update(TModel model);
@@ -25,7 +25,7 @@ public abstract class ModelRepository : IModelRepository {
}
}
-public interface IModelRepository {
+public interface IModelProvider {
Task> ReadAllO();
Task