Giter Club home page Giter Club logo

shoppinglist_backend's People

Contributors

j-8 avatar jklmnn avatar k3a avatar maltekiefer avatar white-gecko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

shoppinglist_backend's Issues

Create database in INSTALL.php

Can we create the databases in the INSTALL.php file? Since this just needs to be done once.
I would also provide a init() function in the pdo class (see #38 ) that would create the table according to #47 . But due to the abstraction the database cannot be easily created there.
The init() function should be called after database creation. All necessary informations should be already in the config file (because the new database connector takes the config array as second argument).

Create install.php

Create install.php for shared hosting support and automatic creation of MySQL database.
Also supplies base for future features.

Merge update-new-app-version branch with master

Sorry, I did not have the time.
The new app version has been pushed to fdroid and will only work with the new backend.

I hope I can comment while on vacation.
See you then, my flight leaves soon!

Installation description

Hello,
I've tried to set up the backend, but wasn't successful.
App always displayes "Authentication failed".
Api-Key double checked and OK
I guess it's something related to access rights on my server?! I also didn't find the SQLlight DB.

Would be great to have a HowTo.

Best regards DaZeller

List cannot load on first start

List wont load when starting the app. Placed the getList() command in the wrong place.
Will be fixed in the next update:)

' in the entry causes and error

I'm entering something like "Joe's favourite sauce".

The apostrophe (') in the entry field causes the following error

The response did not make sense: <br /><b>Warning</b>: SQLite3::query(): Unable to prepare statement: 1, near &quot;s&quot;: syntax error in /var/www/.../ShoppingList_Backend/sqlite_connector.php on line 47. Fatal error: Call to a member function fetchArray() on boolean in /var/www/

PHP < 5.5

For those guys using a php-version lower than 5.5: you will see a blank screen after filling in all fields of http://<your_location>INSTALL.php and hitting the CREATE-button.
The reason for that issue is a FALSE-value as a result from the non-existing "password_hash()"-function. Go and get your copy of the repo at "https://github.com/ircmaxell/password_compat". Put it's files into your shopping-List-directory and last but not least: do not forget to "require 'password_compat-master/lib/password.php';" within INSTALL.php and config.php (if you are hashing your security token manually).

Wasn't that easy to get familliar to this - anyway, shopping-list is working now. Good job!

License.

What license should this project get?
I recommend GPLv3

Unified database layout.

While trying to create a pdo abstraction (see #38 ) I noticed that the MySQL and the SQLite databases have different table layouts. That makes it difficult to create an abstraction and would cause much more code that could be avoided.
I would suggest using a unified table layout.
I would use:
STRING item PRIMARY INDEX NOT NULL; INT count NOT NULL; BOOL checked NOT NULL;

Make clear branches.

We currently have a lot of different branches on different states. I recommend to use some rules to get these branches under control:

  • the current stable release is always on master
  • changes on master only contain bugfixes
  • the next stable version is always on experimental
  • on a major upgrade experimental is merged in master
  • new functionalities or APIs that are not bugfixes must only be forked from and merged into experimental
  • bugfixes that have been applied to master also have to be applied to experimental unless the bug is fixed/not existent anymore through another change
  • equal branches have to be merged together
  • branches that cannot be merged anymore either have to be recreated or deleted

The reason is, that we have currently two branches that address a new version and that some changes that made it into master have not be applied to either of these two so these bug might be again in the next version.

Versions and Milestones

I think it would be helpful if Versions and especially Milestones are the same with backend and app. So we can easier sort what each of us needs to do.
Do you have an idea?

Web frontend

Hi,

The mobile app is great but it's a real pain to input a full list on a phone : is there some plan to make a web version (to make the input with a real keyboard) ?
Didn't see anything like this on the roadmap.

make api work with php < 5.6

ubuntu server currently uses
PHP 5.5.9-1ubuntu4.11 (cli) (built: Jul 2 2015 15:23:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

so the function http://de2.php.net/hash_equals is not available

i needed to add the following to api.php to use the server api with the app

Error in Insert Into

When you declare a var for table, then you should use it in mysql_connector:

$stmt = $handler->prepare("INSERT into testlist(item,count) VALUES(?,?)");

Thanks

Use AGPL instead of GPL

As this is server-side code, I think that the code would be better protected under the AGPL instead of the regular GPL.

PHP Requirements

The PHP requirements according to the readme are >= 5.
As INSTALL.php uses the password_hash() function, the requirements are in fact >= 5.5.0.
This leaves two options:

  1. Update the readme
  2. Use crypt() instead
    I would prefer option 2, as I am currently stuck on PHP 5.4 ;-)

Webhook

I have added a webhook to test new functions.
You can always access the devel branch at [https://janb.org/devel]
Any suggestions?

auth key is not accepted

hey there!

followed the instructions in readme.md. I created a new user shoppinglist with its own database and password. I'm using mysql.

I tried to setup the authkey in config.php.

I ran

php config.php testpassword

i am no expert in this, but shouldn't the hash always be the same? when i run it multiple times i get a new result each time.

root@odroid:/var/www/shoppinglist# php config.php testpassword
$2y$10$TWB8FAZmuec7YM5AJCmLv.qaJIXSgrR7cTIAhI7oQYwSti2LOIMny

root@odroid:/var/www/shoppinglist# php config.php testpassword
$2y$10$V8LRuyvk/IjHXP1eWyzJbuGgfjSzauGtmwPAKZuj2xQvznGhOi9AS

Is there something wrong with my apache or php config maybe? I read that the blowfish hash function is used.

Cant get the app to access the backend...

any suggestion?

update: cloned the repo again, ran install.php again and this time payed more attention when chosing a password.

still the app says that the auth key is rejected...

Apache log says this btw:

[Tue Aug 25 17:40:38.381868 2015] [:error] [pid 32015] [client 192.168.2.205:47002] PHP Notice: Undefined index: auth in /var/www/shoppinglist/api.php on line 14

Put backend version in header

I think it would be helpful if the app checks if the backend has a certain version to check for compatibility and to give a notice to update. (The update progress we yet have to figure out...)
Right now this would help, because app 1.1 is not compatible with the initial backend.
api.php:

header("ShoLiBackendVersion: 1");

Any comments or should I just implement it?

Implement new error handling into api

Morning!
I added improved error handling to the app. In my opinion the most important thing :)
So whenever an error is thrown by the api:

 die (json_encode(array('code' => 'error', 'comment' => 'no database type specified')));

it should now be:

 die (json_encode(array('type' => 1000, 'content' => 'specific error message')));

The values of type are all in CONSTANTS.php and the error message will be whatever is in 'content'.
Therefore we can give out new errors, without having to modify the app. So the app will show an error with 'content' as long as the 'type' is >= 5000.

.htaccess first start

Add in .htacces DirectoryIndex to INSTALL.php before installation.
After installation set it to api.php

Windows App

Hi,

I am superior to create a Windows VB Net App for the Shopping List.
What do you think about it?

SQL Template

It would be nice to have a SQL Template for the table you need

No Time

Sorry, guys.
You see and the next 2 weeks too I have so much work to do, that I didn't find th time to help you.
Sorry

Add CONTRIBUTING.md

We need a guide for contributions so that we are all on the same level and everybody knows that the devel branch is where things happen. Also how to give out errors and how to give proper feedback.

Error handling on multiple* functions.

I went throught the database connectors and noticed that the error handling on multipleSave/multipleDelete is misleading. You iterate over all items and overwrite the return value each time. So the return status depends only on the last action.

Update function

The Server/Backend Need an update check.
It must check if there is a new Version from the backend, then download and install the new api.
Also it should send a notice message back to the user, that the Version on the Server is old and Need to update, when there is a major update like update the SQL Dump or secruity stuff like Password encryption!

PPA

I have created a PPA for the backend. The current package is the version 1.0 and build from the First Release code.
Commit: 03923e5

Database conversion script.

We maybe need to create a database conversion script, that converts the databases from the old structure to the one specified in #47 .

Installation ok, working no

Hi,

I saw your project and wanted to test it. I did the backend installation on PHP Version 5.6.13.

In the android app, I configured the settings properly and it's the firt time I run the app. I got the message:
The server did not sent any content back. Likely due to an internal server error.

Here are my apache log. Can you help me to make the app work?
I choosed SQlite but the file shoppinglist.sqlite was not created. How do I initialize it for the first time?

Apache2 acces.log
[01/Oct/2015:10:37:39 +0200] "POST /sholi/api.php/ HTTP/1.1" 500 2

Apache2 error.log
[:error] [pid 31406] [client 10.33.131.37:49095] PHP Notice: Undefined index: item in /home/jean/web/dev/sholi/api.php on line 13
[:error] [pid 31406] [client 10.33.131.37:49095] PHP Notice: Undefined index: count in /home/jean/web/dev/sholi/api.php on line 14
[:error] [pid 31406] [client 10.33.131.37:49095] PHP Notice: Undefined index: jsonArray in /home/jean/web/dev/sholi/api.php on line 15
[:error] [pid 31406] [client 10.33.131.37:49095] PHP Fatal error: Class 'SQLite3' not found in /home/jean/web/dev/sholi/sqlite_connector.php on line 10

FAB Button and Coordinator Layout

The Floating Action Button should react to the Snackbar with a Coordinator Layout, not with a timer. Right now it gets pushed to far up when multiple actions occur.

Update devel to implement new item values

I would be very thankful if someone could update the database connector and api.php to incorporate the new itemCategory and a function to toggle the 'checked' value.

I am working on adding the features to the app.
The function save and delete can also be deleted, because even when you add a single item, the app will use saveMultiple from now on.

Thanks :)

Define Project

I watch over this project for the last days. And i think what we should do is define a script, milestones or somethink lile this to describe the project. What should the project do and so on
I think else we will lose the overview and the project will be lose a lot off thinks

Move user specific files out of way.

We currently have the config.php in git. When the user sets it up and then loads a new version, it will be overwritten.
We should move config.php to config.php.def (to keep a definition file) and create a new config.php on install.
The same applies to .htaccess.
We also should add those files to .gitignore to prevent inadvertently pushing of credentials to the repo.

Update redundant.

I have just noticed that the update command is not necessary. In the backend, if the command is save, and the item exists, it gets updated. That's actually the same as if you would send the update command. So I'd recommend to drop the update command and only use save.
(To be clear, I'm speaking about the post commands the app sends to the backend. The update function for the database is indeed necessary).

REST Api

What do you think of using a REST Api for the backend?
I think it would help to create a standardized way of altering and retrieving data.
We could use the Slim Framework, so no need to reinvent the wheel.
Another benefit would be that the app would hopefully become less complicated programming wise. I never had scalability in mind and the code is basically a very rough proof of concept.

So, what are your thoughts?

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.