Skip to content

Feat/firebase#19

Merged
dasosann merged 8 commits intomainfrom
feat/firebase
Mar 27, 2026
Merged

Feat/firebase#19
dasosann merged 8 commits intomainfrom
feat/firebase

Conversation

@dasosann
Copy link
Copy Markdown
Contributor

@dasosann dasosann commented Feb 5, 2026

User description

firebase 섲럴


PR Type

Enhancement


Description

  • Firebase 설정 및 메시징 서비스 워커 추가

  • 이메일 로그인 페이지 및 로그인 폼 구현

  • 백버튼 컴포넌트 추가 및 BubbleDiv 재사용성 개선

  • 서버 액션 기반 로그인 로직 및 폼 상태 관리


Diagram Walkthrough

flowchart LR
  A["Firebase 설정<br/>firebase.ts"] --> B["메시징 서비스<br/>firebase-messaging-sw.js"]
  C["로그인 액션<br/>loginAction.ts"] --> D["로그인 폼<br/>LoginForm.tsx"]
  D --> E["로그인 페이지<br/>login/page.tsx"]
  F["BackButton<br/>컴포넌트"] --> E
  G["BubbleDiv<br/>재사용성 개선"] --> D
  H["Button 스타일<br/>업데이트"] --> D
Loading

File Walkthrough

Relevant files
Configuration changes
2 files
firebase.ts
Firebase 앱 초기화 및 분석 설정                                                                     
+21/-0   
tsconfig.json
Firebase 메시징 서비스 워커 타입 포함                                                               
+1/-1     
Enhancement
10 files
firebase-messaging-sw.js
백그라운드 푸시 알림 처리 서비스 워커                                                                       
+31/-0   
loginAction.ts
서버 액션 기반 로그인 검증 로직                                                                             
+31/-0   
page.tsx
이메일 로그인 페이지 메타데이터 및 레이아웃                                                                 
+14/-0   
ScreenLocalLoginPage.tsx
로그인 페이지 메인 컴포넌트 구조                                                                             
+16/-0   
LoginForm.tsx
useActionState 기반 로그인 폼 구현                                                             
+90/-0   
LocalLoginIntro.tsx
로그인 페이지 인트로 섹션 추가                                                                               
+17/-0   
BackButton.tsx
뒤로가기 버튼 컴포넌트 신규 추가                                                                             
+36/-0   
BubbleDiv.tsx
BubbleDiv 컴포넌트 재사용성 개선                                                                     
+25/-6   
LoginActionSection.tsx
이메일 로그인 링크로 변경 및 버튼 제거                                                                     
+4/-4     
Button.tsx
버튼 스타일 및 border-radius 업데이트                                                           
+1/-1     
Dependencies
2 files
package.json
Firebase 라이브러리 의존성 추가                                                                       
+1/-0     
pnpm-lock.yaml
Firebase 및 관련 패키지 락 파일 업데이트                                                           
+807/-0 


✨ Describe tool usage guide:

Overview:
The describe tool scans the PR code changes, and generates a description for the PR - title, type, summary, walkthrough and labels. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.

When commenting, to edit configurations related to the describe tool (pr_description section), use the following template:

/describe --pr_description.some_config1=... --pr_description.some_config2=...

With a configuration file, use the following template:

[pr_description]
some_config1=...
some_config2=...
Enabling\disabling automation
  • When you first install the app, the default mode for the describe tool is:
pr_commands = ["/describe", ...]

meaning the describe tool will run automatically on every PR.

  • Markers are an alternative way to control the generated description, to give maximal control to the user. If you set:
pr_commands = ["/describe --pr_description.use_description_markers=true", ...]

the tool will replace every marker of the form pr_agent:marker_name in the PR description with the relevant content, where marker_name is one of the following:

  • type: the PR type.
  • summary: the PR summary.
  • walkthrough: the PR walkthrough.
  • diagram: the PR sequence diagram (if enabled).

Note that when markers are enabled, if the original PR description does not contain any markers, the tool will not alter the description at all.

Custom labels

The default labels of the describe tool are quite generic: [Bug fix, Tests, Enhancement, Documentation, Other].

If you specify custom labels in the repo's labels page or via configuration file, you can get tailored labels for your use cases.
Examples for custom labels:

  • Main topic:performance - pr_agent:The main topic of this PR is performance
  • New endpoint - pr_agent:A new endpoint was added in this PR
  • SQL query - pr_agent:A new SQL query was added in this PR
  • Dockerfile changes - pr_agent:The PR contains changes in the Dockerfile
  • ...

