Skip to content

[BUILD] Add authentification and user info#15

Open
Louisp78 wants to merge 127 commits into
mainfrom
feat/add-authentification-and-user-account
Open

[BUILD] Add authentification and user info#15
Louisp78 wants to merge 127 commits into
mainfrom
feat/add-authentification-and-user-account

Conversation

@Louisp78

@Louisp78 Louisp78 commented Dec 21, 2025

Copy link
Copy Markdown
Owner

What it does:

  • Adds log in of user
  • Adds new user info page in client
  • Adds new GET user/infos endpoint
  • Adds new POST user/infos endpoint
  • Adds authentificated routing logic in client
  • Adds log in button in app bar
  • Adds user components

Todo on merge:

  • Release 1.0.1 backend version
  • Release 1.0.1 client version
  • update github and google auth api to switch in prod mode

@Louisp78 Louisp78 changed the title test(auth): add to match acceptance criteras Add authentification and user info Dec 21, 2025
@Louisp78 Louisp78 changed the title Add authentification and user info [BUILD] Add authentification and user info Dec 21, 2025
Louisp78 and others added 30 commits January 25, 2026 19:13
Add code-piece API client configuration and exported types for CRUD
operations on code pieces. Generated from OpenAPI specification.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add new code-piece plugin with:
- CodeBlock component for displaying and editing code
- Code piece CRUD hooks (useCreateCodePiece, useUpdateCodePiece, etc.)
- Code piece comparison and card views
- Monaco editor integration with TypeScript support

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add responsive mobile navigation with burger menu component and
restructure desktop menu with secondary color indicators for active
routes. Include code-pieces navigation link for authenticated users.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Migrate from local code plugin to centralized code-piece plugin.
Add post slug context propagation to enable code piece sourcing
from posts. Update imports to use lucide-react for icons.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add next/navigation mocks to test utilities for components using
usePathname and useRouter hooks. Update auth-posts-page test to match
updated UI text.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Remove old code plugin in favor of the new centralized code-piece
plugin for better modularity and feature management.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add backend code-piece feature implementation with:
- CodePieceController for REST endpoints
- CodePieceService for business logic
- CodePiece entity and DTOs
- Database persistence layer
- Comprehensive unit tests

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…tton

- Add event parameter to handleSave and call event.stopPropagation() to prevent bubbling
- Add z-10 z-index class to save button to ensure proper stacking

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Hide line numbers in the read-only solution editor for a cleaner UI.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add emailUrl field to OAuthProviderEnum for GitHub
- Implement fallback email fetching from GitHub /user/emails endpoint
- Extract primary verified email when not available in user info response
- Add proper media type header for token endpoint requests

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Replace wildcard headers with explicit list: Content-Type, Accept, X-Requested-With
- Improves security posture by limiting exposed headers

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add no-op UserDetailsService bean to support OAuth authentication flow
- Throws UsernameNotFoundException to indicate OAuth is the primary auth method

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Make show-sql configurable via SHOW_SQL_QUERY environment variable
- Make HTTP client logging level configurable via HTTP_CLIENT_MODE
- Remove default value for SESSION_COOKIE_SECURE for explicit environment control

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add me.png logo asset to public directory
- Display logo in app bar with 45x45px dimensions
- Update favicon.ico
- Flexbox layout improvement for header logo placement

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add HTTP_CLIENT_MODE and SHOW_SQL_QUERY environment variables for configuring logging and SQL query display.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Exclude generated OpenAPI client files from ESLint checks to avoid linting auto-generated code.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Update the logo image alt text to be more descriptive for screen readers.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Remove 'any' type annotation from handleEditorMount parameter to rely on TypeScript inference.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Remove unused CodePieceDTO import and reorder imports for consistency.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Format PostContent component to fit on single line for improved readability.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Replace Long id with String sourcePostSlug for update/delete endpoints
- Add validation to CodePieceCreateDTO (NotNull, NotBlank, kebab-case pattern)
- Add unique constraint on (source_post_slug, user_email) in CodePieceEntity
- Make sourcePostSlug column non-nullable in database
- Update ICodePieceService and CodePieceService methods to use sourcePostSlug
- Add findBySourcePostSlugAndUserEmail method to ICodePieceRepository
- Update service tests to reflect new identifier

This change improves API semantics by using meaningful identifiers instead of generic IDs.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Regenerate CodePieceControllerApi from updated OpenAPI spec
- Replace id parameter with sourcePostSlug in deleteCodePiece and updateCodePiece
- Update API documentation for new endpoint parameters
- Update CodePieceCreateDTO with validation constraints

Generated from backend API changes.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add restrictedContent message for unauthenticated users
- Add signInPrompt to encourage authentication
- These texts are used by the CodeBlockAuthGuard component

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add guarded?: boolean to PostDataContent type definition
- Add guarded property to BDD/TDD bridge post data
- Pass guarded prop from PostContent to CodeBlock component
- Add TODO comment for future improvements on required vs optional args

This allows posts to restrict interactive code blocks to authenticated users.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…ling

- Add CodeBlockAuthGuard component to show login prompt for restricted content
- Update CodeBlock to display auth guard when guarded=true and user is not authenticated
- Load registered user code from query on mount and update editor
- Update all code-piece hooks and components to use sourcePostSlug instead of id
- Update useDeleteCodePiece and useUpdateCodePiece to accept sourcePostSlug parameter
- Update CodePieceCard callback signatures for new identifier
- Update CodePiecesPage to use sourcePostSlug for selection and comparisons

This enables authentication-gated code editors and aligns frontend with new backend API.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Move burger menu logic from separate BurgerMenu component into AppBar
- Add Menu/X icons from lucide-react for toggle button
- Add isOpen state to manage mobile menu visibility
- Implement mobile menu items directly in AppBar (My Code, Account links)
- Delete burger-menu.tsx (no longer needed)
- Update SignInButton mobile styles for better layout consistency
- Change header min-height and add shadow-md for improved visual separation

This simplifies component structure by consolidating mobile menu logic.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Document project overview and architecture (frontend, backend, orchestration)
- Add frontend structure with plugin architecture and ESLint patterns
- Add backend feature-based organization guide
- Document all development commands for frontend and backend
- Include Docker and deployment instructions
- Add important coding conventions for plugins, API client, and components
- Document environment variables and database setup
- Describe CI/CD pipelines (lint.yml, build_and_deploy.yml)
- Add local development workflow guide

This guide helps Claude Code understand project structure and conventions.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Remove exerciseContext and solutionCode from CodePieceEntity
- Remove them from CodePieceCreateDTO and CodePieceDTO
- Update CodeBlock to not accept or pass these unused props
- Remove exerciseContext display from CodePieceCard
- Remove them from generated API models (CodePieceDTO, CodePieceCreateDTO)
- Remove TODO comment from PostContent
- Make postSlug required in PostContent since it's always needed

These fields were implemented but never actually used:
- Post data doesn't provide them
- CodeBlock doesn't receive them from PostContent
- Removing them simplifies the API contract

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant