https://github.com/zaxwebs/php-single-file-crud
https://github.com/zaxwebs/php-single-file-crud
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zaxwebs/php-single-file-crud
- Owner: zaxwebs
- Created: 2025-08-23T09:31:39.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-23T09:33:56.000Z (11 months ago)
- Last Synced: 2025-10-19T14:49:40.833Z (9 months ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ποΈ 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
1. Clone this repo:
```bash
git clone https://github.com/yourname/tiny-notes.git
cd tiny-notes
```
2. Run with PHPβs built-in server:
```bash
php -S 127.0.0.1:8000 index.php
```
3. Open in your browser.
4. 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 are `secure` if 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:
```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.