A minimal full-stack app to fetch, store, and visualize random user data with geolocation-based nearest user discovery.
This app:
- Fetches random users from RandomUser API
- Stores their info and location in a SQLite database
- Finds the K-nearest users to a given user (by latitude/longitude)
- Visualizes results using a Streamlit dashboard with an interactive Folium map
- Backend: FastAPI, SQLAlchemy, SQLite
- Frontend: Streamlit, Folium (
streamlit-folium) - Other: Pydantic, Requests
git clone https://github.com/Nachiket-2024/nearby_users.git
cd nearby-usersInstall dependencies with pip:
pip install -r requirements.txtOr use Conda:
conda env create -f environment.yml
conda activate nearby-userscd backend
uvicorn main:app --reloadcd frontend
streamlit run app.py| Method | Route | Description |
|---|---|---|
| POST | /fetch-users/ |
Fetch and store N random users |
| GET | /random-user/ |
Return a random user from the database |
| GET | /nearest-users/ |
Return K nearest users to a given user |
You can deploy this app using Docker on any platform that supports containerized apps.
- Make your GitHub repository public (or provide Railway access).
- Connect your GitHub repository to Railway.
- Choose the Dockerfile option — Railway will automatically build and deploy the app.
- Configure environment variables (like database URL or others) if needed, via the Railway dashboard.
Vercel is mainly optimized for frontend apps (Next.js, React, etc.), not backend APIs like FastAPI.
For full-stack deployment, use Railway, Render, or Fly.io, or you can host manually on a VPS.
Render is a cloud platform where you can deploy Dockerized applications like this one. It also supports auto-deployment via GitHub.
- Connect your GitHub repository to Render.
- Choose the Docker option to deploy.
- Render will automatically detect and deploy the application using the provided Dockerfile.
- Set up any necessary environment variables in the Render dashboard.
