60 lines
1.6 KiB
Markdown
60 lines
1.6 KiB
Markdown
|
# SVEN
|
||
|
|
||
|
SVEN is a supermarket management system.
|
||
|
|
||
|
## Requirements
|
||
|
- PHP Version 5.5 or higher
|
||
|
- because of password_* functions
|
||
|
## File Structure
|
||
|
- pages/ - Pages
|
||
|
- public/ - CSS & Javascript Files
|
||
|
- sys/ - Core and Framework Files
|
||
|
- mysql/ - MySQL Connection Wrapper
|
||
|
- security/ - Authentication & miscellaneous
|
||
|
- sources/ - Used Libraries
|
||
|
- sven/ - Some important classes
|
||
|
- templates/ - prebuilt elements
|
||
|
|
||
|
## API Request Methods
|
||
|
- GET - Read from database
|
||
|
- POST - Insert to database
|
||
|
- PATCH - Update in database
|
||
|
- DELETE - Delete from database
|
||
|
|
||
|
## API Output Scheme
|
||
|
```json
|
||
|
{
|
||
|
"state": "failed", // program state
|
||
|
"access": "granted|denied", // authentication
|
||
|
"msg": "{{custom_data_msg}}",
|
||
|
"data": "{{data}}",
|
||
|
"error": ["{{error}}", ...] // optional
|
||
|
}
|
||
|
```
|
||
|
|
||
|
## API Parameters
|
||
|
- article
|
||
|
- GET
|
||
|
- limit - limit output
|
||
|
- search_for - search for value
|
||
|
- in - column name to search in
|
||
|
|
||
|
## API Errors
|
||
|
- REQUEST_METHOD_NOT_SUPPORTED -> Request method not supported
|
||
|
- AUTHENTICATION_FAILED -> User not logged in. / Username or password wrong.
|
||
|
- BAD_REQUEST -> request or information are missing
|
||
|
- NO_OUTPUT -> No data was passed. Request unfortunately failed.
|
||
|
|
||
|
## Credits
|
||
|
- Ruben Meyer
|
||
|
- Bennet Kahrs
|
||
|
- [envms (fluentpdo)][fluentpdo]
|
||
|
- [Luís Cobucci (jwt library)][lcobucci]
|
||
|
|
||
|
## Not working things
|
||
|
- can't install laravel / composer to use an popular framework, so we had to write our own framework
|
||
|
|
||
|
|
||
|
[fluentpdo]: <http://envms.github.io/fluentpdo/>
|
||
|
[lcobucci]: <https://github.com/lcobucci/jwt>
|