Skip to content

DanielDDHM/hr-microservice

Repository files navigation

🚀🚀 The HR Microservice 🚀🚀

👨🏻‍💻 About this project

🪓 Requirements

  • Docker
  • Docker Compose
  • Node 15

🚀 Technologies

  • Typescript
  • Prisma
  • Express
  • Docker

🐳 Getting Started With Docker (recomended)

  1. Clone the Repo;
  2. Install development dependencies: $ npm install
  3. Run Docker Development mode: $ docker-compose up -d
  4. Enjoy!

💻 Getting Started without Docker (not recomended)

  1. Clone the Repo;
  2. Install development dependencies: $ npm install
  3. Check the env vars (in the envs folder).
  4. Create a .env file in the root of the project.
  5. Execute yarn prisma db push to create the database.
  6. Start development server: $ npm run dev
  7. Enjoy!

⚒️ Included npm scripts

Run this commands from the project folder with npm run "script-name".

  • dev: runs project in development mode
  • build: builds all .ts files from ./src folder to ./build
  • lint: lints source code using eslint
  • update: easily check for updates and update all dependencies
  • test: run tests
  • test:watch: run tests in watch mode
  • test:report: run testsa and adds report file

External typings augmentation

This starter is already configured to allow you to extend typings of external packages. The logic behind it is based on this official template. To augment a module, just create a folder with the same name as the module you are augmenting and add an index.d.ts in it. Here you can find a real world example.

🪰 Debugging

Warning: This starter uses new V8 inspect protocol so you have to use at least Node.js 7.7.4 if you want to use the included debugger settings.

Steps:

  • start dev server with npm run dev
  • now you have two ways:
    • use the provided debug URL in Chrome
    • use VS Code included (inside .vscode folder) attach config (best debugging experience)

Docker Support

This stater uses Node.js best practices and creates dummy user to start node process, instead of using root user.

# Go to the root of your repo created from this starter
# Build your docker image
docker build -t api-hr.

# run your docker container
docker run -p 3000:3000 api-hr

Releases

No releases published

Packages

No packages published

Languages