1 Star 0 Fork 0

诺墨/Next.js 集成 Gitee OAuth 登录

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
MIT

Next.js 集成 Gitee OAuth 示例

GitHub License GitHub top language

这是一个使用 Next.js 15 和 Gitee OAuth 构建的应用示例,展示了如何集成 Gitee 账号登录功能。

授权登录页

点此体验在线 Demo

特性

  • ⚡️ Next.js 15 框架,使用 Turbopack 提供极速开发体验
  • 🔐 集成 Gitee OAuth 登录
  • 🎨 基于 shadcn/ui 构建的现代 UI
  • 🌓 支持亮色/暗色主题,可跟随系统设置
  • 📱 完全响应式设计
  • 🚀 使用 pnpm 作为包管理器

快速开始

环境要求

  • Node.js >= 18.17.0
  • pnpm >= 8.0.0

安装

# 克隆项目
git clone https://gitee.com/normalcoder/nextjs-gitee-oauth.git
cd nextjs-gitee-oauth

# 安装依赖
pnpm install

开发

  1. 复制环境变量文件:

    cp .env.example .env.local
    
  2. .env.local 中配置你的 Gitee OAuth 应用信息:

    # Gitee OAuth 配置
    NEXT_PUBLIC_GITEE_CLIENT_ID=你的客户端 ID
    GITEE_CLIENT_SECRET=你的客户端密钥
    NEXT_PUBLIC_GITEE_REDIRECT_URI=http://localhost:3000/api/auth/callback/gitee 
    
  3. 启动开发服务器:

    pnpm dev
    

现在你可以访问 http://localhost:3000 查看应用。

构建

# 生产环境构建
pnpm build

# 启动生产服务器
pnpm start

项目结构

.
├── app/            # Next.js 应用目录
│   ├── api/        # API 路由
│   ├── dashboard/  # 用户仪表盘页面
│   └── page.tsx    # 首页
├── components/     # React 组件
├── lib/            # 工具函数
└── public/         # 静态资源

开源许可

本项目基于 MIT 发布

MIT License Copyright (c) 2025 诺墨 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

使用 Next.js 15 和 Gitee OAuth 构建的应用示例,展示了如何集成 Gitee 账号登录功能。 expand collapse
Cancel

Releases

No release

Contributors (1)

All

Activities

can not load any more
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/normalcoder/nextjs-gitee-oauth.git
git@gitee.com:normalcoder/nextjs-gitee-oauth.git
normalcoder
nextjs-gitee-oauth
Next.js 集成 Gitee OAuth 登录
main

Search