SWE574-Fall2023-Group1 / SWE574-Fall2023-G1-mobile

Mobile code repository for SWE574 Fall2023 Group1
MIT License
6 stars 1 forks source link

Implement story search #95

Closed ayhncvdr2 closed 10 months ago

ayhncvdr2 commented 11 months ago

We are planning to introduce a comprehensive search functionality within our mobile app to empower users with a more refined and efficient browsing experience. Users should be able to search for stories using various parameters, including title, tag, time, author, location, and semantic tag. Below are the key components and features that will be integrated:

  1. Location Search: Users can select a location by placing a circle marker on a map. A radius slider and a radius input field will be available, allowing users to customize the search area. Additionally, users can input a location using a text field with Google API integration for efficient geolocation.

  2. Search Results Page: The search results will be displayed in a dedicated page called "Search Results." Results can be viewed as either a timeline or a default list in card view.

  3. Timeline View: In the timeline tab, each result will be presented in a card format. Card details will include title, author, memory time, and an image if available.

  4. List View: The default list view will present search results in a card format for easy browsing.

User Interaction: Users can seamlessly switch between timeline and list views based on their preference. Location selection and radius adjustments will be intuitive through map interaction and input fields.

Implementation Details: Utilize Google API for efficient location input. Ensure responsive design for both timeline and list views on various mobile devices.

aykutkantas commented 11 months ago

Search page mockup has been created. Here's sigma link: https://www.figma.com/file/uYsmFIA0eHKg63wWICI326/574-UI-KIT?type=design&node-id=2124-9969&mode=design&t=q7Tm25Rr4BZewMD4-0

Screenshot 2023-12-15 at 22 28 23
ckertam commented 11 months ago

You can send an POST API Request to below endpoint

/user/storySearch with below raw json data. Here tag comes from wikidata's tag Q code. { "title": "TitleTest", "author": "AuthorTest", "tag": "Q97760208", "tag_label": "TestLabel", "time_type": "year", "time_value": { "year": "1999", "seasonName": "Fall" }, "location": {"type":"Point","coordinates":[14.9561498,50.9072496]}, "radius_diff": 25, "date_diff": 2, "sort_field": "extract_timestamp" }

The response of this as below

