Giter Club home page Giter Club logo

pet-my-dog's Introduction

PetMyDog

Final Release Youtube Video: https://youtu.be/XxjCbclx_OQ

Developer Guide: https://github.com/evaliu2002/PetMyDog/blob/docs/docs/dev_guide.md

User Manual: https://github.com/evaliu2002/PetMyDog/blob/docs/docs/user_guide.md

MIT License

User Document

image

image

image

image

image

image

image

image

image

image

image

image

image

Project Idea/Goal

Pet My Dog will be a web app that allows dog owners to broadcast their location while walking their dogs, during which other nearby users of the app can locate owners in real time and follow them to pet their dogs. In addition to broadcasting their location, owners can also share small amounts of information about themselves and their dogs to nearby users.

Some main features we will implement include user registration, dog profiles, retrieving nearby pets in map and list view, requesting and accepting meetups with nearby dogs, and searching for pets by name. Some stretch goals we could implement include calling and messaging between users, invitation system for meetups, a like system for owners and petters for safety precautions, filtering system, and redirection to other social media platforms (e.g., instagram, facebook).

Operational Use Case(s)

The user can now login/sign up using Google Login. Once the user logs in/signs up, the user is redirected back to the login/sign up page where they can press the button to redirect their page to the find dogs page. The find dogs page displays a map with a marker of the user's current location, a 500 meter circle around the user's marker, and lists all the nearby dogs within 500 meters of the user's location. The user can press the dog and is redirected to the selected dog page where information about the dog is displayed.

Layout of the repository

All the code will be contained in the main directory. The main directory is divided into front and back end code, each in a sub directory. We will have our weekly reports in the Weekly Reports directory, which we will update every week to report our progress and action items. Our tests are contained within the front and back end sub directories, within the src sub directory (and the tests are in the test sub directory).

Building a release of the software

Pushing to the main branch will automatically build the software, so there is no manual intervention needed.

Back-end:

Setup Instructions (for use in IntelliJ with Maven):

Building and Running the project

  1. Build the project in IntelliJ by navigating to the Maven tab in IntelliJ, opening Lifecycle in the back-end tab, and clicking the Compile button.
  2. Run Elasticsearch locally. Follow the instructions provided here: https://www.elastic.co/downloads/elasticsearch
  3. Run Main.java to launch the Spark server on localhost port 4567.

Testing the project

  1. Run Elasticsearch locally before testing by following the instructions provided here: https://www.elastic.co/downloads/elasticsearch
  2. Navigate to the Maven tab in IntelliJ, open Lifecycle in the back-end tab, and click the Test button to run the provided tests.
  3. JUnit tests are located and can be added in main/back-end/src/test/java.
  4. Before running JUnit tests, make sure that Main.java is not running already. Otherwise, stop Main.java.

Adding new tests

To add a new test, navigate to main/back-end/src/test, and add the test to the appropriate test file.

For naming conventions, we name the test based on the use case it will be testing. Each test should go into the corresponding Java test file for the method it is testing (ex: for testing getUserProfile in Main.java, we add our test to GetUserProfileTest.java).

Front-end:

Setup Instructions

  1. Obtain source code by cloning this repo.

  2. Navigate to main/front-end.

  3. Run npm install.

  4. Users will also be prompted by IntelliJ or npm to install all the imported packages used for the project. Users may proceed to install the imported packages.

  5. To run PetMyDog on localhost, run npm start.

How to run tests

  1. Navigate to main/front-end.
  2. Run npm test.

Adding new tests

To add a new test, navigate to main/front-end/src/test, and add the test to the appropriate test file.

How to build a release of the software

  1. Navigate to main/front-end.
  2. Run npm build.

How to file a Bug Report:

To report a bug, navigate to our Issue page nad choose the Bug Report template and fill in the information below:

  • Describe the bug: A clear and concise description of what the bug is.
  • To Reproduce: Steps to reproduce the behavior.
  • Expected behavior: A clear and concise description of what you expected to happen.
  • Screenshots: If applicable, add screenshots to help explain your problem.
  • Desktop: Information regarding your PC, if applicable.
  • Smartphone: Information regarding your phone, if applicable.
  • Additional context: Add any other context about the problem here.

pet-my-dog's People

Contributors

anetwcs avatar evaxliu avatar konankisa avatar mastevb avatar northatlantickk avatar protonlwx avatar

Watchers

 avatar

pet-my-dog's Issues

Testing Fetch Meetup and POST Accept Request Bugs

Describe the bug
image
It looks like it knows where the methods are from
But it says they're not a function…

To Reproduce
Steps to reproduce the behavior:

  1. Run npm test

Expected behavior
I expect the test to be working.

Screenshots
image

Desktop (please complete the following information):
OS: Macbook Monterey 12.3.1 (21E258)

Additional context
I followed the instructions in this link. https://hackernoon.com/a-beginners-guide-to-learn-mock-fetching-in-jest-3u3634d5

import React from 'react';
import '@testing-library/jest-dom'

