Skip to content

Feat/firebase#19

Open
dasosann wants to merge 9 commits intomainfrom
feat/firebase
Open

Feat/firebase#19
dasosann wants to merge 9 commits intomainfrom
feat/firebase

Conversation

@dasosann
Copy link
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
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
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.

Comment on lines +26 to +28
if (email === "test@test.com" && password === "1234") {
return { success: true, message: "" };
}
Copy link
Contributor

Choose a reason for hiding this comment

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

security-high high

The loginAction function contains hardcoded credentials (test@test.com / 1234). This creates a functional backdoor that allows anyone with these credentials to bypass authentication if the code is deployed to production. Mock logic should be removed before merging.

References
  1. Security warnings should be reserved for truly sensitive values like tokens, passwords, or private keys.

Comment on lines +56 to +60
{!state.success && (
<span className="typo-12-400 text-color-flame-700 absolute bottom-[-25px] left-0">
* 이메일 혹은 비밀번호가 틀립니다
</span>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

useActionState에서 반환된 state 객체를 사용하여 오류 메시지를 동적으로 표시해야 합니다. 현재는 메시지가 하드코딩되어 있고, 초기 렌더링 시에도 불필요하게 표시되는 문제가 있습니다. state.message가 있을 때만 오류 메시지를 표시하고, 그 내용을 동적으로 채우도록 수정해야 합니다.

Suggested change
{!state.success && (
<span className="typo-12-400 text-color-flame-700 absolute bottom-[-25px] left-0">
* 이메일 혹은 비밀번호가 틀립니다
</span>
)}
{state.message && (
<span className="typo-12-400 text-color-flame-700 absolute bottom-[-25px] left-0">
* {state.message}
</span>
)}
References
  1. useActionState(구 useFormState)와 useFormStatus를 활용하여 폼 상태와 로딩 UI를 선언적으로 관리하는지 확인하세요. (link)

// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyDAE4IwNPU33dniaBSnHA7hjw33ByoQ-14",
Copy link
Contributor

Choose a reason for hiding this comment

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

security-medium medium

The Firebase API key and configuration are hardcoded in the source code, which is a security vulnerability. It is a security best practice to use environment variables (e.g., via .env file with NEXT_PUBLIC_ prefix) for configuration to prevent project details from being committed to the repository and to allow for environment-specific settings, improving both security and maintainability.

Suggested change
apiKey: "AIzaSyDAE4IwNPU33dniaBSnHA7hjw33ByoQ-14",
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
References
  1. Security warnings should be reserved for truly sensitive values like tokens, passwords, or private keys.

// (서비스 워커는 메인 코드(firebase.ts)랑 별개로 돌아가서 설정이 또 필요해요)

const firebaseConfig = {
apiKey: "AIzaSyCmwNjO2gXNy92-FBguQUXvPcQDaVk7lD0",
Copy link
Contributor

Choose a reason for hiding this comment

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

security-medium medium

The Firebase API key is hardcoded in the service worker, which is a security concern. Furthermore, there's a critical configuration inconsistency: the projectId (comatching5) in this file differs from lib/firebase.ts (comatching-59f3e). This discrepancy can lead to severe issues like FCM message reception failure. All Firebase configurations must be managed consistently via environment variables or a build-time injection process to ensure both security and proper functionality.

References
  1. Security warnings should be reserved for truly sensitive values like tokens, passwords, or private keys.

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