netcore-blueprint 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/BlueprintTemplate/Host.API/Extensions/ApplicationBuilderExtensions.cs +26 -0
  2. package/BlueprintTemplate/Host.API/Extensions/DatabaseExtensions.cs +37 -0
  3. package/BlueprintTemplate/Host.API/Extensions/ServiceCollectionExtensions.cs +54 -0
  4. package/BlueprintTemplate/Host.API/Extensions/ThirdPartyExtensions.cs +30 -0
  5. package/BlueprintTemplate/Host.API/Host.API.csproj +29 -0
  6. package/BlueprintTemplate/Host.API/Host.API.csproj.user +6 -0
  7. package/BlueprintTemplate/Host.API/Host.API.http +6 -0
  8. package/BlueprintTemplate/Host.API/Program.cs +25 -0
  9. package/BlueprintTemplate/Host.API/Properties/launchSettings.json +23 -0
  10. package/BlueprintTemplate/Host.API/appsettings.Development.json +8 -0
  11. package/BlueprintTemplate/Host.API/appsettings.json +15 -0
  12. package/BlueprintTemplate/ItemModule.API/Controllers/Public/ItemController.cs +65 -0
  13. package/BlueprintTemplate/ItemModule.API/ItemModule.API.csproj +26 -0
  14. package/BlueprintTemplate/ItemModule.API/Mappers/DtoItemMappingProfile.cs +26 -0
  15. package/BlueprintTemplate/ItemModule.Core/Dtos/Admin/ItemRequestDto.cs +8 -0
  16. package/BlueprintTemplate/ItemModule.Core/Dtos/Admin/ItemResponseDto.cs +8 -0
  17. package/BlueprintTemplate/ItemModule.Core/Entities/Item.cs +8 -0
  18. package/BlueprintTemplate/ItemModule.Core/Interfaces/API/IItemService.cs +9 -0
  19. package/BlueprintTemplate/ItemModule.Core/Interfaces/SPI/IItemInfra.cs +9 -0
  20. package/BlueprintTemplate/ItemModule.Core/ItemModule.Core.csproj +18 -0
  21. package/BlueprintTemplate/ItemModule.Core/Services/ItemService.cs +20 -0
  22. package/BlueprintTemplate/ItemModule.Infrastructure/Database/ItemConfiguration.cs +22 -0
  23. package/BlueprintTemplate/ItemModule.Infrastructure/Database/Seeder.cs +21 -0
  24. package/BlueprintTemplate/ItemModule.Infrastructure/ItemDependencyInjection.cs +27 -0
  25. package/BlueprintTemplate/ItemModule.Infrastructure/ItemModule.Infrastructure.csproj +14 -0
  26. package/BlueprintTemplate/ItemModule.Infrastructure/Services/MySQLItemInfra.cs +16 -0
  27. package/BlueprintTemplate/MyBlueprint.slnx +23 -0
  28. package/BlueprintTemplate/README.md +22 -0
  29. package/BlueprintTemplate/Shared.Core/Dtos/Requests/BaseRequestDto.cs +27 -0
  30. package/BlueprintTemplate/Shared.Core/Dtos/Responses/BaseResponseDto.cs +27 -0
  31. package/BlueprintTemplate/Shared.Core/Entities/BaseEntity.cs +15 -0
  32. package/BlueprintTemplate/Shared.Core/Enums/EntityStatus.cs +9 -0
  33. package/BlueprintTemplate/Shared.Core/Exceptions/Errors.cs +20 -0
  34. package/BlueprintTemplate/Shared.Core/Interfaces/API/IItemService.cs +14 -0
  35. package/BlueprintTemplate/Shared.Core/Interfaces/SPI/IItemInfra.cs +14 -0
  36. package/BlueprintTemplate/Shared.Core/Interfaces/SPI/IModuleSeeder.cs +9 -0
  37. package/BlueprintTemplate/Shared.Core/Interfaces/SPI/IRepositoryFactory.cs +7 -0
  38. package/BlueprintTemplate/Shared.Core/Models/Error.cs +69 -0
  39. package/BlueprintTemplate/Shared.Core/Models/ErrorDetail.cs +8 -0
  40. package/BlueprintTemplate/Shared.Core/Models/PagerData.cs +8 -0
  41. package/BlueprintTemplate/Shared.Core/Models/PagingParams.cs +8 -0
  42. package/BlueprintTemplate/Shared.Core/Services/ItemService.cs +53 -0
  43. package/BlueprintTemplate/Shared.Core/Shared.Core.csproj +13 -0
  44. package/BlueprintTemplate/Shared.Infrastructure/DbInitializer.cs +18 -0
  45. package/BlueprintTemplate/Shared.Infrastructure/Migrations/20260131121133_SeedInitialData.Designer.cs +123 -0
  46. package/BlueprintTemplate/Shared.Infrastructure/Migrations/20260131121133_SeedInitialData.cs +82 -0
  47. package/BlueprintTemplate/Shared.Infrastructure/Migrations/MyDbContextModelSnapshot.cs +120 -0
  48. package/BlueprintTemplate/Shared.Infrastructure/MyDbContext.cs +24 -0
  49. package/BlueprintTemplate/Shared.Infrastructure/Services/Mongo/MongoItemInfra.cs +117 -0
  50. package/BlueprintTemplate/Shared.Infrastructure/Services/MySQL/MySQLItemInfra.cs +132 -0
  51. package/BlueprintTemplate/Shared.Infrastructure/Services/RepositoryFactory.cs +36 -0
  52. package/BlueprintTemplate/Shared.Infrastructure/Shared.Infrastructure.csproj +28 -0
  53. package/BlueprintTemplate/Shared.Infrastructure/SharedDependencyInjection.cs +19 -0
  54. package/BlueprintTemplate/User.API/Controllers/Admin/UserController.cs +153 -0
  55. package/BlueprintTemplate/User.API/Mappers/DtoUserMappingProfile.cs +27 -0
  56. package/BlueprintTemplate/User.API/UserModule.API.csproj +26 -0
  57. package/BlueprintTemplate/User.Core/Dtos/Admin/UserRequestDto.cs +12 -0
  58. package/BlueprintTemplate/User.Core/Dtos/Admin/UserResponseDto.cs +12 -0
  59. package/BlueprintTemplate/User.Core/Entities/User.cs +13 -0
  60. package/BlueprintTemplate/User.Core/Enums/UserRole.cs +8 -0
  61. package/BlueprintTemplate/User.Core/Interfaces/API/IUserService.cs +9 -0
  62. package/BlueprintTemplate/User.Core/Interfaces/SPI/IUserInfra.cs +9 -0
  63. package/BlueprintTemplate/User.Core/Services/UserService.cs +20 -0
  64. package/BlueprintTemplate/User.Core/UserModule.Core.csproj +17 -0
  65. package/BlueprintTemplate/User.Infrastructure/Database/ItemConfiguration.cs +27 -0
  66. package/BlueprintTemplate/User.Infrastructure/Database/Seeder.cs +44 -0
  67. package/BlueprintTemplate/User.Infrastructure/Services/MySQLUserInfra.cs +16 -0
  68. package/BlueprintTemplate/User.Infrastructure/UserDependencyInjection.cs +22 -0
  69. package/BlueprintTemplate/User.Infrastructure/UserModule.Infrastructure.csproj +14 -0
  70. package/README.md +7 -18
  71. package/package.json +2 -2
