Skip to content
/ kulu Public

A GraphQL implementation of a NodeJS API Service

Notifications You must be signed in to change notification settings

timkatee/kulu

Repository files navigation

NB : Project is in active development phase and should be used as a demonstration of the described concepts.

Kulu - GraphQL API Framework (NestJS, Apollo, Prisma)

GraphQL API implementation inspired by Domain Driven Design & Clean Architecture. It demonstrates Inversion Of Control through Dependency Injection a NodeJS

Why Kulu?

Kulu exists to ensure that people working on web backends, prototypes can easily have a base structure that can have them going in a jiffy.

It's simplistic, and with it comes an implementation informed by different experiences & lessons learnt from using different frameworks and approaches when building web applications.

Features

  • Extensible - Designed to allow easy addition of new capabilities & functionality.
  • GraphQL Support - Default API interface is GraphQL leveraging apollo libraries.
  • Graph Federation - Built as a subgraph that can be exposed via a federated gateway to enable building of applications as microservices.
  • ++more

Setup/Installation

Prerequisites.

  • NodeJS installation (Tested on v18.12.1).
  • Database (Tested with MySQL)(Since its using Prisma, any compatible database should be fine) docker-compose up -d
  • NestJS CLI npm install @nestjs/cli -g
  • pnpm (instead of npm) npm install pnpm -g

Installation steps.

  1. Clone Kulu repository
    git clone https://github.com/timkatee/kulu.git
  2. Install dependencies
    pnpm install
  3. Create .env file in the admin dir and add prisma database config with specified path to the schema.prisma fileand Database URL, if mysql
    DATABASE_URL='mysql://username:password@localhost:3306/database' PRISMA_DATA_MODEL_PATH='./apps/admin/src/infrastructure/database/prisma/schema.prisma'
  4. Update prisma shcema in package.json under admin dir to use ./apps/admin/src/infrastructure/database/prisma/schema.prisma
  5. If you don't want to stress with updating package.json, you can run migrations explicity with command and path: npx prisma migrate dev --schema=./apps/admin/src/infrastructure/database/prisma/schema.prisma otherwise, go to number 6 below
  6. Run migrations for database table creation, for an existing database with tables refer to Prisma Documentation
    npx prisma migrate dev
  7. Install turbo globally using npm install turbo -g
  8. Run turbo prisma:generate
  9. Start the admin service
    turbo run start:dev --filter=@kulu/admin (you can use pnpm as well, using turbo just for the sake of it...)
  10. Start the gateway service
    turbo run start:dev --filter=@kulu/gateway(you can use pnpm as well, using turbo just for the sake of it...)
  11. Access the project on http://localhost:4000/graphql . Port might be different based on your .env PORT value. x. Have fun

About

A GraphQL implementation of a NodeJS API Service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •