Idea and description of the application 
";


Мы поможем в написании ваших работ!



ЗНАЕТЕ ЛИ ВЫ?

Idea and description of the application



Idea of my project consist of organization and automation workflow, by developing universal system for company which are need it, and introduction it into workflow. After introducing, my system must increase productive work for whole company. Also it helps to staff be organized on their daily works, and communication with clients.

My system contains 4 main modules:

· Projects. Storage and processing of all the company's projects, new, old and current. The distribution of projects by customers and project managers. Linking customer with his projects. Delivering status for each project for the time of its existence. Adding history of change for each project.

· Tasks. Creating tasks and subtasks. Adding tasks for specific projects. Determining the status of tasks.

· Clients. Storage and processing of all the company's customers. Determination of customer contact persons. Adding projects to the client.

· Staff. Adding new employees into the system. View information of each employee.

It also contains additional modules:

· Blackboard manager. Blackboard manager shows information about projects on dashboard page. With title, status and managers.

· Chat manager. Improve collaboration between employees with online chat on the main page. It can contain any information about company, projects, events and etc.

Project goals and objectives

The global objective of this system was improving the company's workflow. Specifically, automation tasks such as processing and storage of information, the introduction of projects and tasks and etc. The system should be stored in itself all the work of the information and provide it in the form of a web application to access it was to anywhere in the world 24 hours a day. Selecting the platform has been very carefully thought out in favor of web-based applications. Since to date browsers have a very good performance and very comfortable in terms of the use of employees. The aim was to employees come to work, open a browser and see system with its tasks for the day.

Main principles of my systems consist of 4 main modules and 2 extra modules.

· Projects

· Tasks

· Clients

· Staff

· Blackboard

· Chat

Before i start building the system I set for myself several goals objectives for a more organized and structured work approach for the development of the system itself:

· Definition of terms of reference for the development of applications

· Development of the system according to the technical project

· Implementation and configuration of the system in the workflow

Analog’s review

Before to development, I made a very large amount of analysis and collection of information on the various existing SaaS CRM systems on the market. And I found the best and worst aspects of such systems.

Advantages:

· technical support

· a large amount of functionality

· a lot of chips to configure

· some have a mobile app or a mobile version of the system

Disadvantages

· paid, and very expensive for a monthly fee. Fee is per user.

· system is on the developer server

· very bulky

· many unnecessary functions and chips.

· not possible to customize to fit your needs

 

On the market today there are many good systems and not very good, which is very well implemented in terms functionality, design and overall concept of the system itself. And I found for myself a couple of them. I have developed a system based on the experience of many other developers of such systems. It is systems like sails-crm, amoCRM, bpmonline, MegaPlan, Bitrix24, wirecrm.

 

Technical review of using software

In this chapter, I want to talk about the technologies which I have chosen to develop. Аdvantages over other similar technologies. Chapter divided into two blockы: back-end and front-end.

 

Back-end

The back-end, or the “server-side”, is basically how the site works, updates and changes. This refers to everything the user can’t see in the browser, like databases and servers. We call a person that builds all of this technology to work together a back-end developer.

Back-end developers are mostly worried about things like security, structure and content management. They usually know and can use languages like HTML and CSS, but that’s definitely not their focus.

Backend technologies usually consist of languages like PHP, Ruby, Python, etc. To make them even easier to use they’re usually enhanced by frameworks like Ruby on Rails, Cake PHP, and Laravel that all make development faster and easier to collaborate on. Back-end developers, or at least back-end development, is required to create a dynamic site. My choice was made in favor PHP and Laravel Framework.

 

PHP programming language

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

The PHP language runs on the server-side. This means that the execution of the scripts are done on the server where the web-site is hosted. HTML embedded means that you can use PHP statements from within an HTML code. PHP files are returned to the browser as plain HTML.

