# MTU-DSpace — Institutional Repository

**MTU-DSpace** is the official digital repository system for **Mountain Top University**, built on Laravel 12. It provides a modern, lightweight, and fully open-access platform for managing, preserving, and disseminating the intellectual output of the MTU academic community — including theses, dissertations, journal articles, conference papers, and research datasets.

---

## 🚀 Overview

Modelled after the [DSpace](https://dspace.lyrasis.org/) standard used globally by academic institutions (including UNILAG, UI, and Oxford), MTU-DSpace provides a purpose-built, maintainable alternative without the overhead of the full Java stack. It adheres to international library and open-access standards.

---

## ✨ Features

### Public Discovery
- 🏛 **Communities & Collections** — hierarchical academic structure (Faculty → Department → Items)
- 🔍 **Browse & Search** — filter by Issue Date, Author, Title, Subject, or Subject Category
- 📄 **Item Detail Pages** — full Dublin Core metadata display, "How to Cite" citation block, and persistent UUID-based URLs
- 📊 **Statistics Page** — repository health metrics, subject category breakdown, and compliance tracker
- 🔗 **Persistent Identifiers** — every item gets a stable UUID-based URL that never changes

### Admin Panel
- 👥 **User Management** — list, provision, edit, enable/disable accounts; roles: `user`, `staff`, `admin`
- 🏛 **Community Management** — full CRUD (create, edit, delete) with auto-generated slugs
- 📁 **Collection Management** — create and organise collections under communities
- 📄 **Item Management** — edit Dublin Core metadata inline, publish/unpublish toggle, permanent delete
- 🔐 **Role-based Access Control** — admin middleware guards all management routes

### Authentication
- 📧 **Standard Email/Password** login with session-based auth
- 🔑 **Google OAuth** (via Socialite) for institution-linked Google accounts
- 🛡 **Account Status** — disabled accounts are blocked from logging in

---

## 🛠 Tech Stack

| Layer | Technology |
|---|---|
| **Framework** | Laravel 12.x |
| **Database** | SQLite (dev) / MySQL (prod) |
| **Frontend** | Tailwind CSS (CDN), Blade Templates |
| **Auth** | Custom + Laravel Socialite (Google OAuth) |
| **Metadata** | Dublin Core via EAV (Entity-Attribute-Value) engine |
| **Storage** | Local disk (configurable for S3) |

---

## 📋 Database Architecture

```
communities          — Faculties/Colleges (top-level groupings)
  └─ collections     — Departments/Journals (sub-groupings)
       └─ items       — The actual research objects (UUID-keyed)
            ├─ metadata_values  — Dublin Core descriptors (EAV)
            └─ bitstreams        — Uploaded files (PDFs, data)

metadata_fields      — Registry of DC elements (title, author, subject, etc.)
users                — Accounts with roles (user | staff | admin)
```

---

## 🗺 Implementation Roadmap

| Phase | Description | Status |
|---|---|---|
| **Phase 1** | Foundation & Custom Auth (Email + Google OAuth) | ✅ Done |
| **Phase 2** | Core Data Engine (Migrations, Models, UUIDs, Slugs) | ✅ Done |
| **Phase 3** | Admin Panel (Users, Communities, Collections, Items) | ✅ Done |
| **Phase 4** | Submission Wizard (multi-step deposit form) | 🔄 Planned |
| **Phase 5** | Discovery & Public Interface | ✅ Done |
| **Phase 6** | Knowledge Base & Advocacy Pages | 🔄 Planned |
| **Phase 7** | OAI-PMH Compliance, Schema.org, Handles | 🔄 Planned |
| **Phase 8** | Performance, Caching, Security Audit | 🔄 Planned |

---

## ⚡ Quick Start

### Prerequisites
- PHP 8.2+
- Composer
- Node.js & npm (optional, Tailwind via CDN in dev)

### Installation

```bash
# 1. Clone the repository
git clone <repo-url> mtu-dspace
cd mtu-dspace

# 2. Install PHP dependencies
composer install

# 3. Configure environment
cp .env.example .env
php artisan key:generate

# 4. Set up database (SQLite by default)
touch database/database.sqlite

# 5. Run migrations and seed sample data
php artisan migrate --seed

# 6. Start development server
php artisan serve
```

The application will be available at `http://127.0.0.1:8000`.

**Default Admin Credentials:**
```
Email:    admin@mtu.edu.ng
Password: password
```

---

## � Key Routes

| URL | Description |
|---|---|
| `/` | Public landing page |
| `/browse` | Search & browse all items |
| `/communities` | All community listings |
| `/community/{slug}` | Single community & its collections |
| `/item/{uuid}` | Item detail (metadata, citation, download) |
| `/statistics` | Repository metrics |
| `/admin/users` | Admin: user management |
| `/admin/communities` | Admin: community management |
| `/admin/collections` | Admin: collection management |
| `/admin/items` | Admin: item management |
| `/login` | Authentication |

---

## 🌍 Similar Repositories (Reference)

- [UNILAG Institutional Repository](https://ir.unilag.edu.ng)
- [University of Ibadan Repository](https://repository.ui.edu.ng)

---

## 📜 License & Attribution

This project is developed and maintained for **Mountain Top University** Library.  
Built with ❤️ on Laravel 12. Metadata standards follow the [Dublin Core Metadata Initiative](https://dublincore.org/).

For queries, contact: **librarian@mtu.edu.ng**
