This repository was archived by the owner on Feb 17, 2026. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: guidelines #427
Open
yacosta738
wants to merge
8
commits into
main
Choose a base branch
from
feature/guidelines
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: guidelines #427
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
041eaa6
feat(guidelines): add development guidelines document for project set…
yacosta738 1546eac
feat(docs): update README.md with additional technology stack informa…
yacosta738 c6333fe
fix(guidelines): clarify frontend testing framework in guidelines.md
yacosta738 9e7d5cc
docs(guidelines): update development guidelines with additional prere…
yacosta738 470311f
docs(guidelines): 📝 enhance backend testing instructions with detaile…
yacosta738 ecf2452
fix(tests): update expected image URL in LinkPreviewControllerIntegra…
yacosta738 3236e88
feat(plugin): add task to purge dependency check database and enable …
yacosta738 ca4fd11
chore(action): update action dependencies to latest versions
yacosta738 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,250 @@ | ||
| # Lyra Project Development Guidelines | ||
|
|
||
| This document provides essential information for developers working on the Lyra project. | ||
|
|
||
| ## Build and Configuration Instructions | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - Java (version specified in `.java-version`) | ||
| - Node.js (version specified in `.nvmrc`) | ||
| - PNPM (for frontend package management) | ||
| - Docker and Docker Compose (for running dependencies) | ||
| - GNU Make (for using the provided Makefile targets) | ||
|
|
||
| ### Building the Project | ||
|
|
||
| #### Backend (Kotlin/Spring Boot) | ||
|
|
||
| The project uses Gradle as the build tool. The Gradle wrapper (`gradlew`) is included in the repository, so you don't need to install Gradle separately. | ||
|
|
||
| ```bash | ||
| # Build the entire project | ||
| ./gradlew build | ||
|
|
||
| # Clean and build | ||
| ./gradlew clean build | ||
|
|
||
| # Build specific module | ||
| ./gradlew :apps:backend:build | ||
| ``` | ||
|
|
||
| You can also use the Makefile for common operations: | ||
|
|
||
| ```bash | ||
| # Build the project | ||
| make build | ||
|
|
||
| # Clean the project | ||
| make clean | ||
|
|
||
| # Run tests | ||
| make test | ||
| ``` | ||
|
|
||
| #### Frontend (Node.js) | ||
|
|
||
| The frontend uses PNPM for package management: | ||
|
|
||
| ```bash | ||
| # Install dependencies | ||
| pnpm install | ||
|
|
||
| # Build frontend | ||
| pnpm run build | ||
| ``` | ||
|
|
||
| ### Running the Application | ||
|
|
||
| #### Using Docker Compose | ||
|
|
||
| The project includes Docker Compose configuration for running the application and its dependencies: | ||
|
|
||
| ```bash | ||
| # Start all services | ||
| docker compose up | ||
|
|
||
| # Start specific services | ||
| docker compose up postgresql keycloak | ||
|
|
||
| # Run in detached mode | ||
| docker compose up -d | ||
|
|
||
| # Stop services | ||
| docker compose down | ||
| ``` | ||
|
|
||
| #### Environment Configuration | ||
|
|
||
| The project uses `.env` files for environment configuration. Copy `.env.example` to `.env` and adjust the values as needed: | ||
|
|
||
| ```bash | ||
| cp .env.example .env | ||
| ``` | ||
|
|
||
| Key environment variables include: | ||
|
|
||
| - `DATABASE_URL`: PostgreSQL connection string | ||
| - `KEYCLOAK_URL`: Keycloak server URL | ||
| - `API_KEY`: For external service authentication | ||
| - See `.env.example` for a complete list of required variables | ||
|
|
||
| ## Testing Information | ||
|
|
||
| ### Backend Testing | ||
|
|
||
| The backend uses JUnit 5 for testing, with custom annotations for different test types: | ||
|
|
||
| - `@UnitTest`: For unit tests | ||
| - `@IntegrationTest`: For integration tests | ||
|
|
||
| Tests follow a BDD style with Given/When/Then comments and are organized by domain and layer (application, infrastructure, domain). | ||
|
|
||
| #### Running Backend Tests | ||
|
|
||
| ```bash | ||
| # Run all tests | ||
| ./gradlew test | ||
|
|
||
| # Run only unit tests (filter by annotation) | ||
| ./gradlew test --includes-category "com.lyra.app.test.UnitTest" | ||
|
|
||
| # Run integration tests (requires PostgreSQL & Keycloak) | ||
| docker compose up -d postgresql keycloak | ||
| ./gradlew test --includes-category "com.lyra.app.test.IntegrationTest" | ||
| ### Running Backend Tests By Type | ||
|
|
||
| ```bash | ||
| # Run all tests | ||
| ./gradlew test | ||
|
|
||
| # Run only unit tests (filter by test class name) | ||
| ./gradlew test --tests "*UnitTest" | ||
|
|
||
| # Alternative: Run unit tests using JUnit tags | ||
| ./gradlew test -DincludeTags=unit | ||
|
|
||
| # Run integration tests (requires PostgreSQL & Keycloak) | ||
| docker compose up -d postgresql keycloak | ||
| ./gradlew test --tests "*IntegrationTest" | ||
|
|
||
| # Alternative: Run integration tests using JUnit tags | ||
| ./gradlew test -DincludeTags=integration | ||
| # Run specific test | ||
| ./gradlew test --tests "com.lyra.app.healthcheck.HealthcheckUtilTest" | ||
| ``` | ||
|
|
||
| #### Writing Backend Tests | ||
|
|
||
| 1. Create a test class in the appropriate package under `src/test/kotlin` | ||
| 2. Annotate the class with `@UnitTest` or `@IntegrationTest` | ||
| 3. Write test methods with descriptive names using backticks | ||
| 4. Follow the Given/When/Then pattern | ||
|
|
||
| Example: | ||
|
|
||
| ```kotlin | ||
| @UnitTest | ||
| class HealthcheckUtilTest { | ||
|
|
||
| @Test | ||
| fun `should return true when system is healthy`() { | ||
| // Given | ||
| val healthcheckUtil = HealthcheckUtil() | ||
|
|
||
| // When | ||
| val result = healthcheckUtil.isHealthy() | ||
|
|
||
| // Then | ||
| Assertions.assertTrue(result) | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Frontend Testing | ||
|
|
||
| Frontend tests are written using the Vitest JavaScript testing framework and are located in the `apps/frontend` directory. | ||
|
|
||
| #### Running Frontend Tests | ||
|
|
||
| ```bash | ||
| # Run all frontend tests | ||
| pnpm test | ||
|
|
||
| # Run tests with watch mode | ||
| pnpm test:watch | ||
| ``` | ||
|
|
||
| #### Writing Frontend Tests | ||
|
|
||
| Frontend tests follow a similar BDD style with describe/it blocks: | ||
|
|
||
| ```typescript | ||
| describe('StringValueObject', () => { | ||
| it('should create a StringValueObject with a valid value', () => { | ||
| const valueObject = TestValueObject.create('test'); | ||
| expect(valueObject.value).toBe('test'); | ||
| }); | ||
| }); | ||
| ``` | ||
|
|
||
| ## Code Style and Development Practices | ||
|
|
||
| ### Code Style | ||
|
|
||
| The project uses EditorConfig for consistent code style across different editors. The main settings are: | ||
|
|
||
| - UTF-8 encoding | ||
| - LF line endings | ||
| - 2-space indentation for most files | ||
| - 4-space indentation for Kotlin, Java, and some other file types | ||
|
|
||
| ### Architecture | ||
|
|
||
| The project follows a clean architecture pattern with: | ||
|
|
||
| - Domain layer: Core business logic and entities | ||
| - Application layer: Use cases and application services | ||
| - Infrastructure layer: External interfaces and implementations | ||
|
|
||
| ### Backend Development | ||
|
|
||
| - The backend is built with Kotlin and Spring Boot | ||
| - Uses reactive programming with Spring WebFlux | ||
| - Follows CQRS pattern with command and query handlers | ||
| - Uses event-driven architecture with event publishers | ||
|
|
||
| ### Frontend Development | ||
|
|
||
| - The frontend consists of multiple applications: | ||
| - Lyra App (Nuxt.js) | ||
| - Lyra Landing Page (Astro) | ||
| - Uses TypeScript for type safety | ||
| - Follows domain-driven design principles | ||
|
|
||
| ### Database | ||
|
|
||
| - PostgreSQL is used as the primary database | ||
| - Keycloak is used for authentication and authorization | ||
|
|
||
| ### Containerization | ||
|
|
||
| - Docker is used for containerization | ||
| - Docker Compose is used for local development | ||
| - Multiple Dockerfiles for different environments (development, production) | ||
|
|
||
| ## Debugging and Troubleshooting | ||
|
|
||
| ### Logs | ||
|
|
||
| - Backend logs are available in the console and can be configured in `application.yml` | ||
| - Docker logs can be viewed with `docker compose logs` | ||
|
|
||
| ### Common Issues | ||
|
|
||
| - If you encounter database connection issues, ensure PostgreSQL is running and accessible | ||
| - For Keycloak issues, check the Keycloak logs and ensure it's properly configured | ||
|
|
||
| ## Continuous Integration | ||
|
|
||
| The project uses GitHub Actions for CI/CD, with workflows defined in the `.github` directory. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.