Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
1e8de8e
Contact us static UI page added
Apr 12, 2022
033d014
Updating ReadMe with Documentation
Hardik27 Apr 12, 2022
68da741
Update README.md
Hardik27 Apr 12, 2022
d7a7582
Contact-Us page done
Apr 17, 2022
7ea1b83
Merge pull request #1 from Hardik27/feature/Contact-Us-Page
vsricharan16 Apr 17, 2022
f9412d7
CORS Bug fix
Apr 18, 2022
adf2bc1
Merge pull request #2 from Hardik27/feature/Bug-Fixes
Hardik27 Apr 18, 2022
eb463f9
Adding a Global pom file for importing easily
vsricharan16 Apr 18, 2022
720bb05
Merge pull request #3 from Hardik27/adding-global-pom-file
Hardik27 Apr 18, 2022
53a3c20
Create Event button added and minor bug fix
Apr 19, 2022
6068e8d
Merge pull request #4 from Hardik27/feature/Bug-Fixes
Hardik27 Apr 19, 2022
6b8c365
Create Event Form Added (#6)
Hardik27 Apr 19, 2022
a3dfad4
Adding Event Service for handling events
vsricharan16 Apr 20, 2022
3619328
Merge pull request #7 from Hardik27/adding-event-service-handler
Hardik27 Apr 21, 2022
ea19ace
Minor error in pom.xml and few config files
vsricharan16 Apr 21, 2022
fa69b81
Hosting Event Service on 8091
vsricharan16 Apr 21, 2022
e33511a
Merge pull request #8 from Hardik27/event-service-handler-minor-bug
Hardik27 Apr 21, 2022
ae41c55
Merge pull request #9 from Hardik27/main
Hardik27 Apr 21, 2022
aaeab12
UI Merged with backend
Apr 21, 2022
f1dee85
Location field changed to Address
Apr 21, 2022
c462bb8
Adding tests for Event Service functions (#10)
vsricharan16 Apr 21, 2022
6ecc1ad
UI Integrated with backend (#11)
Hardik27 Apr 21, 2022
4710435
Minor Changes in Contact us page
Apr 21, 2022
5581b70
Merge pull request #12 from Hardik27/feature/Create_Form_UI_Integration
Hardik27 Apr 21, 2022
2c88ede
Merge pull request #13 from Hardik27/main
Hardik27 Apr 23, 2022
532136b
DOB bug fixed
Apr 23, 2022
5bb2004
Registration form bug fixes
Apr 23, 2022
f4511d0
Merge pull request #14 from Hardik27/feature/Bug-Fixes
Axel0944 Apr 25, 2022
ef7dc44
Search bar ui added (#15)
Hardik27 Apr 26, 2022
80aece6
Adding Search API and fixing few test cases
vsricharan16 Apr 26, 2022
6fae19f
Merge pull request #16 from Hardik27/event-service-search-api
Hardik27 Apr 26, 2022
026d861
UI backend integration for search API (#17)
Hardik27 Apr 26, 2022
ffabc4e
Fixed disapperaring details on refresh
Axel0944 Apr 28, 2022
b57f6ce
Adding startDate and endDate for event
vsricharan16 Apr 28, 2022
df535a2
Merge pull request #20 from Hardik27/event-service-minor-changes
Hardik27 Apr 28, 2022
1fad678
Converting user to User
Axel0944 Apr 28, 2022
8f7946d
Merge pull request #19 from Hardik27/refresh_bug
Hardik27 Apr 28, 2022
cf09073
Logout functionality Done
May 2, 2022
1122a82
Minor code cleanup
May 2, 2022
51f7ae7
Merge pull request #23 from Hardik27/Feature/Logout_Function
Axel0944 May 2, 2022
c077bc5
search results display in cards
Axel0944 May 5, 2022
35cb0eb
Adding Elasticsearch Service to improve Search functionality
vsricharan16 May 5, 2022
12c5e8d
Merge pull request #24 from Hardik27/search_card_display
Hardik27 May 5, 2022
c957ca3
Merge pull request #25 from Hardik27/event-service-implementing-elast…
Hardik27 May 5, 2022
d54e916
Clearing Form after creating event
May 10, 2022
2461194
Adding my rewards col and UI changes:
May 12, 2022
c2ef408
Adding the organization id in the user registration part
May 12, 2022
2c75742
Adding my rewards col and UI changes: (#26)
Hardik27 May 12, 2022
a0ccbcd
Bug fix for id not setting for user
May 12, 2022
abea0ba
Events Api refactor for fetchmyevents support
vsricharan16 May 12, 2022
5184a7e
Merge pull request #27 from Hardik27/myevents-api-refactor
Hardik27 May 12, 2022
2b30db3
Merge branch 'main' into Feature/my_rewards_column_db
Hardik27 May 12, 2022
a597be4
Event fetch mechanism
May 12, 2022
814b29a
Feature/my rewards column db (#28)
Hardik27 May 12, 2022
b16f1e8
Fetch Event Changes
May 12, 2022
1552e39
Merge branch 'main' into Feature/my_rewards_column_db
Hardik27 May 12, 2022
67d9ad7
Merge pull request #29 from Hardik27/Feature/my_rewards_column_db
Axel0944 May 12, 2022
3a9ac26
Merge pull request #31 from Hardik27/main
Hardik27 May 12, 2022
7d64618
Open page on clicking on search cards
Axel0944 May 12, 2022
66fc0e3
Merge pull request #32 from Hardik27/click_on_search_card
Hardik27 May 12, 2022
0d90795
Some random bs bug fix
May 12, 2022
636dcea
POC name bug fix
May 13, 2022
71b2a5c
Events Api refactor for removing RegisteredEvents.java
vsricharan16 May 13, 2022
fa30662
Merge pull request #34 from Hardik27/refactoring-fetch-my-events
arkapriyapaul May 13, 2022
2d4788a
Fetch My Events UI display, gitignore added
May 13, 2022
05096ce
Merge pull request #35 from Hardik27/Festure/fetch_events_UI
arkapriyapaul May 13, 2022
027cc2e
Dependency error bug resolution (#36)
vsricharan16 May 18, 2022
0165801
Merge pull request #37 from Hardik27/main
Hardik27 May 18, 2022
3c51ad7
Fetch My Rewards front end and back end changes
May 18, 2022
3fdfb78
Fetch My Rewards front end and back end changes (#38)
Hardik27 May 18, 2022
e499656
Minor Bug fix in fetch Rewards
May 18, 2022
090d7a9
Merge branch 'main' into Feature/Fetch_Rewards
Hardik27 May 18, 2022
28dcdcf
Part 1: Update Profile
May 18, 2022
0874026
Merge pull request #39 from Hardik27/Feature/Fetch_Rewards
Axel0944 May 18, 2022
a23c41f
register event changes
arkapriyapaul May 19, 2022
ed0586a
adding reward points
arkapriyapaul May 23, 2022
7851f02
Merge pull request #40 from arkapriyapaul/main
Hardik27 May 23, 2022
691addc
Update Profile
May 24, 2022
8bdbe6b
New Lib added
May 24, 2022
fca73b2
Register event front end
Axel0944 May 24, 2022
5338522
Sending empty password on no pass udpate
May 24, 2022
d1d3df4
Minor bug in Update profile (#41)
vsricharan16 May 24, 2022
9ac9944
Merge pull request #42 from Hardik27/main
Hardik27 May 24, 2022
889b414
Merge pull request #43 from Hardik27/register_event_front_end
Axel0944 May 24, 2022
2e40d8e
Update profile final changes
May 24, 2022
a8c8b3d
Minor bug in register events
vsricharan16 May 24, 2022
7d580ba
Merge pull request #45 from Hardik27/minor-bug-registered-events
arkapriyapaul May 24, 2022
3089139
Merge pull request #44 from Hardik27/Feature/Update_Profile
Axel0944 May 24, 2022
59dbf19
Adding the isDeleted Flag
May 24, 2022
e3c23c3
Merge pull request #46 from Hardik27/Feature/is_deleted
Axel0944 May 24, 2022
dc443aa
Adding delete DTO functionality
vsricharan16 May 22, 2022
4a3fdea
Merge pull request #47 from Hardik27/soft-delete-dtos-feature
Hardik27 May 24, 2022
79ed846
Minor bug in soft delete (#48)
vsricharan16 May 24, 2022
6924130
delete front end and connectivity
Axel0944 May 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Log file
*.log
*.iml

# BlueJ files
*.ctxt
Expand Down Expand Up @@ -76,4 +77,6 @@ baseline.json
.history

# Husky
.husky/_
.husky/_

.angular
51 changes: 32 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
# SocialServiceFinder
My first commit

#CORS Filter (Change the port number accordingly)
@Bean
public CorsFilter corsFilter() {
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.setAllowCredentials(true);
corsConfiguration.setAllowedOrigins(Arrays.asList("http://localhost:4202"));
corsConfiguration.setAllowedHeaders(Arrays.asList("Origin", "Access-Control-Allow-Origin", "Content-Type",
"Accept", "Authorization", "Origin, Accept", "X-Requested-With",
"Access-Control-Request-Method", "Access-Control-Request-Headers"));
corsConfiguration.setExposedHeaders(Arrays.asList("Origin", "Content-Type", "Accept", "Authorization",
"Access-Control-Allow-Origin", "Access-Control-Allow-Origin", "Access-Control-Allow-Credentials"));
corsConfiguration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
return new CorsFilter(urlBasedCorsConfigurationSource);
}
## SocialServiceFinder

### [Video Link](https://www.youtube.com/watch?v=DoI5_Ww7daA)

### Abstract

There are many people who would like to do community services, but don’t know the places that offer the opportunity for
the same. Our project aims to provide a platform not only to people who seek non-profit organizations for any
opportunities where they can contribute, but also to encourage more people by rewarding them for doing good deeds. We
also plan on helping the organizations that are looking for volunteers to help them.

We are planning to create a web platform that creates and manages volunteering opportunities (posted by social service
organizations). Users can search for an opportunity based on various criterias like location, type of service required,
type of organizations listing the opportunities, etc. For motivating the users, rewards from various partner companies
will be offered to those who volunteer in these events. We are planning to implement a microservice based architecture
using SOLID principles, and create a complete system with a reactive frontend, scalable backend software and a NOSQL
database. For internal communication within the services, we will be using Messaging channels between them. We are
focusing on microservice based architecture because we want to create a robust, maintainable and a highly scalable
system in a way that makes it easy to add more features in the future, supporting Agile methodology. We are also
planning to cover the features using functional tests.

### Setup

TO DO Add instructions to set up Elasticsearch

#### Pre-reqs:

1. Java
2. Angular Cli
3. MongoDb
4. Git

66 changes: 66 additions & 0 deletions eventservice/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.socialservicefinder</groupId>
<artifactId>eventservice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>eventservice</name>
<description>Event Service Folder for Social Service Finder Project</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-elasticsearch -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>4.3.4</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.socialservicefinder</groupId>
<artifactId>userservice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.socialservicefinder.eventservice;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;

import java.util.Arrays;

@SpringBootApplication
@ComponentScan(basePackages = {"com.socialservicefinder.eventservice", "com.socialservicefinder.userservice"})
public class EventServiceApplication {
public static void main(String[] args) {
SpringApplication.run(EventServiceApplication.class, args);
}

//CORS is some mechanism added by mordern browswers. just copy pasting. More Info: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
@Bean
public CorsFilter corsFilter1() {
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.setAllowCredentials(true);
corsConfiguration.setAllowedOrigins(Arrays.asList("http://localhost:4200"));
corsConfiguration.setAllowedHeaders(Arrays.asList("Origin", "Access-Control-Allow-Origin", "Content-Type",
"Accept", "Authorization", "Origin, Accept", "X-Requested-With",
"Access-Control-Request-Method", "Access-Control-Request-Headers"));
corsConfiguration.setExposedHeaders(Arrays.asList("Origin", "Content-Type", "Accept", "Authorization",
"Access-Control-Allow-Origin", "Access-Control-Allow-Origin", "Access-Control-Allow-Credentials"));
corsConfiguration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
return new CorsFilter(urlBasedCorsConfigurationSource);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
package com.socialservicefinder.eventservice.controller;

import com.socialservicefinder.eventservice.dto.*;
import com.socialservicefinder.eventservice.exceptions.InvalidEventException;
import com.socialservicefinder.eventservice.service.EventLookUpService;
import com.socialservicefinder.eventservice.service.EventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@RestController
@RequestMapping(path = "api/v1/event")
public class EventController {
private final EventService eventService;
private final EventLookUpService eventLookUpService;

@Autowired
public EventController(EventService eventService, EventLookUpService eventLookUpService) {
this.eventService = eventService;
this.eventLookUpService = eventLookUpService;
}

@GetMapping
public List<Event> getEvents() {
return eventService.getEvents();
}

@PostMapping
public ResponseEntity<String> addEvent(@RequestBody Event event) {
try {
eventService.addEvent(event);
return ResponseEntity.status(HttpStatus.OK).body(null);
} catch (InvalidEventException e) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(e.getMessage());
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
}
}

@PostMapping
@RequestMapping("/update/")
public ResponseEntity<String> updateEvent(@RequestBody Event event) {
try {
eventService.updateEvent(event);
return ResponseEntity.status(HttpStatus.OK).body(null);
} catch (InvalidEventException e) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(e.getMessage());
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
}
}

@PostMapping
@RequestMapping("/delete/")
public ResponseEntity<String> deleteEvent(@RequestBody Event event) {
try {
eventService.deleteEvent(event);
return ResponseEntity.status(HttpStatus.OK).body(null);
} catch (InvalidEventException e) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(e.getMessage());
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
}
}

@GetMapping
@RequestMapping("/search/")
public List<Event> getMatchingEvents(@RequestBody SearchQuery q) {
try {
if (q.getQuery().isEmpty()) {
return Collections.emptyList();
}
Page<EventLookUp> eventLookUps = eventLookUpService.findEventLookUpByEventInfoContaining(q.getQuery(), PageRequest.of(0, 10));
List<String> eventIds = new ArrayList<>();
eventLookUps.forEach(x -> eventIds.add(x.getEventId()));
List<Event> events = eventService.findEventsByIds(eventIds);
for (Event e : events) {
//Logging events coming from search
System.out.println(e.toString());
}
System.out.println("Query String:" + q.getQuery());
return events;
} catch (Exception e) {
return Collections.emptyList();
}
}

@GetMapping
@RequestMapping("/fetchMyEvents/")
public List<Event> fetchMyEvents(@RequestBody FetchMyEvents f) {
try {
if (f.getId().length() == 0) {
return Collections.emptyList();
}
return eventService.fetchMyEvents(f.getId(), f.getIsOrganizer(), false);
} catch (Exception e) {
return Collections.emptyList();
}
}

@PutMapping
@RequestMapping("/registerForEvent")
public ResponseEntity<String> registerUserForEvent(@RequestBody RegisterEvent eventToRegister){
try {
eventService.registerUserForEvent(eventToRegister);
return ResponseEntity.status(HttpStatus.OK).body(null);
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
}
}

}
Loading