NB : Project is in active development phase and should be used as a demonstration of the described concepts.
GraphQL API implementation inspired by Domain Driven Design & Clean Architecture. It demonstrates Inversion Of Control through Dependency Injection a NodeJS
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.
- 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
- 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
- Clone Kulu repository
git clone https://github.com/timkatee/kulu.git
- Install dependencies
pnpm install
- 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'
- Update prisma shcema in package.json under admin dir to use
./apps/admin/src/infrastructure/database/prisma/schema.prisma
- 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 - Run migrations for database table creation, for an existing database with tables refer to Prisma Documentation
npx prisma migrate dev
- Install turbo globally using
npm install turbo -g
- Run
turbo prisma:generate
- 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...) - 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...) - Access the project on http://localhost:4000/graphql . Port might be different based on your .env PORT value. x. Have fun