An open API service indexing awesome lists of open source software.

https://github.com/pasan93/opengovui

An Open Source UI for Government Web sites and Web apps.
https://github.com/pasan93/opengovui

e-gov e-governance e-government government sri-lanka srilanka

Last synced: about 2 months ago
JSON representation

An Open Source UI for Government Web sites and Web apps.

Awesome Lists containing this project

README

          

# OpenGovUI

![Licence](https://img.shields.io/badge/licence-MIT-blue.svg)
![Version](https://img.shields.io/badge/version-2.1.0-green.svg)
![Static Template](https://img.shields.io/badge/static%20template-v1.2.0-blue.svg)
![WordPress CMS](https://img.shields.io/badge/wordpress%20cms-v2.1.0-green.svg)

image

A 100% open source modern, accessible, and multilingual website template designed specifically for government portals. Available as both a **static HTML template** and a **full WordPress CMS solution** with advanced multilingual support.

[Live Demo](https://govui.openxs.org)

## ๐Ÿš€ **Two Deployment Options**

### ๐Ÿ“„ **Option 1: Static Template** *(Recommended for simple sites)*
Perfect for straightforward government portals that don't need content management.

- **โœ… No server required** - Works with any web hosting
- **โœ… Fast loading** - Pure HTML/CSS/JavaScript
- **โœ… Easy deployment** - Just upload files
- **โœ… No database needed**

### ๐ŸŽ›๏ธ **Option 2: WordPress CMS** *(Recommended for dynamic content)*
Full content management system with advanced multilingual support and admin interface.

- **โœ… Admin dashboard** - Manage content without coding
- **โœ… Custom post types** - Services, Categories, Government Updates
- **โœ… Polylang integration** - Professional multilingual support
- **โœ… REST API** - Advanced integration capabilities
- **โœ… Content population** - Automated content creation system
- **โœ… AI Translation System** - Claude Sonnet 3.7 powered auto-translation

---

## ๐ŸŒŸ Features

### ๐Ÿ“ฑ Responsive Design
- Mobile-first approach
- Fluid layouts that work across all device sizes
- Optimised navigation for both desktop and mobile users

### โ™ฟ Accessibility
- Skip to main content functionality
- ARIA labels where necessary
- Semantic HTML structure
- Government accessibility standards compliant

### ๐ŸŒ Advanced Multilingual Support
- **Polylang Integration**: Professional WordPress multilingual plugin support
- **Language Syncing**: Automatic synchronization of meta fields across translations
- **Smart Language Detection**: Automatic language mapping and detection
- **AI-Powered Translation**: Claude Sonnet 3.7 API integration for intelligent translations
- **Auto-Translation Manager**: Automated filling of missing translations with admin interface
- **Translation Scanning**: Intelligent detection of missing translations across all content
- **Content Synchronization**: Seamless content management across all languages
- Full support for **English (en_GB, en_US)**, **Sinhala (si_LK)**, and **Tamil (ta_LK)**

### ๐ŸŽจ Design Features [[memory:3285333]]
- Clean, professional government aesthetic with rounded, easy-to-read fonts
- FontAwesome 6.5.1 icons (CDN hosted)
- Service cards with intuitive icons
- Grid-based layouts for services and topics
- Social media integration
- Custom color schemes for categories

### ๐Ÿ”ง WordPress CMS Advanced Features
- **Custom Post Types**:
- Government Services with rich metadata
- Service Categories with icons and colors
- Government Updates with featured content
- **Enhanced REST API**: Custom endpoints for all content types
- **Content Population System**: One-click content creation with sample data
- **Meta Field Management**: Service URLs, processing times, requirements, featured status
- **Admin Interface**: Custom admin pages for content management
- **Language-Aware Content**: All content respects current language context

### ๐Ÿค– AI-Powered Translation System
- **Claude Sonnet 3.7 Integration**: Advanced AI for contextually accurate translations
- **Intelligent Translation Manager**:
- Scans all content for missing translations
- Automatically fills gaps using AI
- Maintains translation consistency across the site
- **Admin Dashboard**: Easy-to-use interface for managing translations
- One-click translation scanning
- Bulk auto-translation capabilities
- Translation backup and restore
- **Multi-Language Support**: Seamlessly translates between English, Sinhala, and Tamil
- **Government-Specific Context**: AI trained to understand government terminology and formal language
- **API Key Management**: Secure configuration for Claude API integration

---

## ๐Ÿš€ **Quick Start - Static Template**

Perfect for simple government portals. No server or database required.

### Download Static Template
```bash
# Get the static template (v1.2.0)
git clone -b v1.2.0 https://github.com/pasan93/opengovui.git opengovui-static
cd opengovui-static
```

### Deploy
1. **Local Development:**
```bash
python3 -m http.server 3000
```
Open http://localhost:3000

2. **Production:** Upload files to any web hosting service

---

## ๐ŸŽ›๏ธ **Quick Start - WordPress CMS**

Full content management system with advanced multilingual capabilities.

### Requirements
- **PHP 8.4+**
- **MariaDB/MySQL**
- **Web server** (Apache/Nginx) or PHP built-in server
- **Polylang Plugin** (for full multilingual support)

### Installation
```bash
# Get the WordPress version (v2.1.0)
git clone https://github.com/pasan93/opengovui.git opengovui-cms
cd opengovui-cms
```

### Setup WordPress
1. **Download WordPress Core:**
```bash
curl -O https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
cp -r wordpress/* .
rm -rf wordpress latest.tar.gz
```

2. **Setup Database:**
```bash
mariadb -u root < setup_database.sql
```

3. **Start Server:**
```bash
php -S localhost:8080
```

4. **Complete Installation:**
- Open http://localhost:8080
- Follow WordPress installation wizard
- **Install Polylang Plugin** for multilingual support
- Activate "OpenGovUI" theme
- **Configure AI Translation** (Optional):
- Add your Claude API key to wp-config.php: `define('CLAUDE_API_KEY', 'your-api-key');`
- Or configure via WordPress admin: Tools โ†’ Auto Translation
- **Populate Content**: Use the built-in content population system
- **Auto-Translate Content**: Access Tools โ†’ Auto Translation for AI-powered translations
- Start managing government services and content!

๐Ÿ“š **[View Full WordPress Setup Guide](WORDPRESS_SETUP_GUIDE.md)**

---

## ๐Ÿ”ง Structure

### Static Template Structure
```
opengovui-static/
โ”œโ”€โ”€ index.html # Main page
โ”œโ”€โ”€ css/
โ”‚ โ””โ”€โ”€ styles.css # Styling
โ”œโ”€โ”€ js/
โ”‚ โ”œโ”€โ”€ i18n.js # Internationalization
โ”‚ โ””โ”€โ”€ script.js # Interactive features
โ””โ”€โ”€ images/
โ””โ”€โ”€ govt-logo.png # Government branding
```

### WordPress CMS Structure
```
opengovui-cms/
โ”œโ”€โ”€ wp-content/
โ”‚ โ”œโ”€โ”€ themes/
โ”‚ โ”‚ โ””โ”€โ”€ opengovui/ # Custom government theme
โ”‚ โ”‚ โ”œโ”€โ”€ style.css # Theme styles
โ”‚ โ”‚ โ”œโ”€โ”€ index.php # Main template
โ”‚ โ”‚ โ”œโ”€โ”€ front-page.php # Homepage template
โ”‚ โ”‚ โ”œโ”€โ”€ header.php # Header template
โ”‚ โ”‚ โ”œโ”€โ”€ footer.php # Footer template
โ”‚ โ”‚ โ”œโ”€โ”€ functions.php # Theme functionality
โ”‚ โ”‚ โ”œโ”€โ”€ single-gov_service.php # Service template
โ”‚ โ”‚ โ”œโ”€โ”€ js/
โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ multilingual.js # Polylang integration
โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ admin-auto-translate.js
โ”‚ โ”‚ โ””โ”€โ”€ includes/
โ”‚ โ”‚ โ”œโ”€โ”€ content-populator.php
โ”‚ โ”‚ โ””โ”€โ”€ translation-manager.php
โ”‚ โ”œโ”€โ”€ plugins/
โ”‚ โ”‚ โ””โ”€โ”€ polylang/ # Multilingual support
โ”‚ โ””โ”€โ”€ languages/ # Translation files
โ”œโ”€โ”€ wp-config.php # Database configuration
โ”œโ”€โ”€ setup_database.sql # Database setup
โ””โ”€โ”€ WORDPRESS_SETUP_GUIDE.md
```

---

## ๐Ÿ“š Key Components

### WordPress CMS Features (v2.1.0)

#### Custom Post Types & REST API
- **Government Services** (`/wp-json/wp/v2/gov_service`)
- Service icons, URLs, processing times
- Requirements and featured status
- Full multilingual support
- **Service Categories** (`/wp-json/wp/v2/service_category`)
- Custom icons and color schemes
- Multilingual category management
- **Government Updates** (`/wp-json/wp/v2/gov_update`)
- Featured updates and announcements
- Date-based sorting and archives

#### Enhanced API Endpoints
```
/wp-json/opengovui/v1/featured-services?lang=en # Featured services
/wp-json/opengovui/v1/categories?lang=si # Service categories
/wp-json/opengovui/v1/updates?lang=ta # Government updates
/wp-json/opengovui/v1/services?lang=en # All services
```

#### Content Population System
- **One-Click Setup**: Automatically creates sample government content
- **Multilingual Content**: Creates content in English, Sinhala, and Tamil
- **Realistic Data**: Government services, categories, and updates
- **Admin Interface**: Easy-to-use content management dashboard

#### Polylang Integration
- **Advanced Language Management**: Professional multilingual plugin support
- **Meta Field Syncing**: Automatic synchronization of custom fields across languages
- **Language Detection**: Smart language mapping and detection
- **Translation Workflow**: Streamlined content translation process

### i18n Implementation (Static Template)
The template uses a straightforward i18n system:

1. **HTML Markup**: Uses `data-i18n` attributes for translatable content:
```html

Access government services and information in one place


```

2. **Language Selection**: Simple language switcher in the header:
```html


```

### Main Sections
- **Header** with Polylang language selector and search
- **Hero section** with featured services from WordPress
- **Topic categories** with dynamic icon navigation
- **Government updates** with content management
- **Footer** with important links and social media

---

## ๐Ÿ”„ Customisation

### WordPress CMS (Recommended)
- **Admin Dashboard**: Full WordPress interface for content management
- **Content Population**: Use the built-in system to create sample content
- **Service Management**: Add/edit services with icons, URLs, and metadata
- **Category Management**: Create categories with custom colors and icons
- **Update Publishing**: Manage government announcements and news
- **Multilingual Content**: Full translation support via Polylang
- **Custom Fields**: Rich metadata for all content types

### Static Template
- Edit the HTML directly to change content
- Update the `data-i18n` attributes and corresponding translation files
- Modify icons by changing FontAwesome classes
- Customize CSS for branding

### Styling
- WordPress version inherits all static template styling
- Edit theme's `style.css` for WordPress-specific customizations
- FontAwesome 6.5.1 included for comprehensive icon support
- Custom color schemes available for categories

---

## ๐Ÿ”Œ Plugin Dependencies

### Required for Full Functionality
- **Polylang** (Free): Multilingual support
- Language management and switching
- Content translation workflow
- Meta field synchronization

### Recommended
- **Classic Editor**: For traditional WordPress editing experience
- **Yoast SEO**: Enhanced SEO with multilingual support

---

## ๐Ÿ“‹ **Version History**

- **v2.1.0** - Enhanced WordPress CMS with Polylang Integration (Current)
- Full Polylang multilingual plugin support
- **AI-powered translation system** with Claude Sonnet 3.7 integration
- Advanced REST API endpoints
- Content population system
- Intelligent translation manager with admin dashboard
- Enhanced admin interface
- **v2.0.0** - WordPress CMS Integration
- **v1.2.0** - Complete Static Template with Tamil translations
- **v1.1.0** - Fira Sans typography update
- **v1.0.0** - Initial static template release

---

## ๐Ÿš€ **API Documentation**

### REST API Endpoints

#### Custom OpenGovUI Endpoints
```bash
# Get featured services
GET /wp-json/opengovui/v1/featured-services?lang=en

# Get service categories
GET /wp-json/opengovui/v1/categories?lang=si

# Get government updates
GET /wp-json/opengovui/v1/updates?lang=ta

# Get all services
GET /wp-json/opengovui/v1/services?lang=en&category=health
```

#### Standard WordPress Endpoints
```bash
# Government Services
GET /wp-json/wp/v2/gov_service

# Service Categories
GET /wp-json/wp/v2/service_category

# Government Updates
GET /wp-json/wp/v2/gov_update
```

All endpoints support language parameters and return properly formatted content with metadata.

---

## ๐Ÿ“„ Licence

This project is licensed under the MIT Licence - see the [LICENCE](LICENSE) file for details.

## ๐Ÿค Contributing

Contributions are welcome! Feel free to submit pull requests or open issues for any improvements.

## ๐Ÿ“ž Support

For support, please open an issue in the [GitHub repository](https://github.com/pasan93/opengovui/issues).

---

Made with โค๏ธ in ๐Ÿ‡ฑ๐Ÿ‡ฐ for better government services