Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

questions #15

Closed
andrei9669 opened this issue Apr 14, 2021 · 3 comments
Closed

questions #15

andrei9669 opened this issue Apr 14, 2021 · 3 comments

Comments

@andrei9669
Copy link

andrei9669 commented Apr 14, 2021

hello, I'm in process of exploring this wonderful repo and I really hope that you will continue to work on it until it becomes a real-world example project I could always come back to.

But there are some things a bit confusing for me, mostly the "what should be where". Some stuff I have kind of understood but this is still confusing for me. For example, domain-event-handlers and email are under modules but they don't seem to contain any kind of code that would relate to modules, so why are they there?
Understandably, email looks like a work in progress but the directory is missing the modules part which would help me to tie it together. But the domain-event-handlers seem out of place for me.

Also, is there somewhere a reason why the lint rules are what they are?

I'm also having trouble setting up the dev environment. specifically, when I start the DB docker and then run start:dev, I get an exception that test-db doesn't exist.

now that I'm thinking about it, I can't seem to find any instructions on how to start the dev env. like, step-by-step what should be done and what do I need before I can run it.

PS: it seems that while adding a licence, you forgot to update it in package.json, but I doubt it has any significance since it's not in the npm registry.

@Sairyss
Copy link
Owner

Sairyss commented Apr 14, 2021

  • email represents a module that would contain logic for sending emails, now it contains only a dummy service. I didn't implement that because it is out of scope of this example and would require an email server etc. Implementations doesn't matter in this example, it's there just to show you that event handler will launch and email service to send emails when some event happens.
  • domain-event-handlers, as the name suggests, are handlers for events that may happen in a domain. Where to put them is a matter of preference, i prefer having them as a module, but you may put them wherever you want. Maybe outside of modules would be a better place to avoid confusion. Remember that it is an example and you have to adapt things to your preferences.
  • lint rules - that's what I've been using lately. Some rules for airbnb don't play well with TypeScript, so I had to disable them, some rules are not strict enough, so I changed the default "warn" to an "error", for things like "any" type. Linter rules are a matter of preference.
  • for dev environment - you have to start docker:env (this will download and launch a postgresql), but it has no databases yet, so you should create a database manually at this point (for example by going to pgadmin or by executing a CREATE DATABASE... query), and then start:dev should start working. I'll have to automate database creation step to avoid creating it manually, noted for the future.

@andrei9669
Copy link
Author

thanks for the quick response.
There is a separate Airbnb TS rules conf, might look into it eslint-config-airbnb-typescript

I'm wondering how far will you go with this repo, will it stay as a guideline with basic examples or will it grow into a real-world-app? hoping for the latter :D

@Sairyss
Copy link
Owner

Sairyss commented Apr 14, 2021

I tried to use airbnb-typescript before but I had issues with it so I switched to a regular with some modifications.

I am using this principles in a real world apps in production, this repo probably won't grow to an entire app (maybe a small one), but I will add better examples with a few more modules in the future.

@Sairyss Sairyss closed this as completed Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants