Skip to content

toshko07/outdoorsy-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

outdoorsy-challenge

Table of Contents

About

This is a solution for the outdoorsy interview challenge. The application is a REST API that provides endpoints for searching and retrieving rentals.

Requirements

  • Go 1.21.6
  • Docker version 24.0.5
  • Docker Compose version v2.17.2
  • Make 4.3

General Structure

The application is structured as follows:

.
├── api # swagger api definition and generated models
├── cmd # main entrypoint for the applications
├── internal # private packages
│   ├── configs
│   ├── controllers # http handlers
│   ├── db # database setup
│   ├── models # business models
│   ├── repositories # data access layer
|   ├── component_test
│   └── services  # business logic
├── Makefile # makefile for running make commands related to the application

Configuration

The application is configured using environment variables. Copy .env.example to .env and edit the values if needed. Database configuration is set in the docker-compose.yml file.

Running

To run the application, execute the following commands:

make run-db
make run-app

Testing

The altomated tests can be run with the following command:

make run-tests

Test coverage can be generated with the following command:

make run-coverage

Here are also some curl commands to test the application manually:

curl --request GET \
  --url http://localhost:8181/v1/rentals/1
curl --request GET \
  --url http://localhost:8181/v1/rentals/404
curl --request GET \
  --url 'http://localhost:8181/v1/rentals?near=33.64%2C-117.93&price_min=9000&price_max=75000&limit=3&offset=3&sort=price'
curl --request GET \
  --url 'http://localhost:8181/v1/rentals

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published