authentication mindmap by plantuml

@startmindmap * Authentication ** basic ** digest ** oauth *** Authorization Code Grant *** Implicit Grant *** Client Credentials Grant *** Resource Owner Password Grant *** Device Authorization Grant ** bearer *** JWT **** Header **** Payload **** Signature @endmindmap →Read more

Helm tutorial 2

I have a Go project that built as a Docker container, let me use a Helm chart to deploy it into the current Kubernetes namespace: Step 1: Create a Helm Chart Run the following command to generate a Helm chart structure: helm create my-go-app This will create a directory named my-go-app with the default Helm […] →Read more

Modern web app by next.js

构建现代应用程序时,需要考虑一些事项。例如: 用户界面——用户如何使用和与您的应用程序交互。 路由——用户如何在应用程序的不同部分之间导航。 数据获取——您的数据存储在何处以及如何获取数据。 渲染——何时何地渲染静态或动态内容。 集成- 您使用哪些第三方服务(用于 CMS、身份验证、付款等)以及如何连接它们。 基础设施——您部署、存储和运行应用程序代码的地方(无服务器、CDN、边缘等)。 性能——如何为最终用户优化您的应用程序。 可扩展性——您的应用程序如何随着您的团队、数据和流量的增长而适应。 开发人员经验- 您的团队构建和维护应用程序的经验。 对于应用程序的每个部分,您需要决定是否自己构建解决方案或使用其他工具(例如包、库和框架)。 Reference https://nextjs.org/learn/react-foundations/rendering-ui →Read more

一图胜千言

Spring MVC Spring Security MyBatis Plus →Read more

Helm tutorial 1

Helm 是 Kubernetes 的包管理工具,旨在简化应用程序在 Kubernetes 集群中的部署和管理。 citeturn0search3 它通过将应用程序的 Kubernetes 资源定义打包成称为 Chart 的格式,提供了自动化的应用分发方式。 核心概念: Chart:Helm 包的基本单位,包含了在 Kubernetes 集群中运行应用程序所需的所有资源定义。 Repository(仓库):存放和共享 Charts 的地方,类似于 Perl 的 CPAN 或 Fedora 的软件包仓库。 Release:在 Kubernetes 集群中运行的 Chart 的一个实例。一个 Chart 可以在同一个集群中安装多次,每次安装都会创建一个新的 Release。 使用 Helm 的基本步骤: 安装 Helm:首先,需要在本地环境中安装 Helm 客户端。可以通过多种方式安装,例如使用包管理工具或从 GitHub 发布页面下载。 添加 Chart 仓库:安装完成后,可以添加 Chart 仓库。例如,添加 Bitnami 仓库: helm repo add bitnami https://charts.bitnami.com/bitnami […] →Read more

Kubernetes Secret

A Kubernetes Secret is an API object used to store sensitive information (like passwords, tokens, keys, or certificates) separately from application code. This helps keep such data secure and manageable. Yes, you can mount a Secret as a volume in a pod. When mounted as a volume, each key in the Secret becomes a file […] →Read more

Poetry 的用法

Poetry 是一个现代化的 Python 项目管理工具,旨在简化依赖管理、虚拟环境管理、打包以及发布流程。下面详细介绍其主要特点和使用方法: 1. 主要功能 依赖管理 Poetry 允许你在项目的配置文件 pyproject.toml 中声明项目依赖,并自动解决依赖冲突。它会生成一个 poetry.lock 文件,锁定所有依赖的具体版本,从而保证在不同机器上安装时环境一致,避免“在我机器上可用”的问题。 citeturn0search0 虚拟环境管理 Poetry 内置了虚拟环境管理功能,它会自动为每个项目创建并使用独立的虚拟环境,让项目之间的依赖互不干扰。你可以使用 poetry shell 进入该虚拟环境,或者使用 poetry run <command> 在环境中执行命令。 citeturn0search0 项目打包与发布 除了依赖管理外,Poetry 还能构建项目(生成 sdist 与 wheel 文件)并通过命令行将包发布到 PyPI 或其他私有仓库。 citeturn0search1 依赖组管理 你可以将依赖分组,例如将开发、测试、文档等依赖分别归类,安装时可灵活选择只安装部分组的依赖,避免不必要的包被安装到生产环境中。 2. 安装方式 推荐使用 pipx 来安装 Poetry,因为它会在独立的虚拟环境中安装 Poetry,从而避免与项目环境产生冲突。安装命令如下: pipx install poetry 也可以使用官方安装脚本: curl -sSL https://install.python-poetry.org | python3 – 安装完成后,请确保将 […] →Read more

Tailwind CSS framework

Tailwind CSS framework Tailwind CSS 框架介绍 Tailwind CSS 是一个功能类(utility-first)的 CSS 框架,它提供了大量的低级实用类,让开发者可以直接在 HTML 代码中编写样式,而无需创建自定义的 CSS 规则。它的设计理念是通过组合这些小型的样式类来快速构建 UI,而不是像传统 CSS 那样依赖预定义的组件或全局样式。 Tailwind CSS 的特点 功能类优先:使用原子类(如 p-4、text-center、bg-blue-500)快速构建 UI。 高度可定制:可以通过 tailwind.config.js 进行配置,调整颜色、字体、间距等。 无需额外 CSS 文件:所有样式直接在 HTML 文件中定义,减少了 CSS 代码量。 响应式设计:内置 sm、md、lg、xl 等断点类,方便适配不同设备。 Dark Mode 支持:可以轻松实现暗黑模式。 安装 Tailwind CSS 可以通过 npm 安装 Tailwind CSS: npm install -D tailwindcss postcss autoprefixer npx […] →Read more

best practice of go backend service 2

Writing a backend service in Go efficiently involves following best practices for code structure, maintainability, and performance. Below is a simple and well-structured example of a RESTful backend service in Go with best practices applied. Best Practices for Writing a Backend Service in Go 1. Project Structure Organizing your code properly improves maintainability and scalability. […] →Read more

best practice of go backend service 1

best practice 1. Project Structure Organize your project in a logical and consistent way. A common structure for a Go backend service is: /my-service ├── /cmd │ └── /my-service │ └── main.go ├── /internal │ ├── /handlers │ ├── /models │ ├── /services │ └── /repositories ├── /pkg │ └── /utils ├── /configs ├── /migrations […] →Read more