437 | Web development technologies have evolved at an incredible clip over the past few years. 438 |
439 |Introducing RealWorld.
440 |It's a great solution for learning how other frameworks work.
441 |├── .editorconfig ├── .env ├── .github ├── dependabot.yml └── workflows │ ├── codeql-analysis.yml │ ├── health-check.yml │ ├── pull-request.yml │ └── test.yml ├── .gitignore ├── FRONTEND_INSTRUCTIONS.md ├── LICENSE ├── README.md ├── cypress.config.ts ├── cypress ├── e2e │ ├── article.cy.ts │ ├── auth.cy.ts │ ├── constant.ts │ ├── favorite.cy.ts │ ├── follow.cy.ts │ ├── home.cy.ts │ ├── tag.cy.ts │ └── tsconfig.json ├── fixtures │ ├── article-comments.json │ ├── article.json │ ├── articles-of-tag.json │ ├── articles.json │ ├── profile.json │ ├── tags.json │ └── user.json └── support │ ├── commands.ts │ └── e2e.ts ├── eslint.config.js ├── index.html ├── logo.png ├── package.json ├── pnpm-lock.yaml ├── public └── favicon.ico ├── src ├── App.vue ├── components │ ├── AppFooter.spec.ts │ ├── AppFooter.vue │ ├── AppLink.spec.ts │ ├── AppLink.vue │ ├── AppNavigation.spec.ts │ ├── AppNavigation.vue │ ├── AppPagination.spec.ts │ ├── AppPagination.vue │ ├── ArticleDetail.spec.ts │ ├── ArticleDetail.vue │ ├── ArticleDetailComment.spec.ts │ ├── ArticleDetailComment.vue │ ├── ArticleDetailComments.spec.ts │ ├── ArticleDetailComments.vue │ ├── ArticleDetailCommentsForm.spec.ts │ ├── ArticleDetailCommentsForm.vue │ ├── ArticleDetailMeta.spec.ts │ ├── ArticleDetailMeta.vue │ ├── ArticlesList.spec.ts │ ├── ArticlesList.vue │ ├── ArticlesListArticlePreview.spec.ts │ ├── ArticlesListArticlePreview.vue │ ├── ArticlesListNavigation.spec.ts │ ├── ArticlesListNavigation.vue │ ├── PopularTags.spec.ts │ ├── PopularTags.vue │ └── __snapshots__ │ │ └── ArticleDetail.spec.ts.snap ├── composable │ ├── useArticles.ts │ ├── useFavoriteArticle.ts │ ├── useFollowProfile.ts │ ├── useProfile.ts │ └── useTags.ts ├── config.ts ├── env.d.ts ├── main.ts ├── pages │ ├── Article.spec.ts │ ├── Article.vue │ ├── EditArticle.spec.ts │ ├── EditArticle.vue │ ├── Home.vue │ ├── Login.spec.ts │ ├── Login.vue │ ├── Profile.spec.ts │ ├── Profile.vue │ ├── Register.spec.ts │ ├── Register.vue │ ├── Settings.spec.ts │ └── Settings.vue ├── plugins │ ├── global-components.ts │ ├── marked.ts │ └── set-authorization-token.ts ├── router.ts ├── services │ ├── api.ts │ ├── index.ts │ └── openapi.yml ├── setupTests.ts ├── store │ └── user.ts ├── types │ ├── global-component.d.ts │ └── global.d.ts └── utils │ ├── filters.spec.ts │ ├── filters.ts │ ├── params-to-query.spec.ts │ ├── params-to-query.ts │ ├── storage.spec.ts │ ├── storage.ts │ ├── test │ ├── fixtures.ts │ └── test.utils.ts │ ├── use-async.spec.ts │ └── use-async.ts ├── tsconfig.json ├── tsconfig.node.json └── vite.config.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | tab_width = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | BASE_URL=/ 2 | VITE_API_HOST=https://api.realworld.io 3 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: npm 9 | directory: / 10 | schedule: 11 | interval: monthly 12 | allow: 13 | - dependency-type: production 14 | 15 | - package-ecosystem: github-actions 16 | directory: .github/workflows 17 | schedule: 18 | interval: monthly 19 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: CodeQL 13 | 14 | on: 15 | push: 16 | branches: [master] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [master] 20 | schedule: 21 | - cron: '43 3 * * 6' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | 28 | strategy: 29 | fail-fast: false 30 | matrix: 31 | language: [javascript-typescript] 32 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] 33 | # Learn more: 34 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed 35 | 36 | steps: 37 | - name: Checkout repository 38 | uses: actions/checkout@v4 39 | 40 | # Initializes the CodeQL tools for scanning. 41 | - name: Initialize CodeQL 42 | uses: github/codeql-action/init@v3 43 | with: 44 | languages: ${{ matrix.language }} 45 | # If you wish to specify custom queries, you can do so here or in a config file. 46 | # By default, queries listed here will override any specified in a config file. 47 | # Prefix the list here with "+" to use these queries and those in the config file. 48 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 49 | 50 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 51 | # If this step fails, then you should remove it and run the build manually (see below) 52 | - name: Autobuild 53 | uses: github/codeql-action/autobuild@v3 54 | 55 | # ℹ️ Command-line programs to run using the OS shell. 56 | # 📚 https://git.io/JvXDl 57 | 58 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 59 | # and modify them (or add more) to build your code if your project 60 | # uses a compiled language 61 | 62 | # - run: | 63 | # make bootstrap 64 | # make release 65 | 66 | - name: Perform CodeQL Analysis 67 | uses: github/codeql-action/analyze@v3 68 | -------------------------------------------------------------------------------- /.github/workflows/health-check.yml: -------------------------------------------------------------------------------- 1 | name: Check Swagger API 2 | 3 | on: 4 | schedule: 5 | - cron: '35 17 */4 * 4' 6 | 7 | env: 8 | CI: true 9 | 10 | jobs: 11 | e2e_tests: 12 | name: E2E test 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | 17 | - uses: pnpm/action-setup@v4 18 | with: 19 | version: 9 20 | run_install: false 21 | 22 | # https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping 23 | - name: Use Node.js 22.x 24 | uses: actions/setup-node@v4 25 | with: 26 | node-version: 22.x 27 | cache: pnpm 28 | 29 | - name: Install dependencies 30 | run: pnpm install 31 | 32 | - name: E2E test 33 | run: pnpm test:e2e:prod 34 | -------------------------------------------------------------------------------- /.github/workflows/pull-request.yml: -------------------------------------------------------------------------------- 1 | name: Pull request 2 | 3 | on: 4 | pull_request: 5 | paths-ignore: 6 | - '**.md' 7 | 8 | env: 9 | CI: true 10 | 11 | jobs: 12 | lint: 13 | name: Lint 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | 18 | - uses: pnpm/action-setup@v4 19 | with: 20 | version: 9 21 | run_install: false 22 | 23 | - name: Use Node.js 22.x 24 | uses: actions/setup-node@v4 25 | with: 26 | node-version: 22.x 27 | cache: pnpm 28 | 29 | - name: Install dependencies 30 | run: pnpm install --no-frozen-lockfile 31 | 32 | - name: TypeScript check 33 | run: pnpm lint 34 | 35 | - name: Eslint check 36 | run: pnpm lint 37 | 38 | unit_test: 39 | name: Unit test 40 | runs-on: ubuntu-latest 41 | steps: 42 | - uses: actions/checkout@v4 43 | 44 | - uses: pnpm/action-setup@v4 45 | with: 46 | version: 9 47 | run_install: false 48 | 49 | - name: Use Node.js 22.x 50 | uses: actions/setup-node@v4 51 | with: 52 | node-version: 22.x 53 | cache: pnpm 54 | 55 | - name: Install dependencies 56 | run: pnpm install --no-frozen-lockfile 57 | 58 | - name: Unit test 59 | run: pnpm test:unit 60 | 61 | - name: Update coverage report 62 | uses: codecov/codecov-action@v4 63 | with: 64 | token: ${{ secrets.CODECOV_TOKEN }} 65 | 66 | e2e_tests: 67 | name: E2E test 68 | runs-on: ubuntu-latest 69 | steps: 70 | - uses: actions/checkout@v4 71 | 72 | - uses: pnpm/action-setup@v4 73 | with: 74 | version: 9 75 | run_install: false 76 | 77 | - name: Use Node.js 22.x 78 | uses: actions/setup-node@v4 79 | with: 80 | node-version: 22.x 81 | cache: pnpm 82 | 83 | - name: Install dependencies 84 | run: pnpm install --no-frozen-lockfile 85 | 86 | - name: Get cypress version 87 | id: cypress-version 88 | run: echo "version=$(pnpm info cypress version)" >> $GITHUB_OUTPUT 89 | 90 | - name: Cache cypress binary 91 | id: cache-cypress-binary 92 | uses: actions/cache@v4 93 | with: 94 | path: ~/.cache/Cypress 95 | key: cypress-binary-${{ runner.os }}-${{ steps.cypress-version.outputs.version }} 96 | 97 | - name: Install cypress binary 98 | if: steps.cache-cypress-binary.outputs.cache-hit != 'true' 99 | run: pnpm cypress install 100 | 101 | - name: E2E test 102 | run: pnpm test:e2e:ci 103 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - '**.md' 7 | 8 | env: 9 | CI: true 10 | 11 | jobs: 12 | lint: 13 | name: Lint 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | 18 | - uses: pnpm/action-setup@v4 19 | with: 20 | version: 9 21 | run_install: false 22 | 23 | - name: Use Node.js 22.x 24 | uses: actions/setup-node@v4 25 | with: 26 | node-version: 22.x 27 | cache: pnpm 28 | 29 | - name: Install dependencies 30 | run: pnpm install 31 | 32 | - name: TypeScript check 33 | run: pnpm type-check 34 | 35 | - name: Eslint check 36 | run: pnpm lint 37 | 38 | unit_test: 39 | name: Unit test 40 | runs-on: ubuntu-latest 41 | steps: 42 | - uses: actions/checkout@v4 43 | 44 | - uses: pnpm/action-setup@v4 45 | with: 46 | version: 9 47 | run_install: false 48 | 49 | - name: Use Node.js 22.x 50 | uses: actions/setup-node@v4 51 | with: 52 | node-version: 22.x 53 | cache: pnpm 54 | 55 | - name: Install dependencies 56 | run: pnpm install 57 | 58 | - name: Unit test 59 | run: pnpm test:unit 60 | 61 | - name: Update coverage report 62 | uses: codecov/codecov-action@v4 63 | with: 64 | token: ${{ secrets.CODECOV_TOKEN }} 65 | 66 | e2e_tests: 67 | name: E2E test 68 | runs-on: ubuntu-latest 69 | steps: 70 | - uses: actions/checkout@v4 71 | 72 | - uses: pnpm/action-setup@v4 73 | with: 74 | version: 9 75 | run_install: false 76 | 77 | - name: Use Node.js 22.x 78 | uses: actions/setup-node@v4 79 | with: 80 | node-version: 22.x 81 | cache: pnpm 82 | 83 | - name: Install dependencies 84 | run: pnpm install 85 | 86 | - name: Get cypress version 87 | id: cypress-version 88 | run: echo "version=$(pnpm info cypress version)" >> $GITHUB_OUTPUT 89 | 90 | - name: Cache cypress binary 91 | id: cache-cypress-binary 92 | uses: actions/cache@v4 93 | with: 94 | path: ~/.cache/Cypress 95 | key: cypress-binary-${{ runner.os }}-${{ steps.cypress-version.outputs.version }} 96 | 97 | - name: Install cypress binary 98 | if: steps.cache-cypress-binary.outputs.cache-hit != 'true' 99 | run: pnpm cypress install 100 | 101 | - name: E2E test 102 | run: pnpm test:e2e:ci 103 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | .DS_Store 12 | dist 13 | dist-ssr 14 | coverage 15 | *.local 16 | 17 | /cypress/videos/ 18 | /cypress/screenshots/ 19 | 20 | # Editor directories and files 21 | .vscode/* 22 | !.vscode/extensions.json 23 | .idea 24 | *.suo 25 | *.ntvs* 26 | *.njsproj 27 | *.sln 28 | *.sw? 29 | -------------------------------------------------------------------------------- /FRONTEND_INSTRUCTIONS.md: -------------------------------------------------------------------------------- 1 | > *Note: Delete this file before publishing your app!* 2 | 3 | ### Using the hosted API 4 | 5 | Simply point your [API requests](https://github.com/gothinkster/realworld/tree/master/api) to `https://api.realworld.io/api` and you're good to go! 6 | 7 | ### Routing Guidelines 8 | 9 | - Home page (URL: /#/ ) 10 | - List of tags 11 | - List of articles pulled from either Feed, Global, or by Tag 12 | - Pagination for list of articles 13 | - Sign in/Sign up pages (URL: /#/login, /#/register ) 14 | - Uses JWT (store the token in localStorage) 15 | - Authentication can be easily switched to session/cookie based 16 | - Settings page (URL: /#/settings ) 17 | - Editor page to create/edit articles (URL: /#/editor, /#/editor/article-slug-here ) 18 | - Article page (URL: /#/article/article-slug-here ) 19 | - Delete article button (only shown to article's author) 20 | - Render markdown from server client side 21 | - Comments section at bottom of page 22 | - Delete comment button (only shown to comment's author) 23 | - Profile page (URL: /#/profile/:username, /#/profile/:username/favorites ) 24 | - Show basic user info 25 | - List of articles populated from author's created articles or author's favorited articles 26 | 27 | # Styles 28 | 29 | Instead of having the Bootstrap theme included locally, we recommend loading the precompiled theme from our CDN (our [header template](#header) does this by default): 30 | 31 | ```html 32 | 33 | ``` 34 | 35 | Alternatively, if you want to make modifications to the theme, check out the [theme's repo](https://github.com/gothinkster/conduit-bootstrap-template). 36 | 37 | # Templates 38 | 39 | - [Layout](#layout) 40 | - [Header](#header) 41 | - [Footer](#footer) 42 | - [Pages](#pages) 43 | - [Home](#home) 44 | - [Login/Register](#loginregister) 45 | - [Profile](#profile) 46 | - [Settings](#settings) 47 | - [Create/Edit Article](#createedit-article) 48 | - [Article](#article) 49 | 50 | ## Layout 51 | 52 | ### Header 53 | 54 | ```html 55 | 56 | 57 |
58 | 59 |209 | Have an account? 210 |
211 | 212 | 215 | 216 | 230 |437 | Web development technologies have evolved at an incredible clip over the past few years. 438 |
439 |It's a great solution for learning how other frameworks work.
441 |With supporting text below as a natural lead-in to additional content.
487 |With supporting text below as a natural lead-in to additional content.
501 |