The list above is eclectic, and aims to give an idea of different possibilities. Define custom labels that are relevant for your repo and use cases.
Note that Labels are not mutually exclusive, so you can add multiple label categories.
Make sure to provide proper title, and a detailed and well-phrased description for each label, so the tool will know when to suggest it.

Inline File Walkthrough 💎

For enhanced user experience, the describe tool can add file summaries directly to the "Files changed" tab in the PR page.
This will enable you to quickly understand the changes in each file, while reviewing the code changes (diffs).

To enable inline file summary, set pr_description.inline_file_summary in the configuration file, possible values are:

  • 'table': File changes walkthrough table will be displayed on the top of the "Files changed" tab, in addition to the "Conversation" tab.
  • true: A collapsable file comment with changes title and a changes summary for each file in the PR.
  • false (default): File changes walkthrough will be added only to the "Conversation" tab.
Utilizing extra instructions

The describe tool can be configured with extra instructions, to guide the model to a feedback tailored to the needs of your project.

Be specific, clear, and concise in the instructions. With extra instructions, you are the prompter. Notice that the general structure of the description is fixed, and cannot be changed. Extra instructions can change the content or style of each sub-section of the PR description.

Examples for extra instructions:

[pr_description]
extra_instructions="""- The PR title should be in the format: '<PR type>: <title>'
- The title should be short and concise (up to 10 words)
- ...
"""

Use triple quotes to write multi-line instructions. Use bullet points to make the instructions more readable.

More PR-Agent commands

To invoke the PR-Agent, add a comment using one of the following commands:

  • /review: Request a review of your Pull Request.
  • /describe: Update the PR title and description based on the contents of the PR.
  • /improve [--extended]: Suggest code improvements. Extended mode provides a higher quality feedback.
  • /ask <QUESTION>: Ask a question about the PR.
  • /update_changelog: Update the changelog based on the PR's contents.
  • /help_docs <QUESTION>: Given a path to documentation (either for this repository or for a given one), ask a question.
  • /add_docs 💎: Generate docstring for new components introduced in the PR.
  • /generate_labels 💎: Generate labels for the PR based on the PR's contents.
  • /analyze 💎: Automatically analyzes the PR, and presents changes walkthrough for each component.

See the tools guide for more details.
To list the possible configuration parameters, add a /config comment.

See the describe usage page for a comprehensive guide on using this tool.

@qodo-code-review qodo-code-review bot added the enhancement New feature or request label Feb 5, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @dasosann, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on expanding the application's core functionalities by integrating Firebase for analytics and messaging capabilities. Concurrently, it introduces a complete local email/password login system, providing users with an alternative authentication method. The changes also include refactoring and styling updates to key UI components, enhancing their flexibility and visual consistency across the application.

Highlights

  • Firebase Integration: Firebase SDK has been integrated into the project, including setup for analytics and a Firebase Messaging Service Worker to handle background notifications. This lays the groundwork for future Firebase-powered features.
  • Local Email/Password Login: A new local login flow has been implemented, allowing users to log in with their email and password. This includes new UI components for the login introduction, the login form itself, and a dedicated login page.
  • UI Component Enhancements: Several existing UI components have been improved for reusability and updated styling. The BubbleDiv component now accepts dynamic content and styling props, and the main Button component received a style update. A new generic BackButton component was also added.
Changelog
  • app/_components/BubbleDiv.tsx
    • Refactored to accept children prop for dynamic content.
    • Added w, h, typo, and top props for customizable styling and positioning.
    • Updated image alt text from 'bubble' to '말풍선' (speech bubble).
  • app/_components/LoginActionSection.tsx
    • Removed unused Button import.
    • Replaced the '이메일로 로그인' (Login with Email) button with a next/link component, directing to the new /login page.
  • app/login/_components/LocalLoginIntro.tsx
    • Added a new component to display introductory text for the local login page.
  • app/login/_components/LoginForm.tsx
    • Added a new component for handling email and password input, including validation and submission logic using useActionState.
    • Implemented UI for displaying login error messages and links for password recovery/email lookup.
  • app/login/_components/ScreenLocalLoginPage.tsx
    • Added a new page component that orchestrates the BackButton, LocalLoginIntro, and LoginForm for the local login screen.
  • app/login/page.tsx
    • Created a new page to serve the /login route, setting appropriate metadata and rendering the ScreenLocalLoginPage.
  • components/ui/BackButton.tsx
    • Added a new reusable BackButton component with variant, className, and onClick props for flexible navigation.
  • components/ui/Button.tsx
    • Updated the default styling of the button, changing rounded-[12px] to rounded-[16px] and adding bg-button-primary.
  • lib/actions/loginAction.ts
    • Added a new server action loginAction to handle email/password login requests, including mock validation logic.
  • lib/firebase.ts
    • Added a new file to initialize the Firebase application and integrate Firebase Analytics.
  • package.json
    • Added firebase as a new dependency.
  • pnpm-lock.yaml
    • Updated the pnpm lock file to include the new firebase dependency and its transitive dependencies.
  • public/firebase-messaging-sw.js
    • Added a Firebase Messaging Service Worker script to handle background push notifications, with its own Firebase configuration.
  • tsconfig.json
    • Included public/firebase-messaging-sw.js in the TypeScript configuration to ensure proper compilation.
