An app that queries a weather API to provide a better weather forecast for surfing on your favorite beaches.
This is a project made with Node.js, Typescript, Mongodb and React.js, witch the users register and can record your favorite beaches, and get a forecast for each beach in certain times, containing wind speed, wind direction, wave speed, wave duration, wave height, swell direction, swell height... In addition, based in the forecasts, will be calculated a rating, to choose the best beach to surf.
- .github β― github workflows setup files
- src β― main application code (layers)
- config β― specifics configuration files
- @types β― custom types definition files
- domain β― application models and usecases
- implementation β― application internal usecases implementations
- infra β― external libs implementations
- presentation β― layer witch communicates the application with external environment
- main β― components composition layer
- tests β― functional tests code
- . β― general configuration files
This app is made with Node.js and Mongodb, so you need to have this technologies installed, or you can run the app using Docker. And i recommend that you have installed the Yarn to run the app scripts.
git clone https://github.com/gabriellopes00/surfforecast.git
cd surfforecast
yarn install --frozen-lockfile || npm install
To run this project, you need to have a stormglass private key, to get the forecasts requests. Go to stormglass website and register yourself to get your private key.
After run the project, go to created directory /surfforecast/src/.env.example
, update the file data, with you own information (api_port, stormglass_token, jwt_secret...) , and finally change the env file to .env
.
If you don't have Mongodb installed locally, you can run the only database with Docker. With the command below, a mongo image will be pulled, and mongodb will be started at port 27017 into your localhost, in a container called surfforecast-mongo.
docker run -d -p 27017:27017 --rm --name surfforecast-mongo mongo
And you can run the app completely using docker-compose. Will be created 2 services. The first is called api, and in this will be started Nodejs and all the app code will run in this service. The other will create a mongodb server, with will start mongo db at localhost:27017. To connect this services, will be created a network called surfforecast. You just need to use docker-compose to up the app:
docker-compose up -d
After you can stop the service with:
docker-compose down
yarn dev || npm run dev
yarn build && yarn start || npm run build && npm run start
- Coverage β―
yarn test:ci
- Watch β―
yarn test:watch
- Unit(.spec) β―
yarn test:unit
- Clear Cache β―
yarn test:cache
- Lint(fix) β―
yarn lint:fix
- Style(fix) β―
yarn style:fix
Following the standard of the Conventional Commits.
- feature commits(amount) β―
git shortlog -s --grep feat
- test commits(amount) β―
git shortlog -s --grep test
- refactor commits(amount) β―
git shortlog -s --grep refactor
- chore commits(amount) β―
git shortlog -s --grep chore
- docs commits(amount) β―
git shortlog -s --grep docs
- build commits(amount) β―
git shortlog -s --grep build
- fix commits(amount) β―
git shortlog -s --grep fix