Skip to content

cepdnaclk/portal.ce.pdn.ac.lk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel CI GitHub Release codecov

portal.ce.pdn.ac.lk

Internal and Public web service provider of the Department of Computer Engineering

Team of Developers

Useful Commands and Instructions

For contributor onboarding and coding standards, see the Repository Guidelines.

You need to install WAMP or XAMP server and run it before following commands. Please make sure you already created a Database and a Database User Account.

Install Dependencies

// Install PHP dependencies
composer install

// Install Node dependencies (development mode, can use `npm` as well, but recommended to use `pnpm` here)
pnpm install
pnpm run dev
Additional useful commands
// If you received mmap() error, use this command
php -d memory_limit=-1 /usr/local/bin/composer install

// Update PHP dependencies
composer update

// Prepare the database
php artisan migrate

Content author attribution

News, Events, and Articles now track attribution via author_id (added in the 2026-02-07 migration). Run php artisan migrate after pulling the latest changes.

Prepare for the first run

First you need to copy .env.example and save as .env in the root folder, and change the Admin and User credentials, Database configurations.

Next follow the below commands

// Prepare the public link for storage
php artisan storage:link

// Reset the database and seed the data
php artisan migrate:fresh --seed

// Prepare webhook for unit testing
git config --local core.hooksPath .githooks

Serve in the Local environment

// Serve PHP web server
php artisan serve

// Serve PHP web server, in a specific IP & port
php artisan serve --host=0.0.0.0 --port=8000

// To work with Vue components, you need to run this in parallel (can use `npm` as well, but recommended to use `pnpm` here)
pnpm run watch

Tenants (multi-site content)

  • Define tenants in config/tenants.php with slug, name, url, description.
  • The default tenant slug controls the content returned by v1 APIs.

Backups (DB + Assets + Google Drive)

Use the portal:backup command to export the MySQL database, zip assets, and upload artifacts to Google Drive with a Service Account.

php artisan portal:backup

Configuration is documented in docs/features/backups.md and config/google-services.php.

  • Seed tenants from config with:
php artisan db:seed --class=Database\\Seeders\\TenantSeeder
API examples (v2 tenant-aware APIs)
  • News: GET /api/news/v2/{tenant_slug}
  • Articles: GET /api/articles/v2/{tenant_slug}
  • Events: GET /api/events/v2/{tenant_slug}
  • For unknown tenant slugs, v2 returns 404 Tenant not found.

Cache and optimization

// Remove dev dependencies
composer install --optimize-autoloader --no-dev

php artisan config:cache
php artisan route:cache
php artisan view:cache

php artisan optimize:clear

php artisan config:clear
php artisan route:clear
php artisan view:clear

Maintenance related commands

php artisan down --message="{Message}" --retry=60
php artisan up

Other useful instructions

// Create Model, Controller and Database Seeder
php artisan make:model {name} --migration --controller --seed

// Create a Email
php artisan make:mail -m

// Commandline interface for Database Operations
php artisan tinker

// Run the unit tests
php artisan test

// Populate the DB with a specific Seeder class
php artisan db:seed --class=<path-to-the-seeder-class>

// Ex: php artisan db:seed --class=Database\\Seeders\\Roles\\AcademicRoleSeeder

Maintenance Scripts

Can be found under ./scripts. folder. In the production environment, scripts need to be run with sudo from the base directory to work correctly.

Ex:

sudo sh ./scripts/deploy-prod.sh

Resource Routes - Standard Pattern

Verb URI Action Route Name
GET /photos/ index photos.index
GET /photos/create create photos.create
GET /photos/view/{photo} show photos.show
GET /photos/edit/{photo} edit photos.edit
GET /photos/delete/{photo} delete photos.delete
POST /photos/ store photos.store
PUT /photos/{photo} update photos.update
DELETE /photos/{photo} destroy photos.destroy

Contributors

Thanks to all the contributors who have helped with this project!

https://portal.ce.pdn.ac.lk/contributors

About

Internal and Public web service provider of the Department of Computer Engineering

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors