# nuxt-prawo-jazdy

## Required

### db

A python script at [db-prawo-jazdy](https://git.mandarynki.eu/netman/db-prawo-jazdy) is designed to convert the CSV(s) to a SQLite database for use here. When you acquire your database via that script, insert it at your desired path (default `./db/database.db`) and change the `DATABASE_URL` environment value in `.env`. Visit [db-prawo-jazdy](https://git.mandarynki.eu/netman/db-prawo-jazdy) for more details.

The database from November 2025 is included here at `./db/database.db`

### media

A shell script at [media-prawo-jazdy](https://git.mandarynki.eu/netman/media-prawo-jazdy) for media files ([available on the website of the Ministry of Infrastructure](https://www.gov.pl/web/infrastruktura/prawo-jazdy) under the link title `Pytania egzaminacyjne na prawo jazdy`) will convert (copy) all `.wmv` files to `.mp4` and copy all `.jpeg` files to `.jpg`. When you have all media and the script completed successfully, host these files on a webserver of your choice (e.g. apache, nginx), and change the `CDN_URL` environment value in `.env` to your webserver URL including the folder path to the media files. Visit [media-prawo-jazdy](https://git.mandarynki.eu/netman/media-prawo-jazdy) for more details.

## To-do:

- [x] re-forge database structure (good for now)
- [x] come up with how to show results appropriately
- [x] better answer click recognition
- [x] beautify website (good for now)
- [x] <b>Fixed?</b> Needs more testing, but should be fine. (question-mark?) - middleware between pages; finishing exam sometimes redirects to homepage instead of results, major issue
- [x] question timers
- [x] exam (& results?) warning leave message on exit and timer end (and definitely on refresh)
- [x] add keybinds:
  - S - start, D - next question, X - exam end, T/Y - yes, N - no, A - A, B - B, C - C
- [ ] i18n - pl, en, de, ua (<del>not all questions are available in ua, api handle</del> - already handled with sql)
  - [ ] UI i18n
    - [x] pl
    - [x] en
    - [x] de
    - [ ] <b>ua</b>
  - [x] db: examstore add language field, api handle languages (questions lang)
- [x] nuxt3 -> nuxt4 (hopefully working fine, seems to do so; so far)
- [ ] clean up js code in exam.vue and result.vue (currently a little bit of a mess)
- [ ] daisyui is stuck on 5.2.5 - newer versions break UI, reason unknown - consider moving to nuxtUI and another tailwind integration with nuxt than nuxtjs/tailwind

## Some information about the project

My intention is, to share access to test exams free of charge, you don't have to pay me - although you can, I greatly appreciate if you donate!

I'm planning to host this project publicly and to put non-invasive ads if it gains enough traction

All data used by this software is public information by definition provided in the Polish Constitution - [article 61.](https://www.sejm.gov.pl/prawo/konst/polski/kon1.htm), and can be acquired by either checking above links on the gov website, or by writing to the Ministry [(if something happened to be missing)](placeholder_for_post_about_missing_points_column) ==> (blog post to write in the future)

This project is a website mimicking an official driver's license theoritical exam (for all license categories provided by the Ministry: A, A1, A2, AM, B, B1, C, C1, D, D1, T, PT) with a seperate media http server (not included here), connected using drizzle ORM to a SQLite database

## Setup

Copy `.env.example` to `.env` and modify it to values specified in the `Required#db` and `Required#media` sections according to your case.

This project utilizes `pnpm`, thus it is recommended

```bash
pnpm install
```

### Development Server

Start the development server on `http://localhost:3000`:

```bash
pnpm run dev
```

### Production

Build the application for production:

```bash
pnpm build
```

Locally preview production build:

```bash
pnpm preview
```

Check out the [Nuxt documentation](https://nuxt.com/docs) for more information.

### [Licensing](./LICENSE) (AGPL-3.0-only)

```
nuxt-prawo-jazdy: Polish driver's license theoritical exam nuxt web app

Copyright (C) 2025 NetMan

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, AGPL-3.0-only.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
```
