Prerequisites
Before you begin, ensure you have the following installed:Node.js
Version 20.19 or higher required
Docker
Version 1.13 or higher for running the API backend
Development Environment Setup
Kitsu uses a Docker-based development workflow that works on Windows, Linux, and macOS.Step 1: Start the Backend API
First, launch the CGWire Docker container which provides the Kitsu API and event server:- Kitsu API server (Zou)
- PostgreSQL database
- Redis for caching
- Socket.io event server
Step 2: Configure Environment Variables
Set the API and event endpoints to point to your Docker container:On Linux, you may need to use
localhost instead of docker-machine ip if Docker is running natively.Step 3: Clone and Install
Clone the Kitsu repository and install dependencies:Step 4: Start Development Server
Launch the Vite development server:http://localhost:5173 (default Vite port).
Development Server Features
The Vite development server provides:Hot Module Replacement (HMR)
Hot Module Replacement (HMR)
Changes to Vue components, JavaScript, and CSS are instantly reflected in the browser without a full page reload.
Fast Refresh
Fast Refresh
Component state is preserved during updates, making development faster and more efficient.
Source Maps
Source Maps
Full source map support for debugging with your browser’s developer tools.
Error Overlay
Error Overlay
Build errors and runtime errors are displayed directly in the browser.
Project Configuration
Vite Configuration
Kitsu uses Vite for building and development. The configuration is located invite.config.js at the project root.
ESLint Configuration
Code quality is enforced through ESLint with the following plugins:eslint-plugin-vue- Vue.js specific linting ruleseslint-plugin-prettier- Prettier integrationeslint-plugin-promise- Promise best practices
Git Hooks
Kitsu uses Husky for git hooks with lint-staged:- Pre-commit: Runs ESLint on staged JavaScript and Vue files
- Ensures code quality before commits
Testing
Kitsu uses Vitest for unit testing:tests/unit/ and use:
- Vitest - Fast unit test framework
- @vue/test-utils - Vue component testing utilities
- jsdom - DOM implementation for testing
- vitest-localstorage-mock - localStorage mocking
Common Issues
Port already in use
Port already in use
If Vite can’t start because port 5173 is in use, you can specify a different port:
API connection errors
API connection errors
Verify that:
- Docker container is running:
docker ps - Environment variables are set correctly
- You can access the API at
http://localhost/apiin your browser
Node version mismatch
Node version mismatch
Kitsu requires Node.js 20.19 or higher. Use nvm to manage Node versions:
Module not found errors
Module not found errors
Try removing node_modules and reinstalling:
IDE Setup
VS Code (Recommended)
Install these extensions for the best experience:- Volar - Vue 3 language support
- ESLint - JavaScript linting
- Prettier - Code formatting
WebStorm/IntelliJ
WebStorm has built-in support for Vue.js, Vuex, and Vue Router.Next Steps
Now that your environment is set up:Architecture
Learn about Kitsu’s architecture
Contributing
Start contributing to Kitsu
