Hans-Renolution Documentation

website·Indexed 30 days ago

https://hansrevolution.dev/

A personal knowledge base and technical blog covering a variety of development topics, including Docusaurus customization, .Net 7 Webapi JWT implementation, Docker containerization, and SQL Server 2019 Linux container images.

Tokens
6.6K
Snippets
38
Records
51
Agent score
49%

What's inside Hans-Renolution

  1. Hans Revolution Technical Skill Set

    Hans Revolution is a developer with extensive experience in .NET ecosystems, mobile development, and system architecture. Key technical competencies include:

    • Languages: C#, JavaScript, Java, Swift, TSQL
    • Web Technologies: .NET, .NET Core, Reactjs, Vuejs, jQuery, Ajax, Bootstrap, KendoUI, Swagger, Dapper, RestSharp
    • Mobile Technologies: iOS (Swift), Android (Java), Alamofire, CocoaPods, Carthage, FCM, Butterknife, RxSwift, Firebase Cloud Message
    • Databases: MSSQL, MySQL
    • DevOps & Tools: Docker (Dockerfile, Docker Desktop), Visual Studio (2017-2022), VS Code, Android Studio, Xcode
    • Architecture & Methodology: Agile (Scrum), Object-Oriented Programming (OOP), MVC, .NET WebApi, .NET WCF, JWT Authentication, API Architecture Design, Seq Log centralized platform, DDD Microservices decomposition
  2. Modernize Legacy .NET Architectures to .NET 8 and Containers

    When migrating legacy WebServices, .ashx, or WebForms to a modern architecture, transition to .NET 8 WebAPI or MVC. Implement containerization using Docker to standardize environments and improve deployment scalability. Use Dapper for high-performance data access to replace heavy ORMs or legacy data layers.
    # Example: Containerizing the .NET 8 application
    docker build -t business-app:latest .
    docker run -d -p 80:80 business-app:latest
  3. Professional Experience and Project History of Hans Revolution

    Hans Revolution has served as an Architecture Project Assistant at Shin Kong Life Insurance (Digital Information Department) since December 2013.

    Core Responsibilities:

    • System architecture refactoring, code refactoring, and SQL performance optimization.
    • Technical support for teams regarding code structure and best practices.
    • Designing cross-system log architectures using Seq Log Server and LineNotify.
    • Defining API design guidelines (White Paper) and researching APIM platforms to modernize legacy SOAP/WebService services.
    • Implementing containerization and CI/CD automated deployment.

    Key Project Highlights:

    • Agent Website Redesign (2014): Migrated legacy Asp to .NET MVC with RWD using Entity Framework and Bootstrap.
    • Partner Relationship Management System (2016): Migrated Asp.net WebForm to .NET MVC; handled BA/SA/AP roles and produced URS/SRS documentation.
    • Digital Navigator App (2017): Developed a dual-platform (iOS/Android) app using .NET C#, WCF, and Swagger. Implemented Basic Access Authentication, JWT, and IIS ARR WebFarm for load balancing.
    • E-Survey App (2021): Developed backend services using a role-based modular design to handle diverse form fields.
    • Policy Health Check Project (2022): Served as Scrum Master; integrated OCR technology to improve product filing speed and optimized policy data retrieval.
  4. Create and organize blog posts in Docusaurus

    Docusaurus blogging features are powered by the @docusaurus/plugin-content-blog plugin. To create a blog post, add Markdown files or folders to the blog directory.

    Post dates are automatically extracted from filenames using the format YYYY-MM-DD-title.md (e.g., 2019-05-30-welcome.md). Alternatively, you can use a folder with an index.md file (e.g., 2019-05-30-welcome/index.md), which is useful for co-locating images with the post content. The blog also supports tags and a centralized authors.yml file for managing blog authors.

  5. Limit blog post length in list views using truncate comments

    To limit the amount of content displayed for a blog post in a list view, insert the <!-- truncate --> HTML comment at the point where the content should be cut off.
    This text will appear in the list view.
    <!-- truncate -->
    This text will only appear on the full post page.
  6. Create and organize blog posts in Docusaurus

    Docusaurus blogging features are powered by the @docusaurus/plugin-content-blog plugin. To create blog posts, add Markdown files or folders to the blog directory. Post dates are automatically extracted from filenames using the format YYYY-MM-DD-title.md (e.g., 2019-05-30-welcome.md). For posts requiring co-located assets like images, use a folder structure with an index.md file (e.g., 2019-05-30-welcome/index.md).
  7. Implement JWT validation middleware

    Create a JwtMiddleware to intercept every request. It extracts the Bearer token from the Authorization header, validates it using IJwtUtils, and attaches the corresponding user object to the HttpContext.Items collection if valid.
    public class JwtMiddleware
    {
        private readonly RequestDelegate _next;
    
        public JwtMiddleware(RequestDelegate next) => _next = next;
    
        public async Task Invoke(HttpContext context, IUserService userService, IJwtUtils jwtUtils)
        {
            var token = context.Request.Headers["Authorization"].FirstOrDefault()?.Split(" ").Last();
            var userId = jwtUtils.ValidateJwtToken(token);
            if (userId != null)
            {
                // attach user to context on successful jwt validation
                context.Items["User"] = userService.GetById(userId.Value);
            }
            await _next(context);
        }
    }
  8. Create and organize blog posts in Docusaurus

    Docusaurus blogging features are powered by the @docusaurus/plugin-content-blog plugin. To create blog posts, add Markdown files or folders to the blog directory.

    Post dates are automatically extracted from filenames using the format YYYY-MM-DD-title.md (e.g., 2019-05-30-welcome.md) or by placing an index.md inside a folder named with the date (e.g., 2019-05-30-welcome/index.md). Using a folder for each post is recommended for co-locating post-specific images.

  9. Set up a custom domain in GitHub Pages settings

    After configuring DNS records, link the domain to your site by navigating to the GitHub Repository's 'Settings' tab, selecting 'Pages' from the sidebar, and entering your purchased domain name in the 'Custom domain' field.
  10. Best practices for JWT implementation in .NET WebAPI

    When implementing JWT authentication, follow these security and architectural guidelines:

    1. Secret Keys: Use a randomly generated string (e.g., via a GUID generator) for the JWT Secret Key.
    2. Access Control: Implement Role-Based Access Control (RBAC) to manage specific permissions rather than granting the same access to all authenticated users.
    3. Payload Security: Do not store sensitive data in the JWT Payload, as it can be easily decoded.
    4. Additional Encryption: Consider adding an extra layer of encryption to the generated JWT Token to prevent the payload from being tampered with or analyzed.
  11. Set up a custom domain with GitHub Pages and Docusaurus

    To use a custom domain (e.g., from Google Domains) with GitHub Pages for a Docusaurus site:

    1. DNS Configuration: In your domain provider's DNS settings, add A records pointing to GitHub Pages.
    2. GitHub Pages Setting: In the GitHub Repository Settings > Pages, enter your custom domain in the 'Custom domain' field.
    3. Prevent Domain Reset: Manually create a CNAME file containing your domain name inside the static folder of your Docusaurus project. This ensures the custom domain persists after new builds are deployed.
  12. Implement API Authentication using JWT and Swagger in .NET

    For secure API development in .NET (C#), integrate JSON Web Tokens (JWT) for identity verification and authorization. Use Swagger to automatically generate API documentation to facilitate frontend integration and developer hand-off. This pattern has been successfully applied across multiple CRM and internal business applications to enhance security and maintainability.
    // Conceptual implementation pattern used in projects:
    // 1. Use JWT for API identity verification
    // 2. Integrate Swagger for auto-generated documentation
    // 3. Use Dapper ORM for efficient data access