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

Vartan Arabyan
  • 2,925
  • 7
  • 25
  • 35

6 Answers6

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

Community
  • 1
  • 1
Doa
  • 1,965
  • 4
  • 19
  • 35
  • RailwaysJS does not use mongoosejs and is more like ActiveRecord without a schema approach. I am not looking for another Framework just a utility. – Vartan Arabyan Jul 17 '12 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... – Vartan Arabyan Jul 23 '12 at 15:24
  • To clarify in case someone else stumbles onto this, railwayJS (now known as compound.js) _does_ support mongoose. See http://compoundjs.com/docs.html and ctrl+f for "mongoose". – Andreas Hultgren Aug 12 '13 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...

saintedlama
  • 6,838
  • 1
  • 28
  • 46
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"
Osama Salama
  • 647
  • 1
  • 8
  • 17
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.

Zlatko
  • 18,936
  • 14
  • 70
  • 123
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.

Zhang Kai Yu
  • 362
  • 2
  • 8