const meetupReqs = [{mid:"5f1587e7-4eb2-42d3-bf46-df9d0308bcd0",sender:"114777625620322820902",receiver:"104891333151558538036",status:"Pending",senderProfile:{uid:"114777625620322820902",username:"Eva",email:"[email protected]",pic_link:"https://lh3.googleusercontent.com/a/AATXAJy3Od8WvYTytjjsyB_KW-zBpLnGCMWyaXONttAK\u003ds96-c",last_ping:"1000-01-01T00:00"},receiverProfile:{uid:"104891333151558538036",username:"Wenxuan",email:"[email protected]",pic_link:"https://lh3.googleusercontent.com/a/AATXAJxGbGsZ7efsc7Q8Li62gFQEADQK4EYHGV9GnN6D\u003ds96-c",last_ping:"1000-01-01T00:00"}}];
const midMeet = meetupReqs[0].mid;

// global.fetch = jest.fn(() =>
//     Promise.resolve({
//         json: () => Promise.resolve(JSON.stringify(mid)),
//     })
// );

beforeEach(() => {
    fetch.resetMocks();
});

require('jest-fetch-mock').enableMocks()

it("Return requests", async () => {
    fetch.mockResponseOnce(JSON.stringify({
        result: meetupReqs,
    }));
    const status = await DogRequests.requestMeetup();
    expect(status).toEqual(meetupReqs);
    expect(fetch).toHaveBeenCalledTimes(1);
});

test('Changes meetup request status', () => {
    fetch.mockResponseOnce(JSON.stringify(meetupReqs));
    const onResponse = jest.fn();
    const onError = jest.fn();

    return DogRequests.acceptRequest(midMeet)
        .then(onResponse)
        .catch(onError)
        .finally(() => {
            expect(onResponse).toHaveBeenCalled();
            expect(onError).not.toHaveBeenCalled();

            expect(onResponse.mock.calls[0][0][0]).toEqual({mid:"5f1587e7-4eb2-42d3-bf46-df9d0308bcd0",sender:"114777625620322820902",receiver:"104891333151558538036",status:"Pending",senderProfile:{uid:"114777625620322820902",username:"Eva",email:"[email protected]",pic_link:"https://lh3.googleusercontent.com/a/AATXAJy3Od8WvYTytjjsyB_KW-zBpLnGCMWyaXONttAK\u003ds96-c",last_ping:"1000-01-01T00:00"},receiverProfile:{uid:"104891333151558538036",username:"Wenxuan",email:"[email protected]",pic_link:"https://lh3.googleusercontent.com/a/AATXAJxGbGsZ7efsc7Q8Li62gFQEADQK4EYHGV9GnN6D\u003ds96-c",last_ping:"1000-01-01T00:00"}});
        });
});```

Cannot launch the Spark server on localhost port 4567

Describe the bug
Followed the back-end setup instructions for building and running the project, but could not launch the Spark server on localhost port 4567.

To Reproduce
Steps to reproduce the behavior:

  1. Clicked compile under Lifecycle in the back-end tab after selecting Project SDK. Read additional context for more info.
  2. Downloaded Elasticsearch and ran it.
  3. Ran Main.java
  4. See error

Expected behavior
After running Main.java, expected the Spark server on localhost port 4567 to work.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 10

Additional context
For step 1 of Building and Running the project, I get the following error message when I click compile:
Error running 'back-end [compile]': Project JDK is not specified. Configure

So I clicked Configure and selected 11 for Project SDK. Then it finally compiled.

Bug Report Example

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

The Dogs Nearby Appears Twice

Describe the bug
When a user is on the find-dogs page of PMD, the user sees duplicate dogs displaying.

To Reproduce
Steps to reproduce the behavior:

  1. Go to find dogs page.

Expected behavior
We expect the dogs to be displayed only once.

Screenshots
image

Desktop (please complete the following information):

  • OS: Macbook Monterey 12.3.1 (21E258)
  • Browser: Chrome Version Version 101.0.4951.64 (Official Build) (x86_64)

The Accept and Decline Buttons for the Meeting Do Not Work

Describe the bug
When the yes or no buttons to accept or decline a meeting are pressed, users are brought to a page that doesn't accurately show the navigation. This is because the buttons are not implemented properly.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the find dogs page.
  2. Select a dog.
  3. Click the "Go to Dog" button.
  4. Then click yes or no for the listed request.

Expected behavior
The expected behavior is that the user is redirected to the nav-user page where the correct navigation is displayed for how the user can get to the dog in the shortest and quickest path.

Desktop (please complete the following information):

  • OS: Macbook
  • Browser: Chrome
  • Version 101.0.4951.64 (Official Build) (x86_64)

Additional context
N/A

No path shown in nav-owner & nav-user

Describe the bug
After the Meetup request is accepted, the user and owner both go to the navigation page, and no suggested path is displayed.

To Reproduce
Steps to reproduce the behavior:

  1. Client 1 follows the user manual to send a meetup request
  2. Client 2 follows the user manual to accept a meetup request
  3. Client 1 go to navigation page.
  4. See no path

Expected behavior
A path connecting petter and owner is shown on the page.

Desktop:

  • OS: OS X 12.4
  • Browser Chrome
  • Version 101.0.4951.64

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.