0.3.18 • Published 8 months ago

roadman v0.3.18

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

An efficient, and flexible NodeJS library for building backend services.

Roadman Features

FeatureProgress
CORE: expressjs, rest/graphql api, redis, queue, subscriptions
Couchbase - couchset orm
Auth & User - phone login, create user resolvers
Firebase - auth, storage, e.t.c

1. Install

npm i roadman --save

2. Basic example

import {roadman} from 'roadman';
import {Resolver, Query} from 'couchset';

// Create a demo GraphQL resolver
@Resolver()
class ExampleResolver {
    @Query(() => [String], {nullable: true})
    async apps(): Promise<string[]> {

        return ['Apps', 'one', 'two'];
    }
}

// run roadman
await roadman({resolvers: [ExampleResolver]});

3. With model automation

example file here

import {roadman} from 'roadman';
import {Model, ObjectType, InputType, Field} from 'couchset';

@InputType('PersonInput')
@ObjectType()
class Person {
    @Field(() => String, {nullable: true})
    id?: string = '';

    @Field(() => String, {nullable: true})
    firstname?: string = '';

    @Field(() => String, {nullable: true})
    lastname?: string = '';

    @Field(() => Number, {nullable: true})
    phone?: number = 0;
}

const PersonModel = new Model('Person', {graphqlType: Person});
const {resolver} = PersonModel.automate({
    getById: {public: true},
    createUpdate: {public: true},
    pagination: {public: true},
});

await roadman({resolvers: [resolver]});

3. With auth/user resolvers

import { couchsetRoadman } from '@roadmanjs/couchset';
import { firebaseRoadman } from '@roadmanjs/firebase-admin';
import { getAuthResolvers } from '@roadmanjs/auth';
import { roadman } from "roadman";

const resolvers = [...getAuthResolvers()];

const run = async () => {
  await roadman({
    roadmen: [firebaseRoadman, couchsetRoadman],
    resolvers,
  })
}

run();
0.3.9

10 months ago

0.3.17

8 months ago

0.3.16

8 months ago

0.3.15

8 months ago

0.3.14

8 months ago

0.3.13

8 months ago

0.3.12

10 months ago

0.3.11

10 months ago

0.3.10

10 months ago

0.3.18

8 months ago

0.3.5

1 year ago

0.3.4

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.19

2 years ago

0.1.18

2 years ago

0.1.12

2 years ago

0.1.13

2 years ago

0.1.14

2 years ago

0.1.15

2 years ago

0.1.16

2 years ago

0.1.17

2 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.8

3 years ago

0.1.9

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.0

3 years ago

0.0.2

3 years ago

0.0.0

3 years ago