1.2 KiB
1.2 KiB
Quickstart: Frontend Development
Prerequisites
- Node.js 18+
- npm
Setup
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
Running the Development Server
npm run dev
The application will be available at http://localhost:5173.
Using Standard UI Components
Import components from $lib/ui:
<script>
import { Button, Input } from '$lib/ui';
</script>
<Input label="Username" bind:value={username} />
<Button variant="primary" onclick={submit}>Submit</Button>
Using Internationalization
Import the t store from $lib/i18n:
<script>
import { t } from '$lib/i18n';
</script>
<h1>{$t.dashboard.title}</h1>
<button>{$t.common.save}</button>
Adding New Translations
- Open
frontend/src/lib/i18n/locales/ru.jsonand add the new key-value pair. - Open
frontend/src/lib/i18n/locales/en.jsonand add the corresponding English translation.
Adding New Components
- Create a new
.sveltefile infrontend/src/lib/ui/. - Define props and styles using Tailwind CSS.
- Export the component in
frontend/src/lib/ui/index.ts.