This Repo tracks the server side code base for the services related to VolunteeRide App.
- Pre-Requsites
-
Clone the project on the local system.
-
Import the project as a gradle project in Intellij.
-
Start MongoDB server using command mongod --dbPath <PATH_TO_YOUR_DB_DIRECTORY> by opening a new shell.
-
To quickly insert sample data in the test database, execute command gradlew cleanTest test --tests
"com.volunteeride.dao.RideDAOTest.test save ride " -
In order to confirm if the data was inserted in the mongodb databse, open a new shell, type command mongo, a mongo shell will open. Type the following commands to find the inserted data.
- show dbs .. will show available databases. You should see volunteerideTest database.
- use volunteerideDev .. command to use this db
- show collections .. will show ride, center and user collections.
- db.ride.find() .. will display data in ride collection. Copy the center id for one of the ride document for testing rest webservice in later steps.
-
In the gradle Tasks, in intellij, run bootRun Task. This will deploy the app on an embedded tomacat server.
-
Go to the browser of your choice or any rest client plugins for these browsers (RestClient plugin for Mozilla)
-
In-order to test whether are setup is successfull, we will make a rest call to one of the sample rest-webservices created for the project which is Retrieve All Rides for a particular center. .
-
Type url http://localhost:8080/volunteeride/centers/{PLUGIN THE CENTER ID COPIED EARLIER}/rides
-
You should get a Json response for the find rides rest webservice.
-
CONGRATUALTIONS YOU HAVE SUCCESSFULLY SETUP THE VOLUNTEERIDE APP IN YOUR LOCAL SYSTEM :) !!!