I've hosted the app on heroku and I'm using continous integration to ship changes automatically and instantly(more on this later). You may visit the app using the following link:
http://simple-todo-rs.herokuapp.com/
On the backend I've built the following things:
The app is built using totally object oriented way and have strong type support that may detect breaks during development phase and thus increase speed.
For unit testing I'm using PHPUnit. Though, I've already started writing tests and continuing, but still it would take sometime to cover the whole codebase.
About comments, as the app covers a lot of features, I've tried to write the code verbosely, so that one may not need comments to understand the code(to manage my dev time). But still commenting is the de facto for doc. I'll try to take the whole codebase under comments with time.
[Note: the app runs automated testing on each push, but only deploys to heroku if the test is successful].
For database I've used postgresql. And to handle database operations I've used PHP PDO to perfom insert, delete, update etc. operations.
As a side note, for managing dependency Composer has been used.
If you want to run this app locally for your own usage or development, you can easily do so. Make sure you've installed PHP, composer and postgresql installed in your pc and an internet connection.
At first run composer to install the dependencies:
$ php composer.phar installNow, create a .env in the project root directory and put your db info there as follows:
DATABASE_URL=postgres://<username>:<password>@<hostname>:<port>/<dbname>You may also want to put other info in your .env file(do as per your need)
And then run:
$ php database/migrate.phpAfter creating db table you may run the tests:
$ ./vendor/bin/phpunitIf tests are successful then, you can run the app using php's development web server as follows:
$ php -c <path-to-php.ini> -t public/ -S 127.0.0.1:8000Now visit 127.0.0.1:8000 on your browser to use the webapp.
I've used PHPUnit for unit testing and a slightly edited(according to my need) script from devcoder-xyz/php-dotenv to parse .env file.
This repository is published under MIT License. To know more about license please visit this link.
I am thinking of explaining the whole architecture of this project to everyone who are interested in webapp development. I am thinking of planning a book(or tutorial kind of resource) about how to build an web application from scratch. If you have anything to contribute or advise, I'm all ears. Just give me a knock.