A scripting language is a form of programming language that is usually interpreted rather than compiled. In programming languages such C or C++ you compile the program (permanently) into an executable file, before you can execute the program. A program that is written in a scripting language, is interpreted one command at a time by a command interpreter (Command interpreter is in most cases an executable written in another language. Some other examples of scripting languages are Perl, Phyton, Java and Ruby.

Instead of lots of commands to output HTML, PHP pages contain HTML with embedded code that does "something". The PHP code is enclosed in special start and end processing instructions <?php and ?> that allow you to jump into and out of "PHP mode."

 
 


<!DOCTYPE HTML>

<html>

<head>

<title>PHP programming language</title>

</head>

<body>

<?php

echo "Hi, I'm a PHP script!";

?>

</body>

</html>

 

 

Code syntax 2.1 PHP output "Hi, I'm a PHP script!"

<?php

// Connecting, selecting database

$link = mysql_connect('dbhost', 'dbuser', 'dbpassword')

or die('Could not connect: '. mysql_error());

mysql_select_db('my_database');

 

// Performing SQL query

$query = 'SELECT name, qty, price FROM products';

$result = mysql_query($query)

or die('Query failed: '. mysql_error());

 

// Printing result

while ($row = mysql_fetch_assoc($result)) {

echo "Product:".$row['name']

.", Quantity:".$row['qty']

.", Price:".$row['price']."<br>";

}

 

// Free resultset

mysql_free_result($result);

 

// Closing connection

mysql_close($link);

?>

Code syntax 2.2 PHP manipulation with MySQL

The best things in using PHP are that it is extremely simple for a newcomer, but offers many advanced features for a professional programmer.

What is PHP:

· PHP stands for PHP: Hypertext Preprocessor.

· Server-side scripting language.

· PHP is free and is an open source software product.

· The PHP scripts are executed on the server.

· PHP supports many databases (MySQL, Sybase, Oracle and many others.)

· PHP runs on different platforms (Unix, Linux, Windows.)

· PHP is compatible with almost all web-servers used today (Apache, IIS, etc.)

· A PHP file can contain plain text, HTML tags and scripts

· The PHP files can have one of the following extensions: php, php3 or phtml.

 

What we need for programming on PHP:

· Access to a web server (like Apache)

· PHP and MySQL should be installed on the web server.

PHP is the world’s most popular scripting language for many different reasons – flexibility, ease-of-use, among others – but often times coding in PHP, or any language for that matter, can get rather monotonous and repetitive. That’s where a PHP framework can help.

PHP frameworks streamline the the development of web applications written in PHP by providing a basic structure for which to build the web applications. In other words, PHP frameworks help to promote rapid application development (RAD), which saves you time, helps build more stable applications, and reduces the amount of repetitive coding for developers. Frameworks can also help beginners to build more stable apps by ensuring proper database interaction and coding on the presentation layer. This allows you to spend more time creating the actual web application, instead of spending time writing repetitive code.

The general idea behind the workings of a PHP framework is referred to as Model View Controller (MVC). MVC is an architectural pattern in programming that isolates business logic from the UI, allowing one to be modified separately from the other (also known as separation of concerns). With MVC, Model refers to data, View refers to the presentation layer, and Controller to the application or business logic. Basically, MVC breaks up the development process of an application, so you can work on individual elements while others are unaffected. Essentially, this makes coding in PHP faster and less complicated.

 

 

Figure 2.1 MVC structure

 

Within the past few years as PHP has evolved as the scripting language of choice by most developers, there have been an explosion of PHP frameworks to hit the scene. There is a great debate about what the best PHP frameworks are, because the simple fact is that not every framework is built for everyone. Here’s a quick rundown of five of the best and most popular choices right now:

· The Zend Framework

· CakePHP

· Symfony

· Codelgniter

· Yii

· Seagull

· Laravel

 

PHP frameworks are a great way for developers of all skill levels to reduce the need for repetitive coding, speed up the development process, and to ensure proper coding when creating web applications. This not only speeds up the development of rich applications, but it also tightens up PHP security by reducing the risk of security holes in your coding. But despite the abundance of all kinds of frameworks, I made a choice in favor of the young, quickly developing a framework Laravel.

Laravel Framework

Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern. Some of the features of Laravel are a modular packaging system with a dedicated dependency manager, different ways for accessing relational databases, utilities that aid in application deployment and maintenance.

Laravel is a popular PHP framework having simple, expressive and elegant syntax that helps in creating a wonderful application. Laravel eases the development process by simplifying repetitive tasks used in developing most of the web applications, including but not limited to routing, authentication, caching and sessions. Laravel provides some amazing features like fast extension ability, development speed, scalability, and quick institution along with this it provides better programming results as compared to other programming tools and so it is highly preferred by the developers

When it comes to code reliability and maintainability, Laravel has a good foundation and great community support behind its PHP Framework.

As of March 2015, Laravel is regarded as one of the most popular PHP frameworks, together with Symfony2, Nette, CodeIgniter, Yii2 and other frameworks.

 

The following features serve as Laravel's key design points:

· Bundles provide a modular packaging system since the release of Laravel 3, with bundled features already available for easy addition to applications. Furthermore, Laravel 4 uses Composer as a dependency manager to add framework-agnostic and Laravel-specific PHP packages available from the Packagist repository.

· Eloquent ORM (object-relational mapping) is an advanced PHP implementation of the active record pattern, providing at the same time internal methods for enforcing constraints on the relationships between database objects. Following the active record pattern, Eloquent ORM presents database tables as classes, with their object instances tied to single table rows.

· Query builder provides a more direct database access alternative to the Eloquent ORM. Instead of requiring SQL queries to be written directly, Laravel's query builder provides a set of classes and methods capable of building queries programmatically. It also allows selectable caching of the results of executed queries.

· Application logic is an integral part of developed applications, implemented either by using controllers or as part of the route declarations. The syntax used to define application logic is similar to the one used by Sinatra framework.

· Reverse routing defines a relationship between the links and routes, making it possible for later changes to routes to be automatically propagated into relevant links. When the links are created by using names of existing routes, the appropriate uniform resource identifiers (URIs) are automatically created by Laravel.

· Restful controllers provide an optional way for separating the logic behind serving HTTP GET and POST requests.

· Class auto loading provides automated loading of PHP classes without the need for manual maintenance of inclusion paths. On-demand loading prevents inclusion of unnecessary components, so only the actually used components are loaded.

· View composers serve as customizable logical code units that can be executed when a view is loaded.

· Blade templating engine combines one or more templates with a data model to produce resulting views, doing that by transpiling the templates into cached PHP code for improved performance. Blade also provides a set of its own control structures such as conditional statements and loops, which are internally mapped to their PHP counterparts. Furthermore, Laravel services may be called from Blade templates, and the templating engine itself can be extended with custom directives.

· IoC containers make it possible for new objects to be generated by following the inversion of control (IoC) principle, in which the framework calls into the application- or task-specific code, with optional instantiating and referencing of new objects as singletons.

· Migrations provide a version control system for database schemas, making it possible to associate changes in the application's codebase and required changes in the database layout. As a result, this feature simplifies the deployment and updating of Laravel-based applications.

· Database seeding provides a way to populate database tables with selected default data that can be used for application testing or be performed as part of the initial application setup.

· Unit testing is provided as an integral part of Laravel, which itself contains unit tests that detect and prevent regressions in the framework. Unit tests can be run through the provided artisan command-line utility.

· Automatic pagination simplifies the task of implementing pagination, replacing the usual manual implementation approaches with automated methods integrated into Laravel.

· Form request is a feature of Laravel that serves as the base for form input validation by internally binding event listeners, resulting in automated invoking of the form validation methods and generation of the actual form.

· Security is a feature of Laravel that takes care of the security within its framework. It uses salted and hashed password, which means that the password would never save as the plain text in database. It uses Bcrypt hashing algorithm for generating encrypted representation of a password. Laravel uses prepared SQL statements which make injection attacks unimaginable. Along with this, Laravel provides a simple way to escape user input to avoid user injection of <script> tag.

· Artisan is a Laravel built-in tool for command-line that creates and handles the project environment. This tool allows us to perform the majority of those repetitive and tedious programming tasks that most of the developers avoid to perform manually.

All these amazing benefits help in easy and fast development of web application. This type of framework is mostly beneficial in Enterprise application development. It is a promising framework and has a bright future ahead in development.

 

Table 2.1 Laravel project directory structure

Root folder Purpose
app It contains the Models and Controllers of the application. It also contains all of the logic for performing any operation. Models are placed directly inside this folder.
bootsrap This folder contains the basic setting for starting the application
config This folder contains all configuration settings of the application like database connection, including core classes, email settings, etc.
database This folder contains the code for database transactions like creating table, modifying columns, adding default rows in database, etc.
public This folder is can be seen by outer world. This is the directory that is to be pointed to web server. All static assets (like css, js, less, etc.) are placed here. The index.php file in this folder calls the bootstrap folder files and other core files and starts the application. This index.php file receives all of the requests and after complex process responses the content to the visitor. In other words, this is the file which transactions with browser.
resources This folder contains the resources of the application like views, raw assets, language for localization, etc.
storage This folder stores the local data like sessions, caches, compiled views files, etc.
tests This folder contains all tests of application
vendor This folder contains all third party files (dependencies and additional prepackages for plugins) and code files of the laravel frameworks.

Other important folders and files are:

  • app/ Http: This folder contains controllers and routes. Routes are defined in routes.php and controllers are defined in Controllers folder. This folder contains two more folders. Requests folder handles the form requests and Middleware folder contains middlewares.
  • app/ Exception: This folder contains the exception classes
  • app/ Services: This folder is used for defining new services. By default it contains registrar service (used for registering new users).
  • app/ Providers: This folder registers and binds the services.
  • resources/views: This folder contains the views files.
  • .env: This is a hidden file in root folder of the application. This file contains the private data like database username and password, email configuration data etc.

MVC

Laravel follows the model-view-controller (MVC) architectural pattern, which enforces a separation between “business logic” from the input and presentation logic associated with a graphical user interface (GUI). In the case of Laravel web applications, the business logic typically consists of data models for things like users, blog posts, and the GUI is just a web page in a web browser. The MVC design pattern is very popular in the web development space.

There are three components to the MVC pattern:

· model - Models are the real world entities. In other words, models are the real world entities conventions in the form of data at website. The domain that your software is built around. Models are based on real-world items such as a person, bank account, or product. If you were building a blog, your models might be post and comment. Models are typically permanent and will be stored outside the application, often in a database. A model is more than just data; it enforces all the business rules that apply to that data. The model acts as both a gatekeeper and a data store.

· view - The visual representation of a model, given some context. It’s usually the resulting markup that the framework renders to the browser, such as the HTML representing the blog post. The view layer is responsible for generating a user interface, normally based on data in the model. Although the view may present the user with various ways of inputting data, the view itself never handles incoming data. The view’s work is done once the data is displayed.

· controller - The coordinator that provides the link between the view and the model. The controller is responsible for processing input, acting upon the model, and deciding on what action should be performed, such as rendering a view or redirecting to another page.

 

Figure2.2 MVC components a typical Laravel application

 

When interacting with a Laravel application, a browser sends a request, which is received by a web server and passed on to the Laravel routing engine. The Laravel router receives the request and redirects to the appropriate controller class method based on the routing URL pattern.

The controller class then takes over. In some cases, the controller will immediately render a view, which is a template that gets converted to HTML and sent back to the browser. More commonly for dynamic sites, the controller interacts with a model, which is a PHP object that represents an element of the application (such as a user, blog post) and is in charge of communicating with the database. After invoking the model, the controller then renders the final view (HTML, CSS, and images) and returns the complete web page to the user’s browser.

Laravel promotes the concept that models, views, and controllers should be kept quite separate by storing the code for each of these elements as separate files in separate directories. This is where the Laravel directory structure comes into play.

Design patterns such as MVC are created to make a developer’s life easier. This is where Laravel scores over plain PHP which doesn’t follow any sort of paradigm. If this discussion seems a bit abstract right now, worry not! After you start working with Laravel, you won’t even realize that you are working in a design pattern. It all becomes natural to you after a while.

Composer

Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

Composer is not a package manager in the same sense as Yum or Apt are. Yes, it deals with "packages" or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project. By default it does not install anything globally. Thus, it is a dependency manager. It does however support a "global" project for convenience via the global command.

Suppose:

1. You have a project that depends on a number of libraries.

2. Some of those libraries depend on other libraries.

Composer:

1. Enables you to declare the libraries you depend on.

2. Finds out which versions of which packages can and need to be installed, and installs them (meaning it downloads them into your project).

 

Using Laravel Composers allows you to have clean code without duplicating any of the data. Though there are many different ways of doing this, the way in this guide is, in my opinion, the correct way of doing it using Laravel Composers.

Code syntax 2.4 Create new Laravel project via composet

Artisan CLI

A developer has to usually interact with the Laravel framework using a command line that creates and handles the Laravel project environment. Laravel provides built-in tool for command-line called Artisan. This tool allows us to perform the majority of those repetitive and tedious programming tasks that most of the developers avoid to perform manually.

Artisan can be utilized to create a skeleton code, the database structure and build their migration which becomes very easy to manage the database system. It can also be engaged to generate the basic MVC files right away through the command-line and manage those assets and their respective configurations. Artisan even lets us create our own commands and do convenient things. Lastly, we can also perform Unit tests for our application through this.

The features of Artisan are mapped to different subcommands of the artisan command-line utility, providing functionality that aids in managing and building Laravel-based applications. Common uses of Artisan include managing database migrations and seeding, publishing package assets, and generating boilerplate code for new controllers and migrations; the latter frees the developer from creating proper code skeletons. The functionality and capabilities of Artisan can also be expanded by implementing new custom commands, which, for example, may be used to automate application-specific recurring tasks.

 
 

 


Code syntax 2.5 Create RESTful Resource Controllers via artisan command



Поделиться:


Последнее изменение этой страницы: 2016-08-10; просмотров: 233; Нарушение авторского права страницы; Мы поможем в написании вашей работы!

infopedia.su Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав. Обратная связь - 3.144.84.155 (0.004 с.)