Rest API that provides weather forecast on beaches for surfing.
View Demo ยป Explore the docs ยป Contribute
Developed based on the From Zero to Production course.
This project was created with the objective of developing something using modern concepts and techniques in software development, such as containerization, use of workflows for process automation, documentation using OpenAPI specification, and much more.
For more information, visit the API documentation.
Example
POST /beaches
{
"name": "Maresias Beach",
"position": "S",
"lat": -23.791711,
"lng": -45.567022
}
201 Created
{
"name": "Maresias Beach",
"position": "S",
"lat": -23.791711,
"lng": -45.567022,
"user": "61eee0f84a749ca7b4805388",
"id": "61eee0fe4a749ca7b4805389"
}
Example
GET /forecast
200 Ok
[
{
"time": "2022-02-04T00:00:00+00:00",
"forecast": [
{
"lat": -23.791711,
"lng": -45.567022,
"name": "Maresias Beach",
"position": "S",
"rating": 2,
"time": "2022-02-04T00:00:00+00:00",
"swellDirection": 186.06,
"swellHeight": 0.61,
"swellPeriod": 9.05,
"waveDirection": 182.25,
"waveHeight": 1.17,
"windSpeed": 7.12,
"windDirection": 67.68
},
...
]
},
...
]
To develop for this project it is recommended that you have Docker and Docker Compose installed.
- Clone the repository:
$ git clone https://github.com/hugosrc/surf-forecast-api
- Build the base images:
$ docker-compose build surfforecast-api
- Start database
$ make start-db
- Then finally, start the server
$ make surfforecast-api
# Run all tests
$ yarn test
# Run all unit tests
$ yarn test:unit
# Run all functional tests
$ yarn test:functional