2.79.2 • Published 2 years ago
my-nutri v2.79.2
MyNutri
Nutrição nunca foi tão fácil
Getting Started
Setup
M1 machines
- Install docker for mac
- Install Hasura CLI node version
- Increase the docker memory to 6GB
Hasura Configure
- If needs to change default configuration for Hasura (ports, admin secret, etc..), duplicate
.env.example
file and rename it for.env
. - Done, just change the configurations.
Run
yarn start
: Start Hasura and serverless.yarn hasura:up
: Start Hasura Docker container.yarn hasura:start
: Start Hasura and apply metadata and migrations.yarn hasura:stop
: Stop Hasura.yarn hasura:console
: Open Hasura Console.yarn backend:start
: Start serverless functions.yarn backend:deploy
: Deploy serverless functions.
Cli
The commands will available only on serverless/users
folder.
[ENV=stag] yarn console [command] [args]
. Ex.:yarn console patients updateExtraData '2022-05-01' '2022-06-01'
Hasura
All config files, metadata and migrations created are in ./hasura
folder. Current version is:
v2.2.0
Serverless
The serverless functions are in ./serverless
folder separated by microservice:
users
: for now, there are only microservice with all project functions.
Libs Folder
When has a big size 3-party library its added in ./libs
folder with package.json configured for to be possible shared with serverless functions and also created a specific serverless layers for it.
Heroku
Manual Deploy
Uses when has a new Hasura version:
git push heroku master
Commit Messages
Git Commit Guidelines
- Follow the Conventional Commits
Follow the Angular Commit Message Guidelines
Follow the How to Write a Git Commit Message tips
- Follow the 5 Useful Tips For A Better Commit Message tips
- Consider using Commitizen cli
Follow The seven rules of a great Git commit message (TL;DR)
- Separate subject from body with a blank line
- Limit the subject line to 50 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
Commit Types
As configured on .commitlintrc.yml
, it must be one of the following:
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- ref: A code change that neither fixes a bug nor adds a feature
- test: Adding missing tests or correcting existing tests
- revert: A commit that reverts a previous commit
- chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
- ci: Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs)
- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
- perf: A code change that improves performance
- git: Changes on git files, such as
.gitignore
Commit Best Practices
- Commit often
- Keep commits small and atomic
- Write S.O.L.I.D. commits
- Write meaningful titles targeting for non-technical readers
- Write commits that would help the Code Review
- Add any extra information that would help the Code Review
- Reference the issue that originated the commit
References
- Hasura - Get realtime GraphQL APIs instantly
- Migrations - Migrations for a new database and Hasura instance
- PostgreSQL - The World's Most Advanced Open Source Relational Database
- NestJs - A progressive Node.js framework for building efficient, reliable and scalable server-side applications.
- NestJs-Console - A ready to use service class for your modules that exposes methods to register commands and sub commands using commander
- Serverless - Provide full serverless application lifecycle management.
- Rollbar - Rollbar provides real-time exception reporting and continuous deployment monitoring for developers
- Jest - Javascript Testing Framework with a focus on simplicity
- Faker - Generate massive amounts of fake (but realistic) data for testing and development.
- FactoryBot - A factory library for Node.js