@@ -0,0 +1,44 @@
1
+ using Microsoft.EntityFrameworkCore;
2
+ using Shared.Core.Enums;
3
+ using Shared.Core.Interfaces.SPI;
4
+ using UserModule.Core.Entities;
5
+ using UserModule.Core.Enums;
6
+
7
+ namespace UserModule.Infrastructure.Database
8
+ {
9
+ public class Seeder : IModuleSeeder
10
+ {
11
+ public void Seed(ModelBuilder modelBuilder)
12
+ {
13
+ modelBuilder.Entity<User>().HasData(
14
+ new User
15
+ {
16
+ Id = Guid.Parse("11111111-1111-1111-1111-111111111111"),
17
+ Name = "Test",
18
+ Email = "",
19
+ Picture = null,
20
+ Role = UserRole.Admin,
21
+ Status = EntityStatus.Active,
22
+ },
23
+ new User
24
+ {
25
+ Id = Guid.Parse("22222222-2222-2222-2222-222222222222"),
26
+ Name = "Truong Dang",
27
+ Email = "truongdxfx08031@funix.edu.vn",
28
+ Picture = null,
29
+ Role = UserRole.User,
30
+ Status = EntityStatus.Active,
31
+ },
32
+ new User
33
+ {
34
+ Id = Guid.Parse("33333333-3333-3333-3333-333333333333"),
35
+ Name = "Thai Son",
36
+ Email = "truonghusk17aws1@gmail.com",
37
+ Picture = null,
38
+ Role = UserRole.User,
39
+ Status = EntityStatus.Active,
40
+ }
41
+ );
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,16 @@
1
+ using Microsoft.Extensions.Logging;
2
+ using Shared.Infrastructure;
3
+ using Shared.Infrastructure.Services.MySQL;
4
+ using UserModule.Core.Entities;
5
+ using UserModule.Core.Interfaces.SPI;
6
+
7
+ namespace UserModule.Infrastructure.Services
8
+ {
9
+ public class MySQLUserInfra : MySQLItemInfra<User>, IUserInfra
10
+ {
11
+ public MySQLUserInfra(MyDbContext dbContext, ILogger<MySQLUserInfra> logger)
12
+ : base(dbContext, logger)
13
+ {
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,22 @@
1
+ using Microsoft.Extensions.DependencyInjection;
2
+ using Shared.Core.Interfaces.SPI;
3
+ using UserModule.Core.Interfaces.API;
4
+ using UserModule.Core.Interfaces.SPI;
5
+ using UserModule.Core.Services;
6
+ using UserModule.Infrastructure.Database;
7
+ using UserModule.Infrastructure.Services;
8
+
9
+ namespace UserModule.Infrastructure
10
+ {
11
+ public static class UserDependencyInjection
12
+ {
13
+ public static IServiceCollection AddUserModuleInfra(
14
+ this IServiceCollection services)
15
+ {
16
+ services.AddScoped<IModuleSeeder, Seeder>();
17
+ services.AddScoped<IUserInfra, MySQLUserInfra>();
18
+ services.AddScoped<IUserService, UserService>();
19
+ return services;
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,14 @@
1
+ <Project Sdk="Microsoft.NET.Sdk">
2
+
3
+ <ItemGroup>
4
+ <ProjectReference Include="..\User.Core\UserModule.Core.csproj" />
5
+ <ProjectReference Include="..\Shared.Infrastructure\Shared.Infrastructure.csproj" />
6
+ </ItemGroup>
7
+
8
+ <PropertyGroup>
9
+ <TargetFramework>net10.0</TargetFramework>
10
+ <ImplicitUsings>enable</ImplicitUsings>
11
+ <Nullable>enable</Nullable>
12
+ </PropertyGroup>
13
+
14
+ </Project>
package/README.md CHANGED
@@ -1,18 +1,7 @@
1
- How to make a blueprint (Ex: python-blueprint)
2
- 1. Change the name of the blueprint project in package.json file:
3
- Ex: "name": "python-blueprint",
4
- 2. Copy the template into netcore-blueprintTemplate. The template include:
5
- - Basic files
6
- - Add git
7
- - Add gitignore file and change it from .gitignore=> gitignore file
8
- 3. Add git to the blueprint, and change the root branch from master to main
9
- - git branch -m master main
10
- 4. Create new repo in git
11
- - Add environment variables into the git repo: Project > Settings > CI/CD > Variables
12
- + NPM_TOKEN: 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
13
- + PACKAGE_NAME: python-blueprint
14
- - push the blueprint to main branch
15
- 5. Use the lib from npm:
16
- - npm install -g python-blueprint
17
- - npm list -g python-blueprint
18
- - python-blueprint thmoney
1
+ How to make a blueprint
2
+
3
+ 1. Use the lib from npm:
4
+ - npm uninstall -g netcore-blueprint
5
+ - npm install -g netcore-blueprint
6
+ - npm list -g netcore-blueprint
7
+ - init-blueprint test
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "netcore-blueprint",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "A custom project blueprint",
5
5
  "main": "create.js",
6
6
  "bin": {
@@ -16,6 +16,6 @@
16
16
  "author": "",
17
17
  "license": "ISC",
18
18
  "files": [
19
- "netcore-blueprintTemplate/**"
19
+ "BlueprintTemplate/**"
20
20
  ]
21
21
  }