juicycleff / ultimate-backend

Multi tenant SaaS starter kit with cqrs graphql microservice architecture, apollo federation, event source and authentication
https://juicycleff.github.io/ultimate-backend-docs
MIT License
2.63k stars 409 forks source link

Documentation #111

Open juicycleff opened 4 years ago

juicycleff commented 4 years ago

The project has grown quite big in code and would make sense to have the project properly documented. So it can be easily understood in few hours of poking around

vijayksingh commented 4 years ago

@juicycleff I would like to understand the project and also contribute to the Documentation. Can you help me get started ?

juicycleff commented 4 years ago

@perceptron007 sure, could you tell me what you don't understand :)

juicycleff commented 4 years ago

link to docs https://github.com/juicycleff/ultimate-backend-docs

dmitrijs-pavlovs-dev commented 4 years ago

@juicycleff Hey :) I have a question regarding setting up as well. I'll post it here, hope it's an appropriate place. I am trying to start api-admin. Created a config.yaml in apps/api-admin based on the example. Started consul with consul agent --dev and put a config with consul kv put ultimatebackend/config/io.ultimatebackend.api.admin config.yaml. I checked the counsul kv store and it seems to contain a config with appropriate key

$ consul kv export
[
        {
                "key": "ultimatebackend/config/io.ultimatebackend.api.admin",
                "flags": 0,
                "value": "Y29uZmlnLnlhbWw="
        }
]

When i run api-admin, an error is returned, regardless of whether the consul store is populated or not.

$ npx nest start api-admin
Starting type checking service...
Hash: e92a9e59e02f02c2c03c
Version: webpack 4.42.1
Time: 33348ms
Built at: 2020-06-07 17:15:10
Entrypoint main = apps\api-admin\main.js
[Nest] 3232   - 2020-06-07 17:15:12   [NestFactory] Starting Nest application...
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] BootModule dependencies initialized +84ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] GlobalClientModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] CoreModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] PassportModule dependencies initialized +1ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] WebhooksModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] NotificationsModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] HttpModule dependencies initialized +4ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] PlansModule dependencies initialized +1ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] AppModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] ConsulModule dependencies initialized +1ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] RolesModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] CqrsModule dependencies initialized +12ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] TenantsModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] BillingsModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] CardsModule dependencies initialized +1ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] TenantMembersModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] UsersModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] AccessTokenModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] GraphQLSchemaBuilderModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [ConfigModule] ConfigModule initialized
[Nest] 3232   - 2020-06-07 17:15:12   [InstanceLoader] ConfigModule dependencies initialized +0ms
[Nest] 3232   - 2020-06-07 17:15:12   [ExceptionHandler] OAuth2Strategy requires a clientID option +3ms
TypeError: OAuth2Strategy requires a clientID option
    at FacebookStrategy.OAuth2Strategy (C:\Users\Dmitrijs\ftw\ultimate-backend\node_modules\passport-oauth2\lib\strategy.js:86:34)
    at new Strategy (C:\Users\Dmitrijs\ftw\ultimate-backend\node_modules\passport-facebook\lib\strategy.js:56:18)
    at new MixinStrategy (C:\Users\Dmitrijs\ftw\ultimate-backend\node_modules\@nestjs\passport\dist\passport\passport.strategy.js:31:13)
    at new FacebookStrategy (C:\Users\Dmitrijs\ftw\ultimate-backend\dist\apps\api-admin\main.js:12436:9)
    at Injector.instantiateClass (C:\Users\Dmitrijs\ftw\ultimate-backend\node_modules\@nestjs\core\injector\injector.js:289:19)
    at callback (C:\Users\Dmitrijs\ftw\ultimate-backend\node_modules\@nestjs\core\injector\injector.js:76:41)
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
    at async Injector.resolveConstructorParams (C:\Users\Dmitrijs\ftw\ultimate-backend\node_modules\@nestjs\core\injector\injector.js:117:24)
    at async Injector.loadInstance (C:\Users\Dmitrijs\ftw\ultimate-backend\node_modules\@nestjs\core\injector\injector.js:80:9)
    at async Injector.loadProvider (C:\Users\Dmitrijs\ftw\ultimate-backend\node_modules\@nestjs\core\injector\injector.js:37:9)
    at async Promise.all (index 7)
    at async InstanceLoader.createInstancesOfProviders (C:\Users\Dmitrijs\ftw\ultimate-backend\node_modules\@nestjs\core\injector\instance-loader.js:42:9)
    at async C:\Users\Dmitrijs\ftw\ultimate-backend\node_modules\@nestjs\core\injector\instance-loader.js:27:13
    at async Promise.all (index 14)
    at async InstanceLoader.createInstances (C:\Users\Dmitrijs\ftw\ultimate-backend\node_modules\@nestjs\core\injector\instance-loader.js:26:9)
    at async InstanceLoader.createInstancesOfDependencies (C:\Users\Dmitrijs\ftw\ultimate-backend\node_modules\@nestjs\core\injector\instance-loader.js:16:9)

Appreciate any help.

dyllanwli commented 4 years ago

@dayrim Facing same issue here. I also got another problem when try to build api service:

TS2740: Type 'Tenant' is missing the following properties from type 'TenantEntity': currentPlan, autoCommit, publish, commit, and 8 more.
juicycleff commented 4 years ago

@dayrim make sure you change consul kv store type to yaml, that solves the issue in most cases.

juicycleff commented 4 years ago

@dylanwli this is a typescript issue perhaps due to an upgrade in the typescript lib, you can just use ts-ignore to remove it

dmitrijs-pavlovs-dev commented 4 years ago

@juicycleff Thanks, changing kv store type to yaml via Consul web UI solved it.

dmitrijs-pavlovs-dev commented 4 years ago

@juicycleff Hello. Could you provide any link to a module/technology/technique that explains what // @inject_tag: bson:"id,omitempty" type of comments used for in proto files ?

juicycleff commented 4 years ago

@dayrim please ignore those flags its important in a golang replica I have of the Ultimate backend that is closed source. Its important for codegenration and biding to mongo bson schema. I just shared the proto files between I am planning to clean them