GithubHelp home page GithubHelp logo

cookie-cutter-generator-with-nestjs's Introduction

Cookie Cutter Generator with NestJS Microservices

This is an example project with NestJS and Kafka

The main idea of the app is that users would upload SVG images that will be converted into 3D cookie-cutters using an OpenSCAD script, that I created to make custom cookie cutters for Christmas.

Before and after

Now, the app is divided into 3 parts:

  • API
    • for CRUD on the database
  • Converter
    • for converting a SVG image into a 3D STL model
  • Notifications
    • that would (someday) contain email and websockets gateways to send notifications

It is very much a work in progress, because I spent an unhealthy amount of time making OpenSCAD run in a container while also having access to the file system (all while working on a Windows machine), so most of the app is not ready at all, but the main flow that currently works is this:

There are no notifications at the moment (apart from the notifications app logging to console when user registers) and very little error handling, also no ConfigService and other fancy stuff, just good old process.env...

Ideally, the notifications app would provide a websocket gateway that the user would connect to and it will push events about the conversion status to update the frontend.

Also... there is no frontend, so you need to use a tool like Postman.

Usage

  1. spin up docker-compose: npm run docker:up

  2. run all apps: npm run start:all

    • or selectively with nx serve <app-name>
  3. Register user

    • POST to /authz/register with { username, password }
  4. Login

    • POST to /authz/login with same { username, password }
  5. Upload SVG

    • POST to /cookie-cutters with { name, svg }
    • no file upload, you'll need to manually copy/paste the SVG string, examples are provided in example-svg
  6. Wait for the result

    • the result will be available as a file with a random name in /tmp
    • this simulates a storage service, which was also originally planned
  7. tear down docker-compose: npm run docker:down

Dependency graph

  • To view live dependency graph, run npm run nx dep-graph

Unit Tests

  • npm run test <app-or-lib-name>
  • npm run test <app-or-lib-name> -- --testFile=<regex-pattern>

E2E Tests

  1. spin up testing containers npm run docker:up:test
  2. Run e2e tests
    • npm run e2e api
    • npm run e2e converter

cookie-cutter-generator-with-nestjs's People

Contributors

papooch avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.