ποΈ Tiny Notes
A single-file PHP 8+ + SQLite + Bootstrap 5 notes application.
Includes:
- User authentication (first registered user becomes admin)
- CSRF protection
- Secure sessions
- Create / edit / delete notes (per-user)
- Mobile-friendly Bootstrap UI
- Zero dependencies (just PHP & SQLite)
π Quick start
-
Clone this repo:
git clone https://github.com/yourname/tiny-notes.git cd tiny-notes -
Run with PHPβs built-in server:
php -S 127.0.0.1:8000 index.php
-
Open http://127.0.0.1:8000 in your browser.
-
The first visitor is prompted to create an admin account.
After that, log in with those credentials.
π Project structure
index.php # Entire app (PHP + HTML + Bootstrap)
data/ # Created at runtime; contains app.sqlite database
.gitignore # Prevents committing database/session junk
README.md # This file
π Security notes
- Sessions use
HttpOnly+SameSite=Lax; cookies aresecureif HTTPS. - CSRF tokens are required for all POST requests.
- Database file (
data/app.sqlite) is in.gitignoreβ never commit it. - For production on Apache or Nginx, block direct web access to
/data/.
Example .htaccess for Apache:
# Prevent access to the database directory
RedirectMatch 403 ^/data/π οΈ Requirements
- PHP 8.1 or higher
- SQLite 3
- A writable filesystem (for
data/)
β¨ Features roadmap (ideas)
- Multi-user roles (admin vs. normal users)
- Password reset / change password
- Markdown rendering for note bodies
- File attachments
π License
MIT β do whatever you like, just donβt remove attribution.
On this page
Contributors
Created August 23, 2025
Updated August 23, 2025