• Stars
    star
    334
  • Rank 126,264 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Yeoman generator for scaffolding Sails REST API with predefined features

generator-sails-rest-api

This project is no longer supported. The only author and contributor who was using Sails and wrote the tool to simplify his regular work quit working with Node.js REST APIs and Sails. Though, if you are interested in take an ownership and became a full-plegded contributor, send a note to [email protected].

Join the chat at https://gitter.im/ghaiklor/generator-sails-rest-api

Downloads Downloads npm version License

semantic-release Commitizen friendly dependencies dev dependencies

Onix-Systems

Yeoman generator that provides already configured and optimized Sails REST API with bundle of predefined features.

Build Status

Version Build Status Coverage Status
Edge (dev) Edge Version Edge Version
Stable (master) Stable Version Stable Version

Features

  • Generator is split in more smaller parts, so that you are able to scaffold models, policies, controllers, etc... separately;
  • Disabled hooks by default: csrf, grunt, i18n, pubsub, session, sockets, views;
  • Flexible questions that allow to you quickly configure database connections, services that you want to use, etc...
  • Implemented authentication layer based on passport with JWT and Local strategies, Facebook, Twitter, VKontakte, GitHub, Instagram, Google Plus and other social networks;
  • Overrides defaults blueprints which simplify CRUD operation in REST API and adds new features like fields or populate in requests;
  • All configuration files cleaned up and optimized for REST API;
  • Some generators can scaffold predefined functionality;
  • Sub-generator that simplifies creating cron configuration;
  • Logger generator can scaffold logging configuration for bunyan, winston or use default Sails logger;
  • Overridden responses which respond with code (Status Code), message (Status Message) and data (Response Data) fields;
  • Bundle of ready-2-use services like CipherService, PusherService (Push Notifications), SmsService and so on... You can check the table with detailed list of implemented services below;
  • Bunch of Sails adapters is already declared in connections.js configuration file so you can easily swap between them;
  • Implemented useful express middleware like Connection: keep-alive and GZip compression. In a nutshell, all what optimizes HTTP performance;
  • Swagger generator can scaffold Swagger UI Explorer for you project;

Getting Started

Console

Install yeoman and generator-sails-rest-api:

npm install -g yo generator-sails-rest-api

Create project directory and initiate the generator under the project directory:

mkdir my-project
cd my-project
yo sails-rest-api

You will be prompted to answer to questions. Answer to those questions and you will get configured Sails project.

After scaffolding the project you can use this project as before. Just run the app.js file or use npm scripts.

npm start

WebStorm 11

Start creating new project and choose Yeoman type:

WebStorm 11 Create New Project

If you have installed sails-rest-api generator then just chose it and click Next. Otherwise, click Install generator and search for sails.

WebStorm 11 Search and Install generator

When you click Next button after the generator was chosen, answer the questions that you'd been prompted.

WebStorm 11 Prompt and Answers

Congratulations, you just have setup your first Sails REST API 👍

Bundled Sails services

Service Name Implemented providers
CipherService JWT
HashService bcrypt
ImageService GraphicsMagick, ImageMagick
LocationService Google, Yandex, FreeGeoIP and a lot of others
MailerService direct, sendmail, SMTP, SES and a lot more
PaymentService BrainTreePayments, Stripe
PusherService Apple Push Notifications, Google Cloud Messaging
SmsService Twilio
SocialService Facebook
StorageService Amazon S3, Local

License

The MIT License (MIT)

Copyright (c) 2015 Eugene Obrezkov aka ghaiklor

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

type-challenges-solutions

Solutions for the collection of TypeScript type challenges with explanations
HTML
470
star
2

iterm-fish-fisher-osx

Semi-automatic installer for Command Line Tools + Homebrew + iTerm2 + Fish Shell + Fisher + Plugins/Themes
Shell
375
star
3

llvm-kaleidoscope

LLVM Tutorial: Kaleidoscope (Implementing a Language with LLVM)
C++
233
star
4

kittik

Create slides in TypeScript and present them in the terminal using ASCII only!
TypeScript
179
star
5

terminal-canvas

Manipulate the cursor in your terminal via high-performant, low-level, canvas-like API
TypeScript
171
star
6

awesome-internals

A curated list of awesome resources and learning materials in the field of X internals
128
star
7

telegram-bot-github

Allows to you receive GitHub notifications right in the Telegram
JavaScript
119
star
8

ghaiklor-os-gcc

Simple operating system with its own bootloader, drivers for screen and keyboard, libc (for educational purposes)
C
117
star
9

backup-my-github

Clones all your repositories to local machine
Shell
107
star
10

sails-hook-cron

Sails hook for running cron tasks
JavaScript
89
star
11

nand-2-tetris

Computer built from the ground up on top of own CPU, while compiler and assembler for it implemented in Rust language
Assembly
74
star
12

icecast-parser

