How to Build Your First Project with QBCreator (Step-by-Step)
This guide walks you through building your first project with QBCreator, from installation to a working prototype. I assume you want a simple, practical app so you can learn core concepts quickly.
What you’ll build
A small CRUD (Create, Read, Update, Delete) note app with a list of notes, a form to add/edit notes, and local persistence.
Prerequisites
- QBCreator installed (assume latest stable release)
- Basic familiarity with the QBCreator interface
- A code editor (optional)
- A test device or emulator
Step 1 — Create a new project
- Open QBCreator and click New Project.
- Choose the “Blank App” template (or “Starter App” if available).
- Set project name: MyNotes. Set package/ID and choose your target platform(s).
- Click Create.
Step 2 — Project structure overview
- src/ — application source files
- assets/ — images, icons, static files
- components/ — reusable UI pieces (create this folder)
- data/ — local persistence helpers (create this folder)
Step 3 — Design the UI
Create two main screens: NotesList and NoteEditor.
NotesList (components/NotesList.qb)
- Header with title “MyNotes” and an Add button (+).
- Scrollable list showing note titles and excerpt.
- Each list item: title, timestamp, and Edit/Delete actions.
NoteEditor (components/NoteEditor.qb)
- Text input for Title (single-line).
- Textarea for Body (multi-line).
- Buttons: Save and Cancel.
Use QBCreator’s visual editor to drag components, or define layout in code if you prefer.
Step 4 — Data model
Create a simple Note model (data/note.qb):
- id: string (UUID)
- title: string
- body: string
- createdAt: ISO timestamp
- updatedAt: ISO timestamp
Example (pseudocode):
Code
class Note { id title body createdAt updatedAt }
Step 5 — Local persistence
Use QBCreator’s local storage API (or filesystem) to save notes as JSON.
Create data/storage.qb with functions:
- getAllNotes(): load array from localStorage key “mynotes” (or file)
- saveAllNotes(notes): stringify and save
- addNote(note): append and save
- updateNote(note): replace by id and save
- deleteNote(id): remove by id and save
Example pseudocode:
Code
function getAllNotes() { raw = localStorage.getItem(“mynotes”) || “[]” return JSON.parse(raw) }
Step 6 — Wire UI to data
- On app start, call getAllNotes() and populate NotesList.
- Add button: open NoteEditor in “create” mode with empty fields.
- Save in NoteEditor:
- If creating: generate UUID, set createdAt/updatedAt, call addNote().
- If editing: set updatedAt, call updateNote().
- After save: close editor and refresh NotesList.
- Delete action: confirm, call deleteNote(id), refresh list.
Step 7 — Implement navigation & state
- Use QBCreator’s navigation stack (or component visibility) to switch between screens.
- Keep a simple app state object:
- notes: []
- currentNote: null
- mode: “list” | “edit” | “create”
Update state reactively so UI reflects changes immediately.
Step 8 — Validation & UX polish
- Require a title (show inline error if empty).
- Auto-save draft when navigating away (optional).
- Show toast/snackbar on save/delete.
- Sort notes by updatedAt descending.
Step 9 — Testing
- Add, edit, delete notes; verify persistence across app restarts.
- Test on target platforms and fix layout issues.
Step 10 — Build & deploy
- Use QBCreator’s build tools to generate the platform-specific artifact (APK, IPA, web bundle).
- Follow platform guidelines for signing and publishing.
Example folder/file map
- src/
- components/
- NotesList.qb
- NoteEditor.qb
- data/
- note.qb
- storage.qb
- App.qb
- components/
- assets/
Quick checklist before finishing
- Title validation working
- Persistence verified across restarts
- Navigation smooth and state consistent
- UI responsive on target screens
If you want, I can generate starter code for NotesList, NoteEditor, and storage functions tailored to QBCreator’s scripting syntax—tell me whether you prefer visual-editor steps or full code files.