Git Product home page Git Product logo

real-estate-api's Introduction

Project Setup Instructions

Follow these steps to get the project up and running on your local development environment.

Step 1: Clone the Repository

First, clone the project repository to your local machine:

git clone https://github.com/iagonvs/real-estate-api.git
cd real-estate-api

Step 2: Set Up Environment Variables

Copy the .env.example file to create a .env file with your environment variables:

cp .env.example .env

Step 3: Build and Run with Docker

Use Docker Compose to build and start the project containers:

docker-compose up -d --build

Step 4: Install Dependencies

Install the project's PHP dependencies with Composer:

docker-compose exec app composer install

Step 5: Database Migrations and Seeders

After the containers are up, run the database migrations and seeders to set up the database schema and populate it with initial data:

docker-compose exec app php artisan migrate --seed

Step 6: Run automated tests

docker-compose exec app php artisan test

Step 7: Import insomnia file

Inside project there is a Insomnia file with all endpoints. You can import in your local workspace.

Insomnia_2024-03-23.json

Step 8: Documentation of routes

img.png

In the project there is a Laravel Scramble package to show all routes and with all details, like payload examples etc.

To access doc just put follow route:

http://127.0.0.1:8000/docs/api

Step 9: Using API

Seeds

There are two seeders to create content to Buildings and Statuses table. (Is in STEP 5);

Authentication

The routes to create and get a task, and create a comment needs to have a bearer token.

To generate just need use the registration route (api/register) and to make a login route(api/login)

POST:
Registration payload:

{
  "name": "real estate api",
  "email": "[email protected]",
  "password": "realestateapi",
}

POST:
Login payload:

{
  "email": "[email protected]",
  "password": "realestateapi",
}

To create a Task you can use this route: api/tasks

POST:
{
  "title": "string",
  "address": "string",
  "description": "string",
  "status_id": "1" // 1 (OPEN), 2 (IN_PROGRESS), 3 (COMPLETED), 4 (REFUSED),
  "user_id": 0,
  "building_id": 0
}

To get a task with filters. All attributes are optionals: api /tasks

GET:
{
  "date_from": "string",
  "date_to": "string",
  "status_id": "1" // 1 (OPEN), 2 (IN_PROGRESS), 3 (COMPLETED), 4 (REFUSED),
  "building_id": 0
}

OR to get all
GET:
{
}

To make a comment to specific task: api/comments/{task}

POST:
{
  "content": "string"
}

You should now have the project running on your local development environment. For more detailed instructions or troubleshooting, refer to the project's documentation or contact with me.

real-estate-api's People

Contributors

iagonvs avatar iagonevs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.