https://github.com/can-lehmann/owlkettle-crud
An example of a simple CRUD application in owlkettle
https://github.com/can-lehmann/owlkettle-crud
crud example nim
Last synced: about 1 month ago
JSON representation
An example of a simple CRUD application in owlkettle
- Host: GitHub
- URL: https://github.com/can-lehmann/owlkettle-crud
- Owner: can-lehmann
- License: mit
- Created: 2023-04-07T15:39:53.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-27T14:41:59.000Z (about 2 years ago)
- Last Synced: 2025-04-09T16:18:05.401Z (about 1 month ago)
- Topics: crud, example, nim
- Language: Nim
- Homepage:
- Size: 85.9 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Owlkettle CRUD Example
A simple CRUD (Create, Read, Update, Delete) example application created using [owlkettle](https://github.com/can-lehmann/owlkettle).
It uses `owlkettle` for creating the user interface and `tiny_sqlite` for storing the entities.
The application manages a list of users.
Each user has a first and last name as well as an automatically generated ID.
The users are saved in an SQLite database.## Installation
Running this example requires that `GTK4` is installed on your system.
See [the owlkettle installation guide](https://github.com/can-lehmann/owlkettle#installation) for more details.```bash
$ git clone https://github.com/can-lehmann/owlkettle-crud
$ cd owlkettle-crud
$ nimble install owlkettle@#head
$ nimble install tiny_sqlite
$ nim compile -r src/main.nim
```## Project Structure
The architecture of the application consists of two parts:
The `model` defines the `User` entity and the `UserModel` object which is used to manage all `User` entities.
The `view` specifies the owlkettle widgets used to display the users in a GUI.The following shows the directory structure of the project:
- **src**: Main source files for the application
- **model**: The data model
- [user_model.nim](src/model/user_model.nim): `UserModel`, `User`, `UserId`
- **view**: The custom widgets defined by the application
- [user_list.nim](src/view/user_list.nim): `UserList` widget
- [search_bar.nim](src/view/search_bar.nim): `SearchBar` widget
- [edit_user_dialog.nim](src/view/edit_user_dialog.nim): `EditUserDialog`
- [user_editor.nim](src/view/user_editor.nim): `UserEditor` widget
- [app_menu_button.nim](src/view/app_menu_button.nim): `AppMenuButton` widget
- [main.nim](src/main.nim): Entry point for the application and `App` widget
- **assets**: Images used for documentation
- **icons**: Additional icons used in the application## Widgets
The following screenshots show how the custom widgets defined in src/view are used in the application.

The `EditUserDialog` is used for creating and updating users.
See [edit_user_dialog.nim](src/view/edit_user_dialog.nim) for details.
## Funding
The funding for this example was donated by [itwrx.org](https://itwrx.org/) ([@ITwrx](https://github.com/ITwrx)).
## License
This example is licensed under the MIT license.
See `LICENSE.txt` for more information.The files in `icons/` are created by Font Awesome and licensed under the CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/).