Template
README po polsku
This commit is contained in:
@@ -1,43 +1,46 @@
|
|||||||
# Nuxt Boilerplate
|
# Nuxt Boilerplate
|
||||||
|
|
||||||
Starter for the Nuxt coursework workspace: Bun + Nuxt + TypeScript + Tailwind,
|
Szablon startowy do zajęć z Nuxt: Bun + Nuxt + TypeScript + Tailwind, z
|
||||||
with MySQL (Drizzle ORM) and Redis wired up to the shared course databases.
|
podpiętym MySQL (Drizzle ORM) i Redisem do wspólnych baz danych z kursu.
|
||||||
|
|
||||||
## Development
|
## Uruchomienie
|
||||||
```bash
|
```bash
|
||||||
bun install
|
bun install
|
||||||
bun run db:push # creates the `notes` table from server/db/schema.ts
|
bun run db:push # tworzy tabelę `notes` z server/db/schema.ts
|
||||||
bun run dev
|
bun run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Open http://localhost:3000 - the home page shows a small notes list (MySQL)
|
Strona główna pokazuje krótką listę notatek (MySQL) i pole klucz/wartość
|
||||||
and a key/value box (Redis) so you can see both connections working.
|
(Redis), żeby od razu było widać, że oba połączenia działają.
|
||||||
|
|
||||||
## What's here
|
## Co tu jest
|
||||||
- `app/pages/index.vue` - example page using `<template lang="pug">`, calling
|
- `app/pages/index.vue` - przykładowa strona z `<template lang="pug">`,
|
||||||
the API routes below via `useFetch`/`$fetch`. Delete once you understand the
|
która korzysta z endpointów opisanych niżej przez `useFetch`/`$fetch`.
|
||||||
pattern and start building your own pages.
|
Usuń ją, gdy zrozumiesz zasadę działania i zaczniesz tworzyć własne strony.
|
||||||
- `server/api/notes.get.ts` / `notes.post.ts` - example MySQL reads/writes via
|
- `server/api/notes.get.ts` / `notes.post.ts` - przykładowy odczyt i zapis
|
||||||
Drizzle.
|
do MySQL przez Drizzle.
|
||||||
- `server/api/cache/[key].get.ts` / `[key].put.ts` - example Redis reads/writes.
|
- `server/api/cache/[key].get.ts` / `[key].put.ts` - przykładowy odczyt i
|
||||||
- `server/db/schema.ts` - your Drizzle table definitions. Add tables here, then
|
zapis do Redisa.
|
||||||
run `bun run db:push` to sync them to MySQL (no migration files needed for
|
- `server/db/schema.ts` - definicje tabel w Drizzle. Dodawaj tu kolejne
|
||||||
coursework - `push` just diffs your schema against the live database).
|
tabele, a potem uruchom `bun run db:push`, żeby zsynchronizować je z bazą
|
||||||
- `server/db/index.ts` / `server/utils/redis.ts` - pre-configured clients,
|
MySQL (bez plików migracji - `push` po prostu porównuje schemat z bazą
|
||||||
reading connection details from environment variables. In your Coder
|
na żywo).
|
||||||
workspace these are already set for you (`MYSQL_*`, `REDIS_*`) - you never
|
- `server/db/index.ts` / `server/utils/redis.ts` - gotowe klienty, które
|
||||||
need to type a password into code.
|
czytają dane połączenia ze zmiennych środowiskowych. W Twoim workspace
|
||||||
- `.env.example` - only needed if you want to run this outside your Coder
|
w Coderze są one już ustawione (`MYSQL_*`, `REDIS_*`) - nie musisz nigdzie
|
||||||
workspace, against your own local MySQL/Redis.
|
wpisywać hasła.
|
||||||
- `.gitea/workflows/deploy.yml` - deploys to Vercel on push to `main`, but
|
- `.env.example` - potrzebne tylko, jeśli chcesz uruchomić projekt poza
|
||||||
only if you've set `VERCEL_TOKEN` (and `VERCEL_ORG_ID`/`VERCEL_PROJECT_ID`)
|
workspace'em w Coderze, na własnym MySQL/Redis.
|
||||||
as repo secrets. Without them the job is skipped - nothing breaks.
|
- `.gitea/workflows/deploy.yml` - wdraża projekt na Vercel przy pushu do
|
||||||
|
`main`, ale tylko jeśli ustawisz `VERCEL_TOKEN` (i `VERCEL_ORG_ID`/
|
||||||
|
`VERCEL_PROJECT_ID`) jako sekrety repozytorium. Bez nich zadanie jest
|
||||||
|
pomijane - nic się nie psuje.
|
||||||
|
|
||||||
## Notes
|
## Uwagi
|
||||||
- Your Redis user can only touch keys under `student:<your-username>:*`
|
- Twój użytkownik Redis widzi tylko klucze pod `student:<twoja-nazwa>:*`
|
||||||
(enforced by the server) - that's why the cache routes prefix keys with
|
(wymuszone po stronie serwera) - dlatego endpointy cache dodają ten
|
||||||
`REDIS_USERNAME`. Keys outside that prefix will be rejected.
|
prefiks do kluczy. Klucze spoza tego prefiksu zostaną odrzucone.
|
||||||
- Your MySQL user only has access to your own database - no need to specify
|
- Twój użytkownik MySQL ma dostęp tylko do swojej własnej bazy - nie musisz
|
||||||
it beyond what's already in `MYSQL_DATABASE`.
|
nic dodatkowo podawać poza tym, co jest już w `MYSQL_DATABASE`.
|
||||||
- Tailwind classes are available everywhere via `@nuxtjs/tailwindcss` - no
|
- Klasy Tailwinda działają wszędzie dzięki `@nuxtjs/tailwindcss` - do
|
||||||
extra CSS file needed for basic usage.
|
podstawowego użycia nie potrzeba dodatkowego pliku CSS.
|
||||||
|
|||||||
Reference in New Issue
Block a user