Files
MyKeyser/README.md
T
2026-06-18 14:51:37 -04:00

158 lines
5.9 KiB
Markdown

# My Keyser — Tourism Website
### PHP/SQLite City Tourism Site for Keyser, West Virginia
---
## QUICK START
1. **Extract** this zip to your web server's document root (or any folder)
2. **Make the `data/` directory writable:**
```
chmod 777 data/
```
3. **Visit the site** — the database is created automatically on first load
4. **Admin login:**
- URL: `/admin/`
- Username: `administrator`
- Password: `password123`
⚠️ **Change the admin password immediately** via Admin → Settings
---
## REQUIREMENTS
- **PHP** 8.0 or higher
- **PDO SQLite** extension (enabled by default on most hosts)
- **Web server:** Apache, Nginx, or `php -S` for local dev
### Local Development (no web server needed):
```bash
cd /path/to/keyser-wv
php -S localhost:8080
# Then visit: http://localhost:8080
```
### Apache / cPanel / Shared Hosting:
- Upload all files to `public_html/` or your domain folder
- Ensure `data/` directory has write permission (chmod 777 or 755)
- No `.htaccess` needed — plain PHP files
---
## FEATURES
### Public Site
- 🏠 **Homepage** — hero banner, business stats, alerts feed, featured listings, upcoming events
- 📋 **Business Directory** — searchable/filterable grid of 60+ real Keyser WV businesses
- 🏢 **Business Detail Pages** — full info, hours, menus, reviews, alerts, Google Maps link
- ⭐ **Reviews** — star ratings and written reviews (login required)
- 🍽️ **Menus** — full menu display with sections, items, descriptions, prices
- 📢 **Alerts/News** — business owners can post announcements
- 🗺️ **Attractions** — 15+ attractions in Keyser & Mineral County
- 📅 **Events Calendar** — community event submission and display
- 📖 **About Page** — rich Keyser WV history, timeline, famous people, geography
- 🚩 **Report Button** — logged-in users can report listing errors
### User Accounts
- Sign up with username & password
- Login / Logout
- Account settings (email, password)
- Owner dashboard to manage assigned businesses
- Submit events
### Admin Panel (`/admin/`)
- **Dashboard** — stats, pending events, open reports
- **Businesses** — full CRUD: add/edit/delete, toggle active/featured, set hours
- **Categories** — manage business categories with emoji icons
- **Menus** — manage menu sections and items with prices for any business
- **Reviews** — approve, hide, or delete any review
- **Alerts** — post/manage business announcements
- **Attractions** — full CRUD for attractions
- **Events** — approve/reject submissions, add events, feature events
- **Users** — add/edit/delete users, reset passwords, suspend accounts
- **Assign Owners** — link users to businesses for self-management
- **Reports** — review and close user-submitted listing corrections
- **Settings** — toggle registration on/off, event approval, change admin password
---
## FILE STRUCTURE
```
keyser-wv/
├── index.php # Homepage
├── directory.php # Business directory + search
├── business.php # Business detail page
├── menu.php # Owner menu manager
├── attractions.php # Attractions page
├── events.php # Events calendar + submission
├── about.php # About Keyser WV history
├── login.php # Login
├── register.php # Registration
├── logout.php # Logout
├── account.php # Account settings
├── dashboard.php # User/owner dashboard
├── includes/
│ ├── boot.php # Bootstrap (session + DB init)
│ ├── db.php # Database, schema, seed data
│ ├── functions.php # Auth, helpers, CSRF, stars
│ ├── header.php # HTML header + navbar
│ └── footer.php # Footer + JS
├── admin/
│ ├── index.php # Admin dashboard
│ ├── businesses.php # Manage businesses
│ ├── categories.php # Manage categories
│ ├── menus.php # Manage all menus
│ ├── reviews.php # Manage reviews
│ ├── alerts.php # Manage alerts
│ ├── attractions.php # Manage attractions
│ ├── events.php # Manage events
│ ├── users.php # Manage users
│ ├── owners.php # Assign owners to businesses
│ ├── reports.php # Handle listing reports
│ └── settings.php # Site settings + password
├── assets/
│ ├── css/style.css # Complete dark WV theme
│ └── js/app.js # Nav, dropdowns, confirm dialogs
└── data/
└── keyser.db # SQLite database (auto-created)
```
---
## PRE-LOADED DATA
The database is seeded on first run with real Keyser WV data:
- **60+ businesses** across 13 categories (dining, retail, healthcare, education, etc.)
- **Full menus** for Castiglia's Italian Eatery, The Candlewyck Inn, and Queens Point Coffee
- **6 sample alerts** from real local businesses
- **15 attractions** in Keyser & Mineral County
- **7 events** including Mineral County Fair, Christmas Parade, PSC Athletics
- **1 admin account** (administrator / password123)
---
## DESIGN
- **Dark theme** with West Virginia colors: Gold (#c9a84c) + Navy (#1a3a5c) on near-black
- **Fonts:** Playfair Display (headings), Oswald (labels), Source Sans 3 (body)
- **Fully responsive** — mobile, tablet, desktop
- **Animated hero** with mountain silhouette and wind turbines
- **No external dependencies** — pure PHP, SQLite, vanilla CSS/JS
---
## SECURITY
- CSRF tokens on all POST forms
- Password hashing with bcrypt
- HTML output escaped with `htmlspecialchars()`
- Admin pages require `is_admin = 1`
- Session regeneration on login/logout
- Prepared statements everywhere (SQL injection prevention)
---
*Built for Keyser, West Virginia — The Friendliest City in the U.S.A.*