Build A Code Repo With Nextdb

1 view
Skip to first unread message

Eric Dorman

unread,
Dec 12, 2009, 8:05:03 PM12/12/09
to NextDB Users
Hey guys,

I have had this idea of a code repo for quite a few days so do you
think Nextdb could be used to power a code repo site similar to
Github.com or bitbucket.com?

I think a code repo in JS would be a really cool way of demonstrating
Nextdb size and great database storage power.

I think the Photo Gallery type example could be what I go off of as a
blue print,but how would I be able to upload .txt files?

God Bless,
Eric

MaldenJen

unread,
Dec 13, 2009, 11:56:02 AM12/13/09
to NextDB Users
Hmmm...not sure my reply to Eric's message went through, and I don't
have time to retype it now. If it disappeared, I'll write it again
later tonight. -Jen

MaldenJen

unread,
Dec 13, 2009, 11:53:02 AM12/13/09
to NextDB Users
Eric,

Could you use the REST URL that displays the web-based form to add a
new row to the Photo Gallery-type code repo database? Then, rather
than uploading a .txt form, you'd just paste the actual text into the
text field, and it would be added to the db onsubmit.

I forget how you form that URL, but Geoff can remind us. It's like
".../dbname/whatever-your-usual-URL-is/add" --or something like
that. :-)

Cheers,
Jen

On Dec 12, 8:05 pm, Eric Dorman <dorman...@gmail.com> wrote:

geoffrey hendrey

unread,
Dec 13, 2009, 2:31:01 PM12/13/09
to nextd...@googlegroups.com
Hi Jen,

Your first messages to the group get moderated. That's why your post didn't show up immediately, but now all your posts will go through right away because I've moderated your user to "always allow".

I'm glad you both brought up "gallery" because I've been cranking away at the REST 'galleries feature. I'd like to make it as automatic as REST tables. There will be a new url path parameter called 'format' which you can use like .../format/gallery on your URLs. When you choose a gallery format, the fields of each row are grouped together in a div. Gallery formatting is useful when your row represents a blog post, a file, a product, etc. You can still use the ../style/xxx path parameter to apply some built-in CSS styles so that you get a decent looking gallery.

I've added 'form' as a format, so for any data you can say .../format/form and the data will populate a form, using YUI Editor for text fields, and YUI Calendar for date fields. This allows you to edit any of the data.

The next thing I need to do is build out an "internal users" permission system. This request came through from Jen because she wants to allow her customer to edit content of a gallery, without letting the general public have write access. To do this, I'm going to introduce the notion of "system tables". You'll create a table called SYS_USERS and a table called SYS_ACCESS_CONTROL. In the SYS_USERS table must have 'username', 'password',and 'role' columns. The SYS_ACCESS_CONTROL table has columns 'role', 'url_regex', and 'permission'. Together, these two tables let you define 'system users', then give those users read or read/write access to certain REST URLs.

Example:

SYS_USERS:

username     password     role
=============================
jill                  letmein        site_admin
bob               hotrod          marketing

SYS_ACCESS_CONTROL

role                url_regex                           action
======================================
site_admin    /PRODUCTS                    GET,POST
marketing     /PRODUCTS                     GET
site_admin   /PRODUCTS/rowid            POST


Well, all this will become clearer after I finish it, and put a good description on the wiki page, but the long and short of it is that the goal is to allow the owners of the site you create to easily be able to edit the site content without having to know anything about nextdb. This is enabled by a new access control system that is administered simply be creating some special tables in nextdb. Through this new access control system, site admins can be given access to XSLT-enabled forms for editing data.

-geoff




--

You received this message because you are subscribed to the Google Groups "NextDB Users" group.
To post to this group, send email to nextd...@googlegroups.com.
To unsubscribe from this group, send email to nextdb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nextdb-user?hl=en.





--
http://nextdb.net - RESTful Relational Database
http://www.nextdb.net/wiki/en/REST

Eric Dorman

unread,
Dec 13, 2009, 2:36:53 PM12/13/09
to NextDB Users
Hey Jen,

Thanks for that great suggestion cause actually I think it could work.

See I am building this new javascript code repository feature for
Bespin, an online IDE for web developers built by Mozilla.

I am thinking of building this feature into it that would give
developers a way to share their code with anyone in a hosted code
repo,but on top of Bespins Core.

I thought Nextdb could help me with the storage of that code.

Thanks & God Bless,
Eric
Reply all
Reply to author
Forward
0 new messages