{"id":27966570,"url":"https://github.com/tobysolutions/school-complaints-api","last_synced_at":"2026-02-02T06:38:42.473Z","repository":{"id":282089395,"uuid":"945555671","full_name":"tobySolutions/school-complaints-api","owner":"tobySolutions","description":"This is the backend for the school complaints API codebase","archived":false,"fork":false,"pushed_at":"2025-03-09T17:42:56.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-15T12:18:48.020Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Blade","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tobySolutions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-09T17:42:09.000Z","updated_at":"2025-03-09T17:43:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"6768cc85-bf73-4fae-8a1c-f538501b6a38","html_url":"https://github.com/tobySolutions/school-complaints-api","commit_stats":null,"previous_names":["tobysolutions/school-complaints-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tobySolutions/school-complaints-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobySolutions%2Fschool-complaints-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobySolutions%2Fschool-complaints-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobySolutions%2Fschool-complaints-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobySolutions%2Fschool-complaints-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobySolutions","download_url":"https://codeload.github.com/tobySolutions/school-complaints-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobySolutions%2Fschool-complaints-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29007294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T06:37:10.400Z","status":"ssl_error","status_checked_at":"2026-02-02T06:37:09.383Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T20:19:36.719Z","updated_at":"2026-02-02T06:38:42.447Z","avatar_url":"https://github.com/tobySolutions.png","language":"Blade","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📌 School Complaints API\n\n## 📖 Overview\nThe **School Complaints API** is a backend system built with **Laravel** that allows students to submit complaints against lecturers, track their status, and receive responses. Lecturers can respond to complaints, change their status, and mark them as resolved.\n\n## 🚀 Features\n- **User Authentication** (Students \u0026 Lecturers)\n- **Complaint Submission \u0026 Tracking**\n- **Lecturer Response Management**\n- **Seeding Default Users \u0026 Departments**\n- **RESTful API Endpoints**\n\n---\n\n## 📂 Project Setup\n\n### 1️⃣ **Clone the Repository**\n```sh\ngit clone \u003cyour-repository-url\u003e\ncd school-complaints-api\n```\n\n### 2️⃣ **Install Dependencies**\n```sh\ncomposer install\n```\n\n### 3️⃣ **Set Up Database Locally**\n\n#### **Install MySQL (if not installed)**\n```sh\nbrew install mysql\n```\n\n#### **Start MySQL Service**\n```sh\nbrew services start mysql\n```\n\n#### **Login to MySQL \u0026 Create Database**\n```sh\nmysql -u root -p\n```\nThen, inside MySQL:\n```sql\nCREATE DATABASE school_complaints;\nEXIT;\n```\n\n#### **Verify MySQL is Running**\n```sh\nmysqladmin -u root -p status\n```\n\n### 4️⃣ **Set Up Environment Variables**\nCopy the `.env.example` file and rename it to `.env`:\n```sh\ncp .env.example .env\n```\nEdit `.env` and update the database credentials:\n```\nDB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_PORT=3306\nDB_DATABASE=school_complaints\nDB_USERNAME=root\nDB_PASSWORD=newpassword\n```\n\n### 5️⃣ **Generate Application Key**\n```sh\nphp artisan key:generate\n```\n\n### 6️⃣ **Run Database Migrations \u0026 Seeding**\n```sh\nphp artisan migrate:fresh --seed\n```\n✅ **This will drop all tables, recreate them, and seed default users.**\n\n### 7️⃣ **Start Laravel Development Server**\n```sh\nphp artisan serve\n```\nServer will be running at:\n```sh\nhttp://127.0.0.1:8000\n```\n\n---\n\n## 🔑 Default Users (Seeded Data)\n\n| Name              | Email                | Password     | Role    |\n|------------------|---------------------|-------------|---------|\n| Alice Johnson    | alice@example.com   | password123 | Student |\n| Bob Anderson     | bob@example.com     | password123 | Student |\n| Charlie Brown    | charlie@example.com | password123 | Student |\n| David Green      | david@example.com   | password123 | Student |\n| Dr. Smith        | smith@example.com   | password123 | Lecturer |\n| Prof. Johnson    | johnson@example.com | password123 | Lecturer |\n| Dr. Williams     | williams@example.com | password123 | Lecturer |\n| Dr. Evans        | evans@example.com   | password123 | Lecturer |\n\n---\n\n## 📌 API Endpoints\n\n### 🔑 **Authentication**\n| Method | Endpoint      | Description |\n|--------|--------------|-------------|\n| POST   | `/api/register` | Register a new user |\n| POST   | `/api/login` | Login and receive user details |\n\n### 🏫 **Students \u0026 Lecturers**\n| Method | Endpoint           | Description |\n|--------|-------------------|-------------|\n| GET    | `/api/students/{id}` | Get student details (with department \u0026 courses) |\n| GET    | `/api/lecturers/{id}` | Get lecturer details (with department) |\n\n### 🏛 **Departments \u0026 Courses**\n| Method | Endpoint           | Description |\n|--------|-------------------|-------------|\n| GET    | `/api/departments/{id}` | Get department details (with courses) |\n\n### 📝 **Complaints**\n| Method | Endpoint                      | Description |\n|--------|------------------------------|-------------|\n| POST   | `/api/complaints`             | Submit a complaint |\n| GET    | `/api/complaints/{id}`        | Get complaint details |\n| PUT    | `/api/complaints/{id}/status` | Update complaint status |\n| POST   | `/api/complaints/{id}/comments` | Lecturer responds to complaint |\n\n---\n\n## 🛠 **Troubleshooting**\n\n### ❌ `SQLSTATE[42S22]: Column not found: 1054 Unknown column 'role'`\n✅ Ensure your `users` table has the `role` column. If missing, rerun migrations:\n```sh\nphp artisan migrate:fresh --seed\n```\n\n### ❌ `401 Unauthorized` when logging in\n✅ Clear the cache and restart the Laravel server:\n```sh\nphp artisan cache:clear\nphp artisan config:clear\nphp artisan route:clear\nphp artisan serve\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobysolutions%2Fschool-complaints-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobysolutions%2Fschool-complaints-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobysolutions%2Fschool-complaints-api/lists"}