Activity
  • The pull request was initiated by dasosann to introduce Firebase capabilities and a local login system.
  • New files were added to set up Firebase analytics and messaging service worker.
  • A comprehensive local login feature was developed, encompassing new UI components for user interaction and a server-side action for authentication.
  • Existing UI components were refactored to enhance their reusability and visual appeal.
  • Dependency updates were made to incorporate the Firebase SDK into the project.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This PR implements Firebase integration and an email login feature, utilizing modern React patterns like useActionState and server actions, and improving component reusability. However, critical security concerns have been identified regarding hardcoded credentials and configuration. Specifically, mock login logic with hardcoded passwords exists in server actions, and Firebase configurations are directly committed to the source code with inconsistencies between the main application and the service worker. These issues require immediate attention. Additionally, consider improving login form error handling and semantic markup for some components.

@dasosann
Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이번 PR은 Firebase Cloud Messaging(FCM) 기반의 푸시 알림 기능을 도입하고 서비스 상태 관리 로직을 활성화합니다. FcmInitializer 컴포넌트와 서비스 워커 추가를 통해 알림 수신 환경을 구축했으며, 세션 만료 시 alert를 통한 안내 로직을 추가했습니다. 코드 리뷰에서는 서버 사이드 환경에서 alert() 호출로 인한 런타임 에러 가능성, 미인증 사용자의 불필요한 토큰 등록 API 호출 문제, 그리고 서비스 워커 내 SDK 버전 불일치 및 포그라운드 알림 처리 방식에 대한 개선 사항이 지적되었습니다.

Comment on lines +10 to +42
useEffect(() => {
// 세션 당 1회만 실행 (페이지 이동마다 중복 등록 방지)
if (sessionStorage.getItem(FCM_REGISTERED_KEY)) return;

const registerFcmToken = async () => {
try {
// 알림 권한 요청
const permission = await Notification.requestPermission();
if (permission !== "granted") {
console.log("[FCM] 알림 권한 거부됨. 토큰 등록 skip.");
return;
}

// Firebase에서 FCM 토큰 발급
const token = await registerServiceWorkerAndGetToken();
if (!token) {
console.warn("[FCM] 토큰 발급 실패.");
return;
}

// 백엔드에 FCM 토큰 등록
await api.post("/api/fcm/token", { token });

// 세션 플래그 저장 (재등록 방지)
sessionStorage.setItem(FCM_REGISTERED_KEY, "true");
console.log("[FCM] 토큰 등록 완료.");
} catch (error) {
console.error("[FCM] 토큰 등록 중 오류:", error);
}
};

registerFcmToken();
}, []);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

FcmInitializer 컴포넌트는 RootLayout에 포함되어 모든 페이지에서 렌더링됩니다. 현재 구현은 사용자의 인증 상태와 관계없이 FCM 토큰 등록을 시도합니다.

문제점:

  • 미인증 사용자: 로그인하지 않은 사용자의 경우, 발급된 토큰을 특정 사용자와 연결할 수 없어 무의미한 토큰이 됩니다.
  • 불필요한 API 호출: 미인증 상태에서도 백엔드에 토큰 등록 API(api.post("/api/fcm/token", ...) )를 호출하게 되어 불필요한 네트워크 요청이 발생합니다.

개선 제안:
토큰 등록 로직은 사용자가 로그인한 상태일 때만 실행되도록 변경해야 합니다. useProfile 훅 등을 사용하여 사용자 인증 상태를 확인하고, 인증된 경우에만 registerFcmToken 함수를 호출하도록 수정하는 것을 권장합니다.

@dasosann dasosann merged commit f8d28e0 into main Mar 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant