This app is a test application to betrybe and it's an example of how could be a real professional repository with unit and e2e test, CI, CD, and semantic release.
I try to use some common design patterns to resolve common problems like Chain of responsibility, facade, states, and I try to maintain and apply some SOLID concepts too.
- Typescript
- React
- NextJS
- NodeJS
You can access the app through this link.
cypress
: Cypress file and E2E testssrc
: Source codeapi
: API codebtc
: Bitcoin handlers, services and validatorserrors
: Handler error response classeslogin
: Login handlers, services and validatorsutils
: Some utils code for api
components
: React componentspages
: NextJS pages and APIapi
: All api routes ( I use only to define which api handlers works on each route)
styles
: All CSS codeutils
: Some utils code to all app
All API functions are been testing using Jest.
All React Components are been testing using Cypress with cypress-react-unit-test
. I choose that library because renders the components in a real browser, so is more reliable.
All pages and the final app is been testing using Cypress.
On every push the application is tested by Cypress, Jest and update the coverage to Codecov service.
On every PR the application is tested by ESLint.
On every push to main
branch GitHub action build and deploy the docs to GitHub pages of this repository. After that it uses semantic release to check all commits and create tag, releases and comments on GitHub .
I choose Heroku to deploy this application. I tried with Vercel and Netlify but the API didn't update the currency.json
file because it was published to the AWS servers.
On the other side, Heroku maintains the file on the server, and then the API may update the file with success.
Heroku is configured to deploy automatically on every PR and on every push to main branch.
All documentation is available through this link. Uses Typedoc to generate a page with all API based on Typescript /src
folder.
This repo is using VSCode dev container + Docker to create an dev environment, so its really easy to start developing.
- Clone this repo
- Open this repo as container on VScode.
Just run yarn dev
and open localhost:8008
on the browser to start using
To test locally you need to be running a dev on localhost using yarn dev
. After that you can use yarn test
or yarn test:api
/ yarn test:e2e
Use yarn lint
Use yarn docs
Use yarn docs