10

Is there a way to create a crud scaffold by using the schema model used?

Must not be a framework, more of a utility.

Currently using: ExpressJS MongooseJS MongoDB

3

6 Answers 6

7

I guess you could try to use RailwayJS? It has an example as well for setting up a CRUD scaffold:

railway init blog && cd blog
npm install -l
railway generate crud post title content
railway server 8888
open http://127.0.0.1:8888/posts

EDIT

There are a couple of alternatives, but I think Railway is your best bet, unless I misunderstand your question. You could implement something yourself, as was already suggested. For more on these alternatives, see these StackOverflow questions (you are not the first to ask this):

Is there a CRUD generator for Mongoose and Node.js and Underscore? Or a CRUD generator for a similar stack?

CRUD module or tutorial for node.js

3
  • RailwaysJS does not use mongoosejs and is more like ActiveRecord without a schema approach. I am not looking for another Framework just a utility. Jul 17, 2012 at 19:16
  • why dont you elaborate the couple of alternatives your are talking about as RailwayJS is not one of them that fits the criteria... Jul 23, 2012 at 15:24
  • To clarify in case someone else stumbles onto this, railwayJS (now known as compound.js) does support mongoose. See compoundjs.com/docs.html and ctrl+f for "mongoose". Aug 12, 2013 at 11:08
7

I created bumm, a command line tool for generating express project skeletons and scafflod models/routes/views that could fit your needs. The view generation is not exactly what you might want since bumm does not parse an existing model but expects the model fields to be passed as command line parameters. But it's open source...

1
  • can we have form field validations integrated into it Aug 28, 2015 at 14:14
1

I'm using MEANJS (www.meanjs.org) and it has a yeoman generator which doesn't only generate the seed app, but can generate a module for you which includes mongoose models, expressjs routes and controllers and the same for angular for a crud, but you can't specify the fields (got to code those in after the generator does the plumbing for you).

I would love to see them expand it to some generator where I can specify the fields and their type.

1

Assuming you already have node and npm installed

npm install -g express
npm install -g express-generator

Then use express to scaffold a webapp

express "app name"
0

I created a short tool for this purpose recently, CRUD scaffolder. It's not much, it has some problems, but it helped me start faster with some projects at the time.

0

I like these words: Must not be a framework, more of a utility.

Have you tried amur?

It's a utility for generating koa+mongoose+graphql API resources.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.