https://github.com/aretecode/todo
Using some Aura libraries
https://github.com/aretecode/todo
Last synced: 4 months ago
JSON representation
Using some Aura libraries
- Host: GitHub
- URL: https://github.com/aretecode/todo
- Owner: aretecode
- License: mit
- Created: 2015-07-07T21:49:50.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-12T22:09:33.000Z (over 10 years ago)
- Last Synced: 2025-01-07T22:18:49.483Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 324 KB
- Stars: 5
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Todo
An experiment with [ADR](https://github.com/pmjones/adr)
[](https://travis-ci.org/aretecode/Todo)
[](https://www.codacy.com/app/aretecode/Todo)
## Instructions
1. Set DB in .env
2. Create the tables (using the following SQL)
```sql
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL COMMENT 'Username',
`email` varchar(255) NOT NULL COMMENT 'Email',
`password` varchar(255) NOT NULL COMMENT 'Password',
`fullname` varchar(255) NOT NULL COMMENT 'Full name',
`website` varchar(255) DEFAULT NULL COMMENT 'Website',
`active` int(11) NOT NULL COMMENT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `users` (`id`, `username`, `email`, `password`, `fullname`, `website`, `active`) VALUES
(1, 'harikt', 'hello@example.com', '$2y$10$PAzgJnHd/gTQzNznVg7un.HGEuGHYtYACCFknGuf.4diSunu3MA7C', 'Hari KT', 'http://harikt.com', 1),
(2, 'pmjones', 'hello@example.com', '$2y$10$vtW.Fu8fhWuuCZz6s/jus.ilkzOMjMGwbzdkZNUzIVZLc.PV/6dVG', 'Paul M Jones', 'http://paul-m-jones.com', 1);
```
```sql
CREATE TABLE `todo` (
`todoId` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(255) NOT NULL COMMENT 'String description of this Todo',
`userId` int(11) DEFAULT NULL COMMENT 'Id of the User connected to this Todo',
PRIMARY KEY (`todoId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```
3. Change into the project directory (is `todo` here), then start the built-in PHP web server:
```
cd todo
php -S localhost:8080 -t web/
```
4. Browse to `` to do some stuff with a GUI
5. You can browse to `` or with other commands
> if using ajax, change the `var url = ` in [ajax.php](https://github.com/aretecode/Todo/blob/master/web/ajax.php)
OR
- Change into the project directory (is `todo` here) and go to ``
## Questions:
Should Parameters in Domain be (array), or individual?
> Whichever makes more sense for your domain
Why does EditItemInput not work?
> Unknown, debug with playing around with the $_SERVER
Add vs Create?
> Add makes more sense when using Views and with that View, reaching into the domain only for defaults
How to best test testGetListSuccess ? get results from db & compare? Regex compare just a bit of it?
> Current comparison is fine, think it is something with Zend
Does it compare Input instead of Output if it is a 404?
> Yes, but in Zend
Why can't traits be set in Aura.Di config?
## @TODO:
* [ ] AuthorizationService implementation.
* [x] ~~Fix User~~
* [x] ~~Add Login form for the authentication.~~
* [ ] Put it on a demo site so it can be played around with.
* [x] ~Make the aj(ax) example not just interpret other HTTP status codes as `error` but react respectively.
* [ ] Add Views
* [ ] Hotswap Responses
* [ ] getItemTest
* [ ] userTest
* [ ] Add proper uses of HTTP Methods (especially Put)
## Credits (uses)
- [Radar](https://github.com/radarphp/Radar.Adr/)
- [ADR](https://github.com/pmjones/adr)
- [AuraAuth example](https://github.com/harikt/authentication-pdo-example)