🐰 Rabbhit System API

Project Management System REST API - Ready for Hostinger Deployment

⚠️ Setup Required: Before using this API, please:
  1. Update database credentials in /config/config.php
  2. Run database migrations in /migrations/
  3. Set proper file permissions on /storage/ directory

🔐 Authentication Endpoints

POST /api/auth/login

User login with email and password

Body: {"email": "user@example.com", "password": "password123"}
POST /api/auth/logout

User logout (requires authentication)

GET /api/auth/csrf-token

Get CSRF token for form submissions

POST /api/auth/refresh

Refresh session and get new CSRF token

📋 Project Management

GET /api/projects

List all projects (with pagination and filtering)

Query Params: ?page=1&limit=20&client_id=123&summary=true
POST /api/projects (Admin only)

Create a new project

Body: {"name": "New Project", "client_id": 123, "description": "...", "deadline": "2024-12-31", "budget": 5000}
GET /api/projects?id=123

Get specific project details

PUT /api/projects?id=123

Update project details

DELETE /api/projects?id=123 (Admin only)

Delete a project

🎯 Milestones & Tasks

GET /api/milestones?project_id=123

List project milestones

POST /api/milestones (Admin only)

Create milestone

GET /api/tasks?project_id=123

List project tasks (filterable by milestone, status, priority)

Query Params: ?project_id=123&milestone_id=456&status=in_progress&priority=high
POST /api/tasks (Admin only)

Create task

📁 File Management

GET /api/files?project_id=123

List project files

POST /api/files

Upload file (multipart/form-data)

Form Data: file, project_id, task_id (optional), description (optional)
GET /api/files?id=123&download=true

Download file

DELETE /api/files?id=123

Delete file (owner or admin only)

💬 Messaging System

GET /api/messages?project_id=123

List project messages

Query Params: ?project_id=123&thread_id=456&mark_read=true
POST /api/messages

Send message

Body: {"project_id": 123, "subject": "Hello", "content": "Message content", "parent_id": 456}

🔒 Security Features

📊 Response Format

All API responses follow a consistent JSON format:

Success: {"success": true, "data": {...}}
Error: {"success": false, "error": "Error message"}
Validation Error: {"success": false, "error": "Validation failed", "errors": {"field": ["Error message"]}}

🚀 Deployment Notes

🎉 Your Rabbhit System API is ready for deployment!

Update the configuration, run the migrations, and start managing projects efficiently.