Code Monkey home page Code Monkey logo

generaptr's Introduction

npm Join the chat at https://gitter.im/generaptr/generaptr Coverage Status FOSSA Status

Generaptr is a node package that helps when starting up a project by generating boilerplate code for Express api.


Announcement

As of [email protected] this package would only hold the logic and core functionality of what was once generaptr. If you want to use the cli please use the new generaptr-cli package.


Table of Contents

  1. Documentation
  2. Minimum Requirements
  3. Installation
  4. Code of Conduct
  5. Contributing
  6. License
  7. References

Goal and Philosophy

Generaptr holds the core logic and functionality of generaptr-cli

Generaptr should ease the process of:

  • starting a new backend project
  • writing boilerplate crud operations
  • writing api specs

The package was developed under node 7.5 so a minimum requirement would be:

  • node >= v7.5.0
  • npm >= v3.10.10

npm install generaptr

Unit test

Unit test are written in Mocha and Assert. Please add a unit test for every new feature or bug fix. npm test to run the test suite.

Documentation

Add documentation for every API change. Feel free to send typo fixes and better docs!

Copyright (c) 2017 Darius Cupsa (twitter: @cupsadarius) Licensed under the MIT license.

FOSSA Status

generaptr's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

generaptr's Issues

refactor file names

We should refactor some file names, for example we don't need all files inside commons/utils to have the Util appended to their name, it can clearly be seen from the import that it's a util class.
The same goes for fileOperations, handlers and preprocessors.

generate models for non-relational databases

In the scope of this issue, we need to research how and if possible to read the "schema" of database based on the datasets in each collection. For example what we do for MySql right now, after some parsing looks somewhere on the lines of this.

  • MongoDb
  • RethinkDb
  • CouchDb

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Relations are detected wrong when foreign column has a different name than the table referenced

When the foreign key column name differs from the referenced table, generaptr detects the datatype wrong.

Examples:
user_id foreign key to users table results in a User datatype which is right
created_by foreign key to users table results in a Created_by datatype which is wrong, it should've been User

Progress:

  • replicated issue
  • solved mysql parsing schema
  • solved raml parsing schema
  • solved generating api which take in account alias names
  • fix lint issues and tests

separate the logic from the cli

I think we should probably separate the logic in generaptr in a separate package, and the cli which will use the core generaptr in another, this way we will have a bit more separation, and would make the testing a lot easier.

@StefanBalea What do you think?

move from types to classes

Since #40 we moved to typescript and in the rush of finishing that we added types for the commonly used data structures in the project such as DataType, Column, Table, Schema etc... I was wondering if we shouldn't move to a more OOP approach and declare those as models and in doing so we can move some of the logic from utils classes to the models itself.

I think it would simplify the overhead a bit when working with the handlers and processors and with the actual generation of the code.

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.