What you need to run Conduit
Conduit is a Vue 3 application. Pinia stores application state, Vue Router handles navigation, and
Vite serves and builds the application. Bun installs packages and runs project commands. Playwright
runs the end-to-end browser tests. marked renders Markdown, DOMPurify sanitises rendered content,
and date-fns handles dates. The application uses a thin fetch wrapper for API requests.
Prepare the project locally before opening Conduit.
| If you need to… | Go to |
|---|---|
| Prepare the repository | Before you start |
| Install packages and run the application | Install and run the application |
| Select a backend URL | Point Conduit to a backend |
| Run browser tests or code checks | Test and check the project |
| Understand what Conduit does | What is conduit; What can you do with conduit |
| Get help with a problem | Getting help |
Before you start
Before you run a project command, have a clone that includes the realworld git submodule. This
submodule supplies the specification and test suite, and the application imports its theme from it.
Prerequisites
- Access to the project repository.
- The
realworldgit submodule available in the clone.
Steps
-
Prepare the repository using the command that matches its current state:
If you need to… Run Clone the repository with its submodules git clone --recurse-submodules https://github.com/realworld-apps/vue-realworld-example-appInitialise the submodule in an existing clone git submodule update --init
Result: The repository and its realworld submodule are available for installing dependencies.
Install and run the application
Use this procedure to install the project, start its development server, or create a production build for preview.
Prerequisites
- The repository and
realworldsubmodule are available.
Steps
-
Install the project dependencies by running:
bashbun install -
Choose the way you want to run the project:
If you need to… Run Develop with hot reload bun run serveCreate a production build bun run buildPreview the production build bun run preview -
Open
http://localhost:8080after starting the development server.
Result: The development server is available at http://localhost:8080, or the production build
is ready for preview and backend configuration.
Point Conduit to a backend
Conduit sends its API requests to a RealWorld backend. By default, it uses
https://api.realworld.show/api; use VITE_API_URL when you need to point the application to
another spec-compliant backend.
Prerequisites
- A backend URL to use when you are not using the default.
Steps
-
Choose where to set the backend URL:
If you need to… Set Use the default backend Leave VITE_API_URLunsetUse another backend for a shell command VITE_API_URL=http://localhost:8000/apibeforebun run serveUse another backend for local development Set VITE_API_URLin.env.local -
Start the application with
bun run serve.
Result: The application starts with the selected backend URL and is ready for project checks.
Test and check the project
Run the browser suite after setup, then use linting and formatting checks before sharing changes.
Prerequisites
- The project dependencies are installed.
- The development server can be started by the Playwright configuration.
Steps
-
Install the Chromium browser and its dependencies by running:
bashbunx playwright install --with-deps chromium -
Run the end-to-end test suite by running:
bashbun run test -
Check the source with ESLint by running:
bashbun run lint -
Format the source with Prettier by running:
bashbun run format
Result: The browser, end-to-end, lint, and formatting commands have been run for the project.
Was this page helpful?