๐ My Dashboard API
Secure PHP API for Mobile App Authentication
โ
Fully Operational
๐ API Base URL
https://my.sleekwebsite.design/api
๐ฏ Quick Actions
๐ API Endpoints
POST/api/register
Register a new user account
POST/api/login
Authenticate user and create session
GET/api/profile
Get current user profile (requires authentication)
POST/api/logout
End current user session
๐ Documentation
๐
README
Complete API documentation with examples, request/response formats, and usage guide.
๐
Deployment Guide
Production deployment checklist, configuration, security hardening, and troubleshooting.
โ
Setup Summary
Complete overview of the implementation with quick start guide and testing checklist.
๐ Security Features
- Password hashing with bcrypt (cost factor 12)
- SQL injection prevention (prepared statements)
- XSS prevention (input sanitization & output encoding)
- Session-based authentication with secure cookies
- Rate limiting (5 attempts per 5 minutes)
- CORS support for cross-origin requests
- Security headers (X-Frame-Options, CSP, etc.)
- Input validation and required field checks
- Password strength requirements
- Email format validation
- Directory protection via .htaccess
- 24-hour session timeout
๐ป Technology Stack
- Backend: PHP with PDO
- Database: MySQL/MariaDB
- Authentication: Session-based with bcrypt
- Security: Prepared statements, input validation, XSS prevention
- API Format: JSON (REST)
- CORS: Configurable cross-origin support
๐ฑ Mobile Integration
Request Format
Send JSON data with Content-Type: application/json header. Include credentials for session persistence.
Response Format
Standardized JSON with status (bool), code (int), message (string), and optional data object.
Session Management
Cookie-based sessions. Enable credentials in requests. Sessions expire after 24 hours.
๐งช Testing
๐ Database
Tables Created
- users: User accounts (email, firstname, lastname, address, password, timestamps)
- sessions: Session management (optional advanced feature)
- audit_log: Security audit trail (optional feature)