GithubHelp home page GithubHelp logo

agent-match's Introduction

Welcome to Agent Match

Project made in MongoDb, Express, React and Node, Redux, MaterialUI, Mapbox.

This application consists of connecting agents with possible contacts based on their geolocation.

Launch locally

Frontend

$ git clone https://github.com/jpalacio0612/agent-match.git

$ cd agent-match

$ npm install

$ npm run start

The frontend is based on React by default it runs at http://localhost:3000/

Backend

$ git clone https://github.com/jpalacio0612/agent-match-backend.git

$ cd agent-match-backend

$ npm install

$ npm run start

The backend is made in node, express and mongoose by default it runs inhttp://localhost:8000/

Database

The database is stored in mongoatlasDB so no additional configuration is required.

Operation of the application

  1. Registry.

The user can be registered both as an agent or as a contact, the form is based on react-hook-form and has validations such as required fields, patterns, minimum of letters in the password. Once the user registers, his information is stored in the backend, his password is encrypted thanks to bcrypt and he is assigned a token with JWT.

  1. Login

The user logs in with his email and password. the backend returns a token and additional information that is stored in redux, redux also synchronizes with the local storage so that the session persists even after reloading the page. Once this is done, you will be redirected to the Match page.

  1. Match

The user can choose two modes:

  • no DevMode: In this mode the user can only choose the range in meters around where he will search for possible contacts. When the user presses get match, he must grant permission to the browser to obtain his geoposition and based on this position the backend will return the contacts found in that range.

  • DevMode: In this mode the user, in addition to choosing the range in meters around, can choose the coordinates (latitude, longitude) of his position, pretending to be in another place. I recommend using the following SAN FRANCISCO coordinates: latitude: 37.762649 longitude: -122.457759 because most contacts are registered close to these coordinates.

  1. Match algorithm

The algorithm is based on using the MapBox library to obtain the distance between the user's position and the positions of the different contacts registered in the application. A cycle is performed to iterate over the arrangement of the contact positions and return the indices of those that meet the condition of being in the range of meters around, to then filter the original arrangement with these indices and return the result to the frontend to be rendered on the map.

agent-match's People

Contributors

jpalacio0612 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.