NUS Computing for Voluntary Welfare Organisation, AY2015/16—Assignment 1.
Author: Wong Kang Fei
Matriculation No.: A0138862W
Learn about the programming skills required for CVWO’s summer project and go through a website development cycle.The focus of this assignment is to promote proper code structure and coding techniques, familiarity with Structured Query Language (SQL) and the various development tools. Expected to build up a good web programming foundation through this assignment, and prepare for one development cycle over the summer.
Issue date: 10 December 2015
Mid-assignment submission due date: 19 December 2015
Final submission due date: 5 January 2016
Detailed write-up (in repo): https://github.com/kfwong/cvwo-assignment-1/blob/master/cvwo-assignment-1-writeup.pdf
Live demo @ AWS: http://52.25.200.39/
Default login credential: Email: writer@example.com Password: password
This project is programmed mainly using PhpStorm by Jetbrains. Recommend to clone the project directly into PhpStorm.
Make sure you have composer
, npm
, gulp
and php
installed in the your system, mysql
service is running.
All configuration resides in .env file, change the settings according to your system.
By default, the database configuration:
DB_DATABASE=cvwo_assignment_1
DB_USERNAME=root
DB_PASSWORD=root
Run the start.sh
bash script:
./start.sh
The script will attempt to update composer and pull in npm packages required by the project, as well as executing DDL in database and seeding them with data for testing.
Comment out the composer & npm update for faster subsequent startup.
If you do not have composer installed globally, make sure you change the syntax in start.sh
to reference the composer.phar
in your system.
- Install composer dependencies
php composer.phar install
- Install npm dependencies
npm install
- Run the Laravel Migration Script with seeding option
php artisan migrate:refresh --seed
- Run Gulp task (For compiling javascript/stylesheets to proper folder)
gulp
- Starts the server locally, by default visit: http://localhost:8000
php artisan serve
- Create a new Ubuntu Server AMI instance.
- Configure AWS security group, allow access on following ports: SSH(22), HTTP(80), MYSQL(3306)
- Create server keypair, setup association so local machine is recognize by the server through SSH/
- On the server, execute apt-get command to install apache, php, php5-mcrypt, mariadb, git-core
- Enable pdo extension in php.ini
- Clone the cvwo-assignment-1 to /var/www
- Install composer
- install npm, node
- Create empty database schema
- Create a copy of .env.example and rename it to .env
- Execute artisan command to generate a new APP_KEY.
- Fill in database details in .env
- Run artisan migration with seeding option
- Globally install gulp module through npm
- Execute gulp task
- Edit apache virtual host to point to /var/www/cvwo-assignment-1/public folder
- Enable apache mod_rewrite and restart apache service
- Add AllowOverride All directive to virtual host.
- Execute chmod to storage folder to make it writable by apache server.
- Start mysql and apache service.
- Model Factory with seeder relationship setup
- Laravel Development with PhpStorm
- Laravel built-in Authentication Guide
- Route Model Binding
- Session Flash Message
- Controller Middleware
- Seeding with model relationship
- PhpStorm autocomplete hint (IDE issue)
- Server timezone