[ { "id": 65, "author": 1, "author_username": "cano14", "title": "asfad", "content": "

asdad

", "story_tags": [ { "id": 103, "name": "Anan", "label": "anan", "wikidata_id": "Q485583", "description": "city in Tokushima Prefecture, Japan" } ], "location_ids": [ { "id": 73, "name": "26CG+6J Khumtop, Republic of Dagestan, Rusya", "point": null, "line": null, "polygon": "SRID=4326;POLYGON ((28.59374955296516 38.66265964177893, 65.85937455296516 38.66265964177893, 65.85937455296516 47.37853386979813, 28.59374955296516 47.37853386979813, 28.59374955296516 38.66265964177893))", "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-10T00:00:00Z", "creation_date": "2023-12-10T14:42:16.531917Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 66, "author": 1, "author_username": "cano14", "title": "TestCircle", "content": "

TestCircle

", "story_tags": [ { "id": 104, "name": "Cricler", "label": "TTTT", "wikidata_id": "Q107205373", "description": "family name" } ], "location_ids": [ { "id": 74, "name": "C3QV+RF Dolaț, Romanya", "point": null, "line": null, "polygon": null, "circle": "SRID=4326;POINT (21.09375 45.43959798134731)", "radius": "1869021.8267532410", "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-10T00:00:00Z", "creation_date": "2023-12-10T15:30:30.272442Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 63, "author": 2, "author_username": "cano19", "title": "Ethem efendi", "content": "

Sometimes I wonder how many centuries I must have been living. When I look at all the changes of life and places it seems it should be a few hundred years. Alas, nope... My thoughts go to the late 1960s and 1970s. In those days, the road that is now called Minibus Caddesi, Erenkoy. While currently this street is as busy as can be, in those days hardly a car would pass by. There were houses with gardens. With very nice gardens full of flowers, and trees. I specially loved the fruit trees. Mulberries (white and read), apples, pomegranates, quinces, pears, cherries, and more. Also, huge trees that sheltered us from the sun and rain. I used to play with the pine cones and chestnuts. For a child the possibilities are infinite. Oh, and can't forget the hammocks stretched across the giant pine trees. Well, they were giants to me. There were even palm trees. I always wondered about them. They don't really belong so much in Istanbul. Anyway, I would love to climb the trees and spend my days on top of the trees. Now, one can barely find any solace in nature. The city is so huge. To fetch good for the house, the regular destination was the bazaar (Pazar). Would return with goods to feed extended families with buffer for unexpected guest (hint, there were always expected unexpected guests). Sometimes people would hire people who would carry groceries in large baskets strapped to their backs (kufeci). Something like:\


<img src=\"http://34.66.132.236:8000/story_images/story_image_1.jpeg\">


And below is the lovely train station we used to reach elsewhere.


<img src=\"http://34.66.132.236:8000/story_images/story_image_2.jpeg\">


I can still feel the texture of the train tickets on my finger tips.


<img src=\"http://34.66.132.236:8000/story_images/story_image_3.jpeg\">


One could go to Sureyya plaji from there to swim in the Summers. Once my right shoe fell on the train tracks as I was stepping in the train. That was the end of that shoe. Moreover, I had to spend the entire day with one shoe. I really got mad at my mother that day for not rescuing my shoe and making me go around with one shoe. Then again, it was not retrievable. I am sure I was fine once i got to play with the sand.



<img src=\"http://34.66.132.236:8000/story_images/story_image_4.jpeg\">


", "story_tags": [ { "id": 101, "name": "Ethem", "label": "Etho", "wikidata_id": "Q1371172", "description": "male given name" } ], "location_ids": [ { "id": 71, "name": "Ethem Efendi Caddesi", "point": "SRID=4326;POINT (29.072776 40.970524)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-09T00:00:00Z", "creation_date": "2023-12-09T18:07:13.710979Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 54, "author": 1, "author_username": "cano14", "title": "tt11", "content": "

11tt

", "story_tags": [], "location_ids": [ { "id": 62, "name": "853H+9V Osmangazi/Bursa, Türkiye", "point": null, "line": null, "polygon": "SRID=4326;POLYGON ((24.609375 37.09023980307208, 33.75 37.09023980307208, 33.75 43.51668853502907, 24.609375 43.51668853502907, 24.609375 37.09023980307208))", "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-04T00:00:00Z", "creation_date": "2023-12-04T16:04:24.467132Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 55, "author": 1, "author_username": "cano14", "title": "2222", "content": "

11111

", "story_tags": [ { "id": 90, "name": "Caner", "label": "Caner", "wikidata_id": "Q122786680", "description": "ship built in 1979" } ], "location_ids": [ { "id": 20, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-04T00:00:00Z", "creation_date": "2023-12-04T16:58:13.719819Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 12, "author": 2, "author_username": "cano19", "title": "Test", "content": "

Test

", "story_tags": [ { "id": 56, "name": "Caner Erkin", "label": "Erkin", "wikidata_id": "Q946447", "description": "Turkish footballer" } ], "location_ids": [ { "id": 20, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-03T00:00:00Z", "creation_date": "2023-12-03T18:48:23.457557Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 13, "author": 2, "author_username": "cano19", "title": "TestFoto", "content": "

TestFoto<img src=\"http://localhost:8000/story_images/story_image_1.jpeg\">

", "story_tags": [ { "id": 57, "name": "Caner Erkin", "label": "ERko", "wikidata_id": "Q946447", "description": "Turkish footballer" } ], "location_ids": [ { "id": 21, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-03T00:00:00Z", "creation_date": "2023-12-03T18:50:06.004850Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 45, "author": 1, "author_username": "cano14", "title": "Boun1", "content": "

Boun1

", "story_tags": [], "location_ids": [ { "id": 53, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-03T00:00:00Z", "creation_date": "2023-12-03T19:18:22.951137Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 46, "author": 1, "author_username": "cano14", "title": "Boun2", "content": "

Boun2

", "story_tags": [], "location_ids": [ { "id": 54, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-03T00:00:00Z", "creation_date": "2023-12-03T19:19:02.505835Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 47, "author": 2, "author_username": "cano19", "title": "Boun3", "content": "

Boun3

", "story_tags": [], "location_ids": [ { "id": 55, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-03T00:00:00Z", "creation_date": "2023-12-03T19:19:44.021675Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 48, "author": 2, "author_username": "cano19", "title": "Boun4", "content": "

Boun4

", "story_tags": [], "location_ids": [ { "id": 56, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-03T00:00:00Z", "creation_date": "2023-12-03T19:19:48.700140Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 49, "author": 2, "author_username": "cano19", "title": "Boun5", "content": "

Boun5

", "story_tags": [], "location_ids": [ { "id": 57, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-03T00:00:00Z", "creation_date": "2023-12-03T19:19:53.083381Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 50, "author": 2, "author_username": "cano19", "title": "Boun6", "content": "

Boun6

", "story_tags": [], "location_ids": [ { "id": 58, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-03T00:00:00Z", "creation_date": "2023-12-03T19:19:57.342233Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 51, "author": 2, "author_username": "cano19", "title": "Boun7", "content": "

Boun7

", "story_tags": [], "location_ids": [ { "id": 59, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-03T00:00:00Z", "creation_date": "2023-12-03T19:20:13.557655Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 52, "author": 2, "author_username": "cano19", "title": "Boun8", "content": "

Boun8

", "story_tags": [], "location_ids": [ { "id": 60, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-03T00:00:00Z", "creation_date": "2023-12-03T19:20:19.854556Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [ 1 ], "success": true, "msg": "Story ok." }, { "id": 53, "author": 1, "author_username": "cano14", "title": "Boun9", "content": "

Boun9

", "story_tags": [], "location_ids": [ { "id": 61, "name": "255H+3V Osmangazi/Bursa, Türkiye", "point": null, "line": null, "polygon": "SRID=4326;POLYGON ((24.609375 36.24427318493909, 33.75 36.24427318493909, 33.75 43.77109381775651, 24.609375 43.77109381775651, 24.609375 36.24427318493909))", "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-03T00:00:00Z", "creation_date": "2023-12-03T19:57:31.317275Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 62, "author": 2, "author_username": "cano19", "title": "Test12131123", "content": "

Test

", "story_tags": [ { "id": 100, "name": "Caner Erkin", "label": "Futbol", "wikidata_id": "Q946447", "description": "Turkish footballer" } ], "location_ids": [ { "id": 70, "name": "Ceglédbercel, Cserői út 85, 2737 Macaristan", "point": null, "line": null, "polygon": null, "circle": "SRID=4326;POINT (19.6875 47.21956811231547)", "radius": "2122915.6373559370", "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-03T00:00:00Z", "creation_date": "2023-12-09T18:01:42.487087Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 9, "author": 2, "author_username": "cano19", "title": "Test", "content": "

Test

", "story_tags": [ { "id": 10, "name": "test case", "label": "Test", "wikidata_id": "Q1568346", "description": "specification of the inputs, execution conditions, testing procedure, and expected results that define a single test to be executed to achieve a particular testing objective" } ], "location_ids": [ { "id": 9, "name": "4PJ9+8F Alekvere, Lääne-Viru County, Estonya", "point": null, "line": null, "polygon": "SRID=4326;POLYGON ((26.71875 59.13086309725591, 92.8125 33.06392419812065, 18.984375 23.80544961231463, 26.71875 59.13086309725591))", "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2023-12-01T00:00:00Z", "creation_date": "2023-12-01T18:57:25.263066Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 60, "author": 1, "author_username": "cano14", "title": "TESTTıme", "content": "

TEST

", "story_tags": [ { "id": 98, "name": "Ekmek kadayıfı", "label": "CanerLbl", "wikidata_id": "Q4811799", "description": "Turkish dessert" } ], "location_ids": [ { "id": 68, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "normal_date", "season_name": null, "year": null, "start_year": null, "end_year": null, "date": "2022-12-09T00:00:00Z", "creation_date": "2023-12-09T15:23:56.062593Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." }, { "id": 61, "author": 1, "author_username": "cano14", "title": "Testtıme2", "content": "

Testtıme2

", "story_tags": [ { "id": 99, "name": "Ekmekçiler", "label": "Ekmek", "wikidata_id": "Q20605158", "description": "village in Siirt, Turkey" } ], "location_ids": [ { "id": 69, "name": "Boğaziçi Üniversitesi Kuzey Kampüsü", "point": "SRID=4326;POINT (29.045074 41.08564)", "line": null, "polygon": null, "circle": null, "radius": null, "success": true, "msg": "Location ok." } ], "date_type": "year", "season_name": "Summer", "year": 2022, "start_year": null, "end_year": null, "date": null, "creation_date": "2023-12-09T15:24:19.692681Z", "start_date": null, "end_date": null, "decade": null, "include_time": false, "likes": [], "success": true, "msg": "Story ok." } ]