Code Monkey home page Code Monkey logo

expo's Introduction

ExpoNow Web App

The goal of the project is to deliver a virtual exposition application.

This project has been developed by Marcelo Duarte as way to demo the implementation of some modern web technologies, such as Objected Oriented PHP, CSS3 and HTML5.

Technical Objective

Allow companies to book their place in virtual expositions in different exposition events.

Companies will choose from available events the one they want to take place in, then they will choose their stand within the exposition hall from a map and finally they will receive a report about the users who visited their stand on the event after it is over.

Where you Are

This readme.md file has been placed under exposition/ directory, which is the root dir of the application.

How the Application Works

  • The Use Case UML Diagram below can give you a glimpse of how the app works.

Use Case

Development Environment

  • Back-end

  • Front-end

Configuring Environment

Considering that you already have a stable version of all tools listed above in the section Back-end, and that your PHP version is >= 5.5.9, with OpenSSL PHP Extension, PDO PHP Extension Mbstring PHP Extension and Tokenizer PHP Extension. If installing PHP may sound challenging you could also try Laravel HomeStead:

  1. Open a Terminal window in your system and execute the commands below to create an empty Laravel application and enter inside of the directory:

    laravel new exposition
    cd exposition

    The command above will create a directory called exposition containing all required Laravel files and respective dependencies.

  2. Once the Laravel application has been installed, we can then create our schema in the MySQL database with the command below:

    CREATE DATABASE IF NOT EXISTS `exponow` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

    The command above will create an empty schema called exposition.

  3. Now that the database schema for the application is ready, we need to configure our application to operate with it:

    1. Open the file .env find the following parameters (DB_DATABASE, DB_USERNAME, DB_PASSWORD) and change them accordingly with your database credentials:

      DB_DATABASE=exposition
      DB_USERNAME=< your database username >
      DB_PASSWORD=< your username password >

      Important: the user informed above must have privileges to create/drop tables in the schema of our application exposition. During the development we have used the default MySQL user root.

    2. Open the file config/database.php, find the array key 'default' and make sure it's configured as 'default' => env('DB_CONNECTION', 'sqlite').

      This will specify to Laravel that the default database connection parameters defined in the file .env should be used.

  4. Initialization of database: because we are using Laravel as a development framework, we don't need necessarily create our database tables prior to start coding/testing our application. Laravel provides a really powerful console utility called artisan(online doc), which gives us an interactive way to create our database as we build our code using MVC architecture.

    Thus when we reach the point to ship our app to the production environment we would be using an external tool like MySQL Workbench to Generate an E-R Diagram of the tables by reverse-engineering our schema exposition.

Building the Application

Database

As mentioned above we are using Laravel's artisan utility to create the PHP stub files responsible to either generate/delete our database tables.

One of the benefits of using artisan is that we will have an automated way to perform migrations in the database during the deployment of new versions of our application. For more details see Migrations.

To do that we go back to the Terminal window, which should be currently under the directory exposition/, as done in the step 1 of [Configuring Environment](#Configuring Environment), and execute a command like this below:

php artisan make:migration create_events_table --create=expo_events
php artisan make:migration create_stands_table --create=expo_stands
php artisan make:migration create_reservations_table --create=reservations

The commands above will generate the stub files, such as 2016_08_20_210129_create_events_table.php, which must be modified to have the column names of the table expo_event.

We have named our table as expo_event, instead of event, since more likely we would face name collision along the way in the development cycle, considering that frameworks, such as Laravel, often use the word event to name essential components. Thus we can easily track in the future all snippets that may refer the table expo_event.

Within this migration file we could also define/trigger further routines associated with a specific application version deployment.

Important: Laravel's migration API allows us to undo/rollback a migration through the command php artisan migrate:rollback, which at some point will invoke the method CreateEventsTable::down() of the respective Migration class created in the stub PHP file. But if the undo routine requires to drop a column from the database, Laravel will need a specific package to handle the operation. To install this specific package, which is called Doctrine/DBAL, while being in our root application dir exposition/ we can run the command below via Terminal.

composer require doctrine/dbal

Additional required modules

Being in the root application directory exposition/ we can run the following commands via Terminal.

For markup elements such as form inputs.

composer require laravelcollective/html

Update composer with command:

composer update

To complete the installation for the lib above, go to config/app.php add this lines:

in providers group:

Collective\Html\HtmlServiceProvider::class,

in aliases group:

'Form' => Collective\Html\FormFacade::class,
'Html' => Collective\Html\HtmlFacade::class,

License

The app is open-sourced software licensed under the MIT license.

expo's People

Contributors

hamedmehryar avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.