You wouldn’t need servlets unless you’re thinking of writing the backend in JAVA.
The application you require is quite straightforward, I’ll suggest you some of the technologies I’ll use if I were to build this application,
Firstly, it’s clear that we need a backend to store and send the location co-ordinates from one user to another, also it’s clear that you need an API for it, since you’re targeting both browser and mobile devices.
Now it’s time to choose which language and framework to use to write this API,
The viable options are Ruby (Ruby on rails), NodeJS (ExpressJS), Python (Django or Flask), PHP (Laravel, cakePHP and many others). I didn’t choose Java because it’s not originally developed for web development, also I’m not comfortable with using Java for web development (remember this is what I’ll use).
Now out of the above 4 language options, all 4 are great for all API purposes, but if you’re thinking about building a realtime system, it’ll be better to choose nodeJs, since it’s proven to be faster than the others in sending and receiving messages, but slower in terms of computation (since your application doesn’t need much computation as of yet, this is a good choice).
Coming to realtime systems, I think I still didn’t understand your application clearly, you said people will be able to view other ppl’s location (if they’re connected to them and if they choose to share their location), but the problem is, when exactly would they be able to see ?
Let’s consider, I want to see the locations of David and Martha. So, are you saying that when I open the application and click on a button (like show location), assuming I’m already connected with David and Martha, it’ll show me David and Martha’s location ?
Let’s consider the facts, for that to actually happen, David and Martha will have to keep their GPS and their internet connections on, the whole time, which will drain significant amount of battery and data. Have you considered this ?
Coming back to the plan, the next thing to plan is which database to use, since the application is only transferring location co-ordinates which should be two floating point numbers, I think an SQL database is fine, if it were me, I’d use MySQL, since that’s what I’m most experienced in.
Next is Frontend,
Hands down I’d choose React for this, and there’s a lot of reasons for that,
First of all, this community has a lot of React developers, especially, this site itself is created in React, so I think you’ll get a lot of support here.
React is also one of the best front end frameworks out there, there aren’t many that could match up to it.
Also, you can use React Native to build a hybrid application for mobile devices and React Native is also quite similar to React.
That’s the plan I’d use !