Project Structure

Overview about project structure so that you can follow up easier.
avatar
by hssoftvn
Updated: 2 years ago (2023-09-05 08:59:00)

Thumbnail Image
To let you have an overview of project structure, please check the chart below:

  • api: php
    • public : implement public API that everyone can use.

  • cdn , cdn_bk
    • articles : store thumbnails, images for articles
    • users : store avatar for users

  • js: javascript
    • All users JS functions to use in app.
    • CkEditor, antihacking, formJson, purify
    • common, dialog
    • qrcode, webspeak
  • css
    • main using BOOTSTRAP CSS and libs
    • some customized class for images, nav, position, sidebar…
  • images : an images location to use in project. Usually static images, such as: intro, logo
  • icon : store only icons files in ico and png format
  • localization : define PHP LocalizationData class to contain text data by language, and util function to read text

  • configs :  PHP. Configure important options, changes of the projects, which are used thorough the application.

  • controllers :  PHP. Define all models and controllers to work for application
    • core : All core features, functions are defined in this
      • cache : working with cache, like request, session, cookie
      • database: define core function to work with database: open connection, connect, disconnect, query, update functions…
      • jwt : jwt library to work with JWT for authenticationm with token
      • text : utils to work with text
      • upload : module to upload photo to server.
      • utils : all possible utility functions.
      • dashboard.php, user.php: util classes to work with admin and user mode
    • auth : implement token check for application.
    • app: define all specific models & controllers for application
      • database : define classes working dirrectly with MySQL database
        • posts : Helper class to work with article
        • profile : Helper class to work with user profiile / account in manage user account only.
        • users : Helper class to work with users list
    • db2form : tool to convert databse table into HTML form, also supporting UI/template to update changes to from form to database.

  • libs : PHP
    • antihack: Utility class to sanitize user input to avoid XSS hacking.

  • views : PHP All view sections, components go here will form user interface.
    • common : include and handle all common actions for a home page
      • common_modules: include/require once all common and neccessary modules to home page. Including
        • Antihack, utils, Cache
        • Update user timezone
        • Set up default paging info
        • Update and confuring language
        • Handle Localization header
      • Handle SEO header and content
    • components
      • thumbnail_item.php: an component to work with upload photo such as user avatar, article thumbbnail…
    • posts
      • view_detail.php : handle view article detail content
      • view_list.php : list all articles with paging
    • profile : act under user role, and logged in.
      • home.php: user profile info, and update
      • register.php: define Create Account UI
      • login.php: define Login UI
      • handle_login.php: handle register, login, logout operations
      • sidebar.php: user's profile sidebar menu:
        • Profile : view and update user info
        • Write : start to write a new article
        • My Articles: all articles written by current logged-in user.
    • search : search articles and return the articles list, same as articles_view_list
    • users
      • view_detail.php : handle view user info
      • view_list.php : list all users with paging
    • utils
      • misc.php : other util file to work with Avatar and Thumbnail, DateTime
    • about_us.php : content of about_page
    • change_tz.php : handle check user timezone and update it in cookie
    • head.php: content of HEAD tag to be include in HOMEPAGE
    • header.php:
      • header of website, logo, icon
      • with navigation, menu, download
      • change languae
      • profile icon, login, logout, register
      • search bar
    • home.php: content of home page, landing page.
    • popup.html : define all html components for alert, dialog, model..
    • slideshow.php: util class to render slideshow easily with:
      • Logo
      • Title, Summary
      • Auto scroll after 3s

  • .htaccess : server config file of the webapp.
    • Define redirection, public link….
    • Define Environment vairable
  • index.php : Main home page, and recieving command, actions, and processing redirection to render corresponding page or component
  • profile.php : Main Profile page, and recieving command, actions, and processing redirection to render corresponding page or component

 


WHAT'S NEXT? 
OVERIDING YOUR OWN APP

 

Success! This alert box could indicate a successful or positive action.