Node.js module for getting and parsing metadata from SHOUTcast/Icecast radio streams
TypeScript
70
star
13

pascal-interpreter

A simple interpreter for a large subset of Pascal language written for educational purposes
JavaScript
34
star
14

sails-service-mailer

Service for Sails framework with Mailer features [DEAD]
JavaScript
31
star
15

generator-es6-npm-module

Yeoman generator for starting ES6 npm module with Mocha, Istanbul, Travis, Coveralls
JavaScript
28
star
16

flappy-bird

Flappy Bird, a game you can barely play for more than a few seconds without throwing your phone
JavaScript
23
star
17

passport-google-plus-token

Passport strategy for authenticating with Google Plus via OAuth2 access tokens
JavaScript
23
star
18

node-print-message

Node.js module for printing out beautiful messages in console
JavaScript
21
star
19

sails-service-pusher

Service for Sails framework with Pusher features [DEAD]
JavaScript
20
star
20

advent-of-code-2015

Solutions for Advent of Code - a series of small programming puzzles for a variety of skill levels
JavaScript
19
star
21

assetsjsloader

Async loader which loads CSS and JS files
JavaScript
15
star
22

iterum

Interpreter for a subset of ECMA specification implemented on top of recursive descent parser
TypeScript
15
star
23

sails-service-payment

Service for Sails framework with Payment features [DEAD]
JavaScript
15
star
24

sails-service-sms

Service for Sails framework with SMS features [DEAD]
JavaScript
12
star
25

passport-instagram-token

Passport strategy for authenticating with Instagram via OAuth2 access tokens
JavaScript
12
star
26

sails-service-image

Service for Sails framework with Image features [DEAD]
JavaScript
10
star
27

sails-service-storage

Service for Sails framework with Storage features [DEAD]
JavaScript
10
star
28

passport-github-token

Passport strategy for authenticating with GitHub via OAuth2 access tokens
JavaScript
10
star
29

battlecity

The most popular game clone from our childhood
JavaScript
10
star
30

codemirror-mode-jsonata

CodeMirror mode for the JSONata language
JavaScript
8
star
31

sails-service-social

Service for Sails framework with Social features [DEAD]
JavaScript
8
star
32

tiny-three-pass-compiler-codewars

Three-pass compiler for a simple programming language into a small assembly language
JavaScript
7
star
33

polycolors

Yet another command-line coloring library with RGB support
JavaScript
5
star
34

sails-service-cipher

Service for Sails framework with Cipher features [DEAD]
JavaScript
5
star
35

bash-im-terminal

Terminal client for viewing Bash.IM
JavaScript
5
star
36

sails-service-location

Service for Sails framework with Location features [DEAD]
JavaScript
4
star
37

openlayers-tools

OpenLayers wrapper, which simplifies work with it
JavaScript
4
star
38

sails-service-hash

Service for Sails framework with Hash features [DEAD]
JavaScript
4
star
39

arves

Another RISC-V Educational Softcore
VHDL
4
star
40

passport-soundcloud-token

Passport strategy for authenticating with SoundCloud via OAuth2 access tokens
JavaScript
3
star
41

passport-reddit-token

Passport strategy for authenticating with Reddit via OAuth2 access tokens
JavaScript
3
star
42

sails-hook-acl

Sails hook that implements ACL that don't tight with session or databases and easy configurable [DEAD]
JavaScript
3
star
43

passport-vkontakte-token

Passport strategy for authenticating with Vkontakte via OAuth2 access tokens
JavaScript
2
star
44

passport-yahoo-token

Passport strategy for authenticating with Yahoo via OAuth2 access tokens
JavaScript
2
star
45

cloudflare-multiplex-sw-2016

Technical task for CloudFlare company (Aug 2016)
JavaScript
2
star
46

passport-twitch-token

Passport strategy for authenticating with Twitch via OAuth2 access tokens
JavaScript
2
star
47

passport-yandex-token

Passport strategy for authenticating with Yandex via OAuth2 access tokens
JavaScript
1
star
48

tessel-vesnasoft-2015

Tessel application for demonstrating accel, ambient, camera, climate, servo and leds
JavaScript
1
star
49

ghaiklor-os-rust

Simple operation system created in educational purposes with Rust.
Rust
1
star
50

atmega-2560-hexapod

Arduino sketch for DAGU Spider controller
C++
1
star
51

flood-it

Flood It! is a simple addictive strategy game in which you have to flood the whole game board with one color
JavaScript
1
star
52

passport-windows-live-token

Passport strategy for authenticating with Windows Live via OAuth2 access tokens
JavaScript
1
star
53

dimension-shock-poc

A re-imagining of the chess game, where game involves playing in two distinct dimensions simultaneously
JavaScript
1
star
54

passport-amazon-token

Passport strategy for authenticating with Amazon via OAuth2 access tokens
JavaScript
1
star