How create User Database in Cloudant just like parse.com does? [closed]
Asked Answered
R

2

5

I am developing mobile apps(IOS), I have read couchDB documentation to access it using HTTP Api, But

1.how do I implement user sign up,user sign in,email verification? just like parse.com is doing.

My plan is to create a database with users and each document would be having username, password, first name, last name, isemailverified, some user preferences with some more key- values.

The is the challenge I face:

2.In case someone queries on UserDatabase, and if the query is a query not related to the current user, I should reject the query. To overcome this challenge I need to write server-side code with pre-post query validation methods. Where should I deploy or start writing this code?

Please feedback on the way my strategy is and where do I need to improve this?

I will be interacting with my backend using restful interface.

Rivet answered 12/2, 2016 at 18:16 Comment(0)
A
6

User management in CouchDB can be done through a special _users database. It's geared towards keeping login and end-user data in a special database, and it already implements some of what you need.

Cloudant has its own set of security features more geared towards the concept of "database users" than "application users". You use these to generate one or more API keys, granting varying levels of access to your data. This is geared towards having one or more backends sitting between your clients and your data. See also: this and this.

You can opt to use CouchDB security features on Cloudant, but several important bits are missing. The _users database in Cloudant is compatible with CouchDB 1.1.x. See the implications of this here.

Thanks to this lack of support for features released in 2012/13, a two-tier architecture is hard to accomplish on Cloudant, no matter what they say. It will be hard to avoid having a backend sit between the client (browser, mobile app, etc) and the database. But that's something you'll need eventually, if you want to send emails, etc.

For a backend that does just that, a Node.js app hosted Bluemix is an excellent choice. An alternative might be that same app hosted on Azure, US West (you can collocate Cloudant there).

Amman answered 14/2, 2016 at 16:36 Comment(0)
R
1

I guess I have to start with views in couchdb. http://guide.couchdb.org/draft/views.html

Rivet answered 12/2, 2016 at 18:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.