├── .github
├── FUNDING.yml
└── workflows
│ └── main.yml
├── .gitignore
├── .vscode
└── settings.json
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── generate.sh
├── index.sh
├── package.json
├── pnpm-lock.yaml
└── src
├── .gitignore
├── .vuepress
├── .gitignore
├── config.ts
├── navbar
│ ├── en.ts
│ ├── es.ts
│ ├── index.ts
│ ├── ko.ts
│ └── zh.ts
├── public
│ ├── coffee.svg
│ ├── favicon.ico
│ ├── logo.png
│ └── logo.svg
├── styles
│ ├── config.scss
│ ├── index.scss
│ └── palette.scss
└── theme.ts
├── README.md
├── book
├── README.md
└── etc
│ └── oil-painting.jpeg
├── es
└── README.md
├── ko
└── README.md
└── zh
└── README.md
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [iluwatar]
4 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | name: Trigger Netlify build
2 | on:
3 | schedule:
4 | - cron: '3 13 * * *'
5 | jobs:
6 | build:
7 | name: Call Netlify webhook
8 | runs-on: ubuntu-latest
9 | steps:
10 | - name: POST to build hook
11 | run: curl -X POST -d {} https://api.netlify.com/build_hooks/63810ae7da05a656064a4bca
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | dist
2 | node_modules
3 |
4 | # MacOS - General
5 | .DS_Store
6 | .AppleDouble
7 | .LSOverride
8 |
9 | # MacOS - Icon must end with two \r
10 | Icon
11 |
12 |
13 | # MacOS - Thumbnails
14 | ._*
15 |
16 | # MacOS - Files that might appear in the root of a volume
17 | .DocumentRevisions-V100
18 | .fseventsd
19 | .Spotlight-V100
20 | .TemporaryItems
21 | .Trashes
22 | .VolumeIcon.icns
23 | .com.apple.timemachine.donotpresent
24 |
25 | # MacOS - Directories potentially created on remote AFP share
26 | .AppleDB
27 | .AppleDesktop
28 | Network Trash Folder
29 | Temporary Items
30 | .apdisk
31 |
32 | # IntelliJ IDEA
33 | .idea/
34 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "git.ignoreLimitWarning": true
3 | }
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at iluwatar@gmail.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Ilkka Seppälä
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Java Design Patterns Website [](https://app.netlify.com/sites/relaxed-kleicha-7210ed/deploys) [](https://gitter.im/iluwatar/java-design-patterns-vuepress-web?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2 |
3 |
4 |
5 |
6 |
7 |
8 | This repository contains the source code of Java Design Patterns website, powered by [Vuepress](https://vuepress.vuejs.org/). The website mainly pulls content from these sources:
9 | - https://github.com/iluwatar/java-design-patterns
10 | - https://github.com/iluwatar/30-seconds-of-java
11 | - https://github.com/iluwatar/programming-principles
12 |
13 | Running it locally is easy, just follow these steps:
14 |
15 | - Clone this repository
16 | - Install the dependencies `pnpm install`
17 | - Prepare the content `pnpm run generate`
18 | - Run the local development server `pnpm run dev`
19 | - Access the website `http://localhost:8080/`
20 |
--------------------------------------------------------------------------------
/generate.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -x
4 |
5 | ROOT_DIR=$(pwd)
6 | DOCS_DIR=$ROOT_DIR/src
7 | cd $DOCS_DIR
8 |
9 | # Setup java-design-patterns - English
10 | rm -rf java-design-patterns
11 | rm -rf patterns
12 | rm -rf zh/patterns
13 | git clone https://github.com/iluwatar/java-design-patterns.git
14 | cd java-design-patterns
15 | git checkout-index -a -f --prefix=../patterns/
16 | cd ../patterns
17 | rm -rf etc .circleci .editorconfig .github .mvn checkstyle-suppressions.xml CONTRIBUTING.MD LICENSE.md license-plugin-header-style.xml mvnw mvnw.cmd pom.xml PULL_REQUEST_TEMPLATE.md .all-contributorsrc .gitignore gpl-3.0.txt layers.log lgpl-3.0.txt lombok.config service-layer.log
18 | find . -maxdepth 2 -type d -exec bash -c 'cd "{}" && pwd && rm -rf src pom.xml *.ucls *.puml .gitignore' \;
19 |
20 | rm -vf README.md
21 | $ROOT_DIR/index.sh "en" "Design Pattern Catalog" "Catalog of Java Design Patterns for Developers" "Discover the full list of Java design patterns. This comprehensive guide provides you with all the information you need to master pattern implementation in your Java applications."
22 |
23 | # Setup java-design-patterns - localizations
24 | languages=( zh ko es )
25 | catalogs=( "设计模式目录" "디자인 패턴 카탈로그" "Catalogo de patrones de diseño" )
26 |
27 | iter=0
28 | for lan in "${languages[@]}"
29 | do
30 | cd localization/$lan
31 | mkdir -p ../../../$lan/patterns
32 | cp -vrf * ../../../$lan/patterns
33 | cd ../../../$lan/patterns
34 | rm -vf README.md
35 | $ROOT_DIR/index.sh "$lan" "${catalogs[$iter]}"
36 | cd ../../patterns
37 | iter=$((iter+1))
38 | done
39 |
40 | cd $DOCS_DIR
41 | rm -rf java-design-patterns
42 | rm -rf patterns/localization
43 |
44 | # setup programming-principles - English
45 | rm -rf programming-principles
46 | rm -rf principles
47 | rm -rf zh/principles
48 | git clone https://github.com/iluwatar/programming-principles.git
49 | cd programming-principles
50 | git checkout-index -f --prefix=../principles/ README.md
51 |
52 | # setup programming-principles - localizations
53 | languages=( zh ko es )
54 | for lan in "${languages[@]}"
55 | do
56 | mkdir ../$lan/principles
57 | cp -vf README.md ../$lan/principles/
58 | done
59 | cd ..
60 | rm -rf programming-principles
61 |
62 | # setup 30-seconds-of-java - English
63 | rm -rf 30-seconds-of-java
64 | rm -rf snippets
65 | rm -rf zh/snippets
66 | git clone https://github.com/iluwatar/30-seconds-of-java.git
67 | cd 30-seconds-of-java
68 | git checkout-index -f --prefix=../snippets/ README.md
69 |
70 | # setup 30-seconds-of-java - localizations
71 | languages=( zh ko es )
72 | for lan in "${languages[@]}"
73 | do
74 | mkdir ../$lan/snippets
75 | cp -vf localization/$lan/README.md ../$lan/snippets/
76 | done
77 | cd ..
78 | rm -rf 30-seconds-of-java
79 |
--------------------------------------------------------------------------------
/index.sh:
--------------------------------------------------------------------------------
1 | echo "---" >> README.md
2 | echo "language: $1" >> README.md
3 | echo "title: $2" >> README.md
4 | echo "shortTitle: $3" >> README.md
5 | echo "description: $4" >> README.md
6 | echo "---" >> README.md
7 | echo "" >> README.md
8 |
9 | if [ "$1" = "en" ]; then
10 | echo "## Get the E-Book" >> README.md
11 | echo "" >> README.md
12 | echo "Get the entire catalog now as a convenient e-book – your ultimate resource in one download! 📚✨ Follow [this link](https://java-design-patterns.com/book) to get started!" >> README.md
13 | echo "" >> README.md
14 | echo "## Read Online" >> README.md
15 | echo "" >> README.md
16 | echo "Select individual pattern below. Alternatively, browse by [category](https://java-design-patterns.com/category) or [tag](https://java-design-patterns.com/tag)." >> README.md
17 | fi
18 |
19 | echo "
" >> README.md
20 | for dir in *; do
21 | if [ -d "$dir" ] && [ "$dir" != "localization" ]; then
22 | title=$( grep "shortTitle: " $dir/README.md | cut -d " " -f2- )
23 | echo "