Project Overview
Welcome to the 2511INS (InnStar CMS) documentation. This platform is a headless CMS built with high scalability and modularity in mind.
Frontend
React + Next.js
Backend
Yii2 Advanced CMS
Database
MySQL / Relational
InnStar Limited โ High-End Real Estate & Construction
This is the front-end repository for the InnStar Limited official website, built with Next.js and powered by a high-performance animation engine focusing on premium user experience and immersive visual storytelling.
๐ Tech Stack
Core Framework
- Next.js 15+: Utilizing App Router, Server Components, and optimized static generation.
- Styled Components: Dynamic CSS-in-JS for theme-driven styling and high-performance design tokens.
- Tailwind CSS: Utility-first CSS for rapid layout development and responsive utilities.
Animation & Interaction
- GSAP (GreenSock): Orchestrating complex smooth-scrolling, parallax effects, and scroll-triggered animations.
- Framer Motion: Handling seamless page transitions and micro-interactions.
- Lenis: Providing high-fidelity smooth scrolling across all devices.
๐ ๏ธ Command Reference Matrix
This project supports both NPM and Yarn. Developers can use their preferred package manager:
| Task | NPM | Yarn |
|---|---|---|
| Install Dependencies | npm install |
yarn install |
| Development Server | npm run dev |
yarn dev |
| Production Build | npm run build |
yarn build |
| Start Production | npm run start |
yarn start |
| Linting | npm run lint |
yarn lint |
| Code Formatting | npm run format |
yarn format |
| Pre-fetch API Data | node scripts/fetch-data.js |
node scripts/fetch-data.js |
โ๏ธ Environment Configuration
The application requires specific environment variables to function correctly across different stages. Copy .env.example to .env.local and populate the values.
Core & API
NEXT_PUBLIC_BASE_URL: The secondary base URL for the application.NEXT_PUBLIC_SITE_URL: The primary front-end URL (e.g.,https://innstarbd.com).NEXT_PUBLIC_API_URL: The back-end API endpoint for dynamic content and forms.ENCRYPTED_KEY: Used for secure API communication.
SEO & Metadata
SITENAME: Used in the<title>tag template (e.g.,THE SALTANAT).AUTHOR: The corporate name used in meta tags (e.g.,InnStar Limited).NEXT_PUBLIC_META_KEYWORDS: Global keywords for search engine indexing.
Assets & Analytics
NEXT_PUBLIC_CDN_URL: Base URL if assets are served via CDN.NEXT_PUBLIC_IMAGE_DOMAIN: Domain authorized for Next.js image optimization.NEXT_PUBLIC_GOOGLE_ANALYTICS: ID for tracking user behavior.
๐จ Design System & Styling
The project implements a proprietary DC Design System via src/styles/theme.js.
Spacing & Grid
- 4px Baseline: All spacing (margins, padding) follows a numeric scale based on a 4px module (Scale 1 = 4px, Scale 2 = 8px, etc.).
- Semantic Breakpoints:
xs: 329px (Small phones)md: 767px (Large phones)tab: 768px (Tablets)laptop: 992px (Standard laptops)uhd: 1920px (4K monitors)
Typography
The theme uses specialized font families:
- Primary:
Mosvita(San-serif for UI and labels) - Secondary:
Cammron(Serif for headings and elegant body text) - Accent:
Careny(Used for overlines and call-to-actions)
๐ Module Development Guideline
The application is modular. Each section of a page is a "Module".
Step 1: Create the Component
Create a new file in src/modules/YourModuleName.jsx:
'use client';
import { Container, Row, Col } from 'react-bootstrap';
const YourModuleName = ({ data }) => {
return (
<section>
<Container>
<h2>{data.section_data.title}</h2>
</Container>
</section>
);
};
export default YourModuleName;
Step 2: Register the Module
Add your module to src/render/ComponentRegistry.js to allow the CMS to render it dynamically:
import YourModuleName from '@/src/modules/YourModuleName';
export const COMPONENT_MAP = {
// ... existing mappings
your_module_type_from_api: YourModuleName,
};
๐ข Deployment Workflow (Manual)
Follow these steps to manually deploy the application to your production server via ZIP.
Step 1: Production Build
Generate the optimized production bundle on your local machine:
yarn build
# OR
npm run build
Step 2: Archive the Build
Create a ZIP archive of the necessary files. DO NOT include node_modules or .git as they are extremely large and should be handled on the server.
Files to include:
.next/public/src/(optional for production but recommended for debugging)package.jsonyarn.lockorpackage-lock.jsonnext.config.mjsserver.js(if using custom server).env.production
Step 3: Upload & Extraction
- Upload: Use SCP or SFTP to transfer the
archive.zipto your server. - Extract: Access your server via SSH and unzip the archive:
unzip archive.zip -d /var/www/innstar
Step 4: Server-Side Install
Navigate to your project directory on the server and install production dependencies:
yarn install --production
# OR
npm install --production
Step 5: Restart the Application
We use PM2 to manage the Node.js process. Restart the application to apply changes:
pm2 restart innstar-frontend
# OR (if by ID)
pm2 restart 0
๐งผ Maintenance & Troubleshooting
Static Data Refreshing
If the UI doesn't reflect the latest CMS changes, trigger a build-time pre-fetch:
yarn build # This automatically triggers scripts/fetch-data.js
Common Issues
- Hydration Mismatch: Ensure CSS-in-JS (Styled Components) registry is correctly initialized in
src/lib/registry.js. - GSAP Context: Always wrap GSAP animations in
useGsaporuseEffectcleanup to avoid memory leaks during route changes. - Port Conflict: Ensure the
portspecified inserver.jsor.envis not occupied by another process.
๐ License
Confidential & Private โ Property of InnStar Limited. Developed by Dcastalia.
Backend Documentation (Yii2 Advanced CMS)
The backend is built on the Yii2 Advanced Framework, a high-performance PHP framework optimized for large-scale enterprise applications. It follows a clean separation of concerns between administration and data delivery.
๐ Technology Stack
PHP 7.4+ / 8.x
Core language with strict typing for reliability.
Yii2 Advanced
Modular architecture for decoupled scalability.
MySQL 8.0
High-performance relational data storage.
Intervention
Advanced image processing and optimization.
๐ Folder Structure Overview
RESTful portal. Handles all requests from the Next.js frontend with optimized data delivery.
The administrative dashboard. Contains modules for managing Products, Pages, and CMS entities.
The core logic. Shared models, global configurations, and business rules.
CLI operations. Used for database migrations and automated background tasks.
๐ผ๏ธ Media Library Picker Component
The CMS uses a centralized, reusable component for all media selections to ensure consistency across modules.
// Implementation sample in View files
echo $this->render('@backend/views/layouts/_media_selection', [
'model' => $model,
'attribute' => 'image_id',
'identifier' => 'feature_image_slug'
]);
๐ RBAC & Security
Granular access control is managed via the MDMSoft Yii2-Admin extension. Permissions are assigned to roles, which are then attached to backend users.
- Roles: Admin, Editor, Content Manager, Support.
- API Auth: JWT and Header-based authentication for secure frontend communication.
Core Backend Modules
The system is composed of several specialized modules handling specific CMS domains.
Product & Catalog
- Product Management: Detailed item listings with slug-based routing.
- Specifications: Dynamically defined attributes for different product types.
- Variations: Support for multiple versions (colors, sizes, etc.) of a single product.
- Product Posts: Reusable content blocks specifically for highlighting features.
Page & Section Builder
- Modular Architecture: Build pages using reusable "Sections".
- Templates: Assign custom PHP templates to individual pages for unique layouts.
- SEO Metadata: Dedicated fields for Title, Description, Keywords, and Social Share images.
5. Modules Reference
Below is a detailed breakdown of all administrative modules available in the InnStar CMS.
Pages
Core website structure, layout templates, and dynamic sections.
Products
Project portfolios, catalogs, and detailed product specifications.
Blog
News articles, press releases, and categorized editorial content.
Forms
Lead tracking, form submissions, and automated email replies.
Gallery
Visual asset organization, albums, and bulk image management.
Categories
Centralized taxonomy system for organizing all content types.
Jobs/HR
Recruitment management, job listings, and applicant tracking.
Menu Builder
Drag-and-drop navigation management and nested menu structures.
Addresses
Corporate office locations, branches, and contact maps.
User Access
Administrative user management, roles, and profile settings.
Administration
System cleanup tools, folder analysis, and database backups.
Global Config
Site-wide settings, social links, and media optimization.
RESTful API Reference
The API serves as the bridge between the Yii2 data layer and the frontend, delivering optimized JSON payloads.
๐ก GetReqDataController Endpoints
The primary controller for data delivery. Base URL: /api/get-req-data/
| Action | Description | Flags Supported |
|---|---|---|
page-data |
Fetch full page details and meta info. | image, post, gallery |
product-data |
Fetch product details with relations. | gallery, specs, variations |
menu-data |
Get nested navigation structure. | menu_id |
all-category |
List categories by type (blog/product). | type |
image=yes or post=yes only when needed to keep response payloads lean.
๐ Global Security & Headers
- API Key: Requests should include the
ENCRYPTED_KEYderived from the environment config. - Response Format: Every API call returns a standardized JSON structure with
status,message, anddata.
Database Tech Stack
The system currently uses MySQL. The configuration is centralized to allow for easy scaling or technology swaps.
Configuration Path
Edit the following file to update connection strings:
common/config/main-local.php
How to change DB Technology
If you need to change the database (e.g., to PostgreSQL), follow these steps:
- Update the
dsnandclassincommon/config/main-local.php. - Ensure the appropriate PHP driver is installed.
- Run migrations:
php yii migrate.
User Manual & Directions
Follow this step-by-step guide to manage your website content efficiently using the InnStar CMS.
CMS Information
The InnStar CMS is designed for ease of use. After logging in, you will be greeted by the Dashboard.
Getting Started:
- Access the Dashboard: Navigate to the
/adminURL and log in with your credentials.
- Navigation Sidebar: Use the left sidebar to access different modules like Pages, Products, and Blogs.
- Global Search: Quickly find any resource using the search bar at the top (if enabled).
Media Library
The Media Library is the central hub for all your images, videos, and documents used across the CMS.
1. View Library
The main library view allows you to browse all uploaded assets in a responsive grid or list view.
- Asset Grid: Quickly identify images through thumbnails.
- Folders/Contexts: View assets organized by their usage context (Pages, Blogs, etc.).
- Search & Filter: Find specific files by name or type.
2. Upload Media
Easily add new assets to your library using the interactive upload tool.
- Click the Upload button in the Media Library.
- Drag and drop files or click to select from your computer.
- The system will automatically optimize and process your files for web use.
3. Media Settings
Configure global rules for image optimization and processing.
- Image Sizes: Define default dimensions for different usage contexts.
- Compression: Control the balance between image quality and file size.
4. Media Garbage Cleanup
Maintain a lean system by identifying and removing unused or orphaned media files.
- Orphan Detection: Identify files that are not linked to any page or post.
- Bulk Removal: Clean up your server storage with a single click.
Media Picker (Global Component)
The Media Picker is a versatile popup used across all modules to select or upload images and files on the fly.
How to use:
- Select Existing: Click on any image in the grid to select it.
- Instant Upload: Switch to the upload tab within the picker to add new files without leaving your current page.
- Confirmation: Click Choose or Apply to link the media to your current resource.
Modules Reference
Detailed documentation for each administrative module in the CMS.
Page Module
The Page module is the heart of the CMS, allowing you to manage the website structure and content through a flexible, section-based system.
1. View All Pages
The Pages List provides a high-level overview of all website pages, their hierarchy, and their current status.
List Overview:
- Title: Displays the page title and its indentation (indicating hierarchy).
- Sections: Quick link to see how many content blocks are assigned to the page.
- Status: View whether a page is Active, Draft, or Archived.
- Actions: Quick access to view, update, or manage page settings.
2. Create New Page
Starting a new page requires defining its basic properties and URL structure.
- Navigate to Pages > Add New.
- Parent Page: Select if this is a sub-page (e.g., Services > Web Design).
- Title & Slug: Enter the page name; the slug will auto-generate but can be customized.
- Description: Add a short summary for the page header or SEO.
- Click Create to save the initial record.
3. Update Page
After creation, you can refine a page's content, SEO, and visual assets through the update interface.
Key Update Areas:
- General Tab: Edit main titles, subtitles, and descriptions.
- Meta Data: Manage SEO titles and social sharing images.
- Buttons: Add dynamic call-to-action buttons directly to the page.
- Additional Fields: Add custom text data unique to this page.
4. Meta Data
Optimize your page for search engines and social media platforms.
- Meta Title: The title displayed in search engine results.
- Meta Description: A brief summary that appears under the title in search results.
- Meta Image: The image shown when the page link is shared on social media.
5. Page Gallery
Attach visual albums to your page content.
- Select from existing albums in the Gallery module.
- Choose how the gallery should be displayed (e.g., Grid or Slider).
6. Page Images
Manage secondary images and visual assets specifically for this page.
- Use the Media Picker to select or upload images.
- Assign images to specific layout placeholders.
7. Page Files
Manage downloadable documents and files attached to the page.
- Attach PDFs, Docs, or other files for user download.
- Set display labels for each file.
8. Page Data Template
For advanced layouts, you can define custom JSON data structures to drive specific frontend components.
- JSON Structure: Input custom data fields used by specialized templates.
- Dynamic Configuration: Control advanced behaviors without code changes.
9. Bulk Actions
Manage multiple pages simultaneously using the bulk action tool in the pages list.
How to use:
- Select multiple pages using the checkboxes on the left.
- Choose an action from the Bulk Action dropdown (e.g., Bulk Delete, Bulk Archive).
- Click Apply to execute the action on all selected items.
Sections Management
Sections are the building blocks of your pages. Each page can have multiple sections, each with its own layout and content.
10. Create a Section
Add new layout blocks to your page by creating sections.
- Click Add Section in the Page Update view.
- Enter a Title and select the Template (this defines the layout).
- Click Create to add the section.
To modify an existing section, click the Update icon in the sections list.
11. Section Tabs & Media
Sections have their own dedicated management tabs for handling specific content types.
Gallery
Attach image albums specific to this section.
Images
Manage section-specific visual assets.
Files
Attach downloadable documents to the section.
Posts
Manage the content blocks (Posts) nested within this section.
Data Template
Configure advanced JSON data for the section's template.
Posts Management
Posts are the individual content units within a section. They allow you to add repeating items like services, features, or team members.
12. View All Posts
See all posts assigned to a specific page or section.
13. Create a Post
Add new content blocks to your section.
- Navigate to the Posts tab in a page or section.
- Click Add Post.
- Fill in the content fields and click Create.
14. Update a Post
Refine the content and visual appearance of individual posts.
Advanced Post Options:
- Post Images: Assign specific media to the post.
- Post Template: Override the section template for a specific post.
15. Archive Page
If a page is no longer needed but you want to keep the data, you can archive it.
- In the Pages list, find the page you wish to archive.
- Click the Status dropdown or select the item.
- Confirm the Archive status change.
- Archived pages can be viewed and restored from the Archived tab at the top of the pages module.
Product Module
Manage your product portfolio and project listings with advanced features for specifications, variations, and modular content.
1. View All Products
The product list provides a comprehensive overview of your catalog, including identifiers, categories, and status.
2. Create New Product
Add new products by defining their identity and initial SEO parameters.
- Navigate to Products > Add New.
- General Info: Enter Title, Category, and Type.
- SEO: Populate meta titles and descriptions for better search visibility.
- Click Create to save the product.
3. Update Product Details
Manage all aspects of an existing product through specialized management tabs.
Meta Data & SEO
Refine how the product appears in search results and social sharing.
Specifications
Add technical details, dimensions, or specific attributes.
Variations
Manage different versions (colors, sizes) of the product.
Gallery & Media
Upload and organize images specifically for this product.
Product Files
Attach manuals, brochures, or technical documents.
Data Templates
Configure custom layout templates for the product page.
4. Product Posts (Feature Blocks)
Create and manage modular content blocks to highlight specific product features.
Post Customization:
- Section Management: Organize posts into logical sections.
- Templates: Select from predefined layouts for your posts.
- Visual Assets: Manage images specifically for these feature blocks.
Import/Export Module
The Import/Export tool allows you to migrate data between environments and maintain offline backups of your CMS content.
Exporting Data:
- Navigate to Import/Export in the main menu.
- Select Model: Choose which module data you wish to export (e.g., Pages, Products, Blogs).
- Configure Fields: Select specific fields or export the entire model structure.
- Download: Click Export to generate and download a JSON/CSV file.
Blog Module
Publish and manage news articles, company updates, and blog posts with full SEO support.
1. View All Blog Posts
The blog list provides an overview of all articles, their categories, and publication status.
2. Create Blog Post
Start a new article by defining its core properties and initial content.
- Click Add New in the Blog module.
- Enter the Title, Category, and Short Description.
- Populate the main Content area using the Rich Text Editor.
- Click Create to save the post.
3. Update Blog Content & Images
Refine your article's layout and visual assets through the update interface.
Management Tabs:
- General: Edit the main article body and primary fields.
- Images: Manage the featured image and secondary visuals for the post.
4. Blog Meta Data
Optimize individual blog posts for search engines and social sharing.
Use the Meta Data tab to set unique SEO titles, keywords, and social sharing descriptions for every article.
5. Blog Templates
Choose different layout styles for your blog posts.
Select a pre-registered template from the dropdown to instantly change the visual appearance of your article on the frontend.
Forms & Submissions
Manage user inquiries, lead data, and automated communication generated from your website's interactive forms.
1. Form Management
Configure form fields, validation rules, and submission settings for each contact form on your site.
2. Submissions & Leads
View and export all data collected via website forms.
3. Subscriptions
Track and manage newsletter subscriptions and user opt-ins.
4. Email Logs & Notifications
Monitor all automated emails sent by the system to both administrators and users.
Gallery Module
Create and manage visual albums and image collections used throughout the website.
1. View All Galleries
The main gallery list displays all created albums and their current visibility status.
2. Create New Gallery
Start a new album by defining its title and basic properties.
- Click Add New in the Gallery module.
- Enter the Title and optional description.
- Set the initial Status (Active/Draft).
- Click Create to initialize the album.
3. Manage Gallery Items
After creating a gallery, you can add and organize multiple images within it.
Adding Images:
- Open a gallery and navigate to the Posts or Items tab.
- Click Add Post to add a new image block.
- Use the Media Picker to select or upload an image.
- Add an optional caption and sort order.
4. Archive Gallery
Hide galleries from the live site while retaining them for future use.
Use the status toggle in the list view to archive a gallery. Archived galleries can be filtered and restored at any time.
Categories
Centralized taxonomy management for Blogs and Products. Categories help in organizing your content into logical groups, making it easier for users to navigate your site.
1. View All Categories
The main categories list shows all existing taxonomies, their types, and current status.
- Global Organization: Manage categories used by Blog and Product modules.
- Hierarchy: Support for parent-child category structures.
- Status Tracking: See which categories are active or archived.
2. Create New Category
Add new content groupings to your system.
- Navigate to Categories > Create New.
- Title: Enter the display name for the category.
- Type: Select whether this category is for Blogs, Products, or other content types.
- Parent: Choose a parent category if this is a sub-category.
- Click Save to finalize.
3. Archive Category
Deactivate categories that are no longer needed without deleting the underlying data.
- Soft Delete: Archiving hides the category from frontend filters but keeps it in the database for reference.
- Restoration: Archived categories can be reactivated at any time.
Jobs & HR
Manage website recruitment, post career opportunities, and track applications received through the careers portal.
1. View All Jobs
The main job list provides an overview of all active, draft, and archived job openings.
2. Post New Job
Create a new career opportunity by defining the job title, category, and requirements.
3. Update Job Details
Modify existing job descriptions, update deadlines, or change the status of a posting.
Addresses
Manage corporate office locations, branches, and contact information for map integration and site-wide display.
1. View Addresses
The main list displays all registered locations and their primary contact details.
2. Create New Address
Add a new location by providing coordinates, physical address, and contact metadata.
3. Update Address
Modify existing location data or update map coordinates for frontend accuracy.
User Access & RBAC
Manage administrative users, track system activity, and configure granular access control via Roles and Permissions.
1. User Management
Create and manage backend administrators and editors.
2. Activity Logs
Monitor system-wide actions taken by administrative users for security and auditing.
3. RBAC (Roles & Permissions)
Define custom roles and assign specific permissions to control access to CMS modules.
RBAC Workflow:
- Create Roles: Define functional roles like "Editor" or "Support".
- Assign Permissions: Attach specific route access to each role.
- Link to Users: Assign one or more roles to an administrative user.
Templates
Manage visual layout templates for different content types, allowing editors to choose from pre-defined designs.
1. View Templates
The main list displays all registered templates and their usage across the site.
2. Create New Template
Register a new layout by providing a name, identifier, and a preview screenshot to help editors.
Content Types
Define and organize different types of content (Pages, Sections, Posts) to categorize them effectively.
1. View Content Types
Browse the list of all active and archived content identifiers.
2. Manage Content Types
Create or update types to match your website's data structure requirements.
3. Archive & Status
Archive unused types to keep the administrative interface clean without losing historical data integrity.
Administration
System maintenance, data integrity tools, and advanced administrative utilities.
1. Garbage Cleanup
Identify and remove orphaned files that are no longer linked to any content, keeping your storage optimized.
2. JSON Support & Debugging
Advanced views for inspecting raw JSON data payloads delivered by the API.
3. Bulk Tools & System Operations
Perform system-wide operations like re-generating assets or downloading data backups.
Global Configuration
Site-wide settings, module behavior, and system optimizations are managed here.
1. Global Settings
Configure core website properties, social media links, and contact metadata via a step-by-step interface.
2. Product Attributes
Define custom specifications and attributes for your product catalog.
3. Media Settings
Manage image optimization rules, folder structures, and custom media fields.
4. API Documentation & Advanced Fields
Access the built-in Swagger documentation and manage system-wide extra fields for content modules.
5. Modules Reference
Below is a detailed breakdown of all administrative modules available in the InnStar CMS.
Pages
Manage website structure, layout templates, and build pages using dynamic sections.
Products
Portfolio management for projects and products, including specs and galleries.
Blog
Publish news, articles, and press releases with full SEO and category support.
Forms
Track user inquiries, manage form settings, and export lead data to CSV/Excel.
Gallery
Create and manage visual albums and image collections across the site.
Categories
Centralized taxonomy system to organize Blog posts, Products, and more.
Jobs/HR
Manage career opportunities, job listings, and track incoming applications.
Menu Builder
Intuitive drag-and-drop tool to manage main and footer navigation menus.
Addresses
Manage office locations, branch details, and contact information maps.
User Access
Manage administrative users, update profiles, and control system access.
Templates
Register and manage layout templates for Pages and Products.
Types
Define custom content types and section identifiers.
Administration
System maintenance tools including junk file cleanup and folder analysis.
Global Config
Site-wide configurations, social media links, and media optimization rules.
Technical Support
For technical assistance and inquiries, please contact Dcastalia Limited.