syedfa / website

The sunnah.com website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sunnah-website

This is the front end code for sunnah.com. It is built atop the Yii 2 MVC framework.

The top level structure is divided into application code (in the application folder) that includes MVC code and the public folder which contains index.php, css, js, and others.

Your webserver should point to the public folder. The Yii framework code needs to reside on the machine as well; its location is hardcoded into public/index.php.

Under the application folder, here are the important locations:

  • config/main.php : All the configuration options, including URL routes, database connections, etc.
  • Yii divides its MVC code into "modules" that share code. Think of them as sections of a website. For example, an admin section vs. a public section.
  • modules/front/controllers: All controller classes. There are three main controllers: the search page, the index and sitewide pages, and the collection controller which includes actions for displaying collections, books, and ahadith.
  • modules/front/models: All model classes. Each kind of object has a model class. E.g. hadith, book, collection.
  • modules/front/views: Each controller has actions which have view code. This folder contains the view code.
  • modules/front/views/layouts: Other view code corresponding to side menus, search box, widgets, etc.
  • views/layouts: Sitewide view code like column layout, footer.

Running on Windows

  • Install PHP 7.3
  • Create an IIS website and point it to the public folder
  • Add the index.php file as default document
  • Add handler mapping for .php files in iis
  • Download and install MySQL for Windows
  • Import the sample db in MySQL
  • Download and install Composer
  • Run the install comand of composer in the root dir
  • Visit localhost in a browser to see the site running

Launching the Dev Container

Launching the dev container is composed of a simple docker-compose command:

Run the following command in the same directory as the Dockerfile:

docker-compose up --build

You should then be able to access the webserver using port 80 on the container's host.

Use Visual Studio Code with Remote Containers extensions to attach to running instance and try out changes rapidly.

Use the php cs fixer extension for formatting code.

About

The sunnah.com website


Languages

Language:PHP 53.5%Language:Hack 25.8%Language:CSS 15.4%Language:JavaScript 3.2%Language:HTML 2.0%Language:Dockerfile 0.1%