Skip to content

About

Backend for VisaScope — H1B Petition Tracker

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

⚙️ visa-scope-api

Backend for VisaScope — H1B Petition Tracker
REST API that ingests, stores, and serves USCIS H1B employer petition data.

Java Spring Boot PostgreSQL AWS EC2


🌐 Live API

🔗 [Coming Soon — hosted on AWS EC2]


✨ Features

  • 📥 USCIS CSV Ingestion — Loads H1B employer data directly from official USCIS data hub CSVs
  • 🔎 Company Search API — Full-text employer name search
  • ✅ 2-Year Filing Check — Determines if a company filed new H1Bs or H1B transfers in the last 2 fiscal years
  • 📄 Paginated Data API — Efficient paginated access to the full dataset
  • 🔒 CORS Configured — Ready to connect with the Angular frontend

🛠️ Tech Stack

Layer Technology
Language Java 21
Framework Spring Boot 3.2
ORM Spring Data JPA / Hibernate
Database PostgreSQL (AWS RDS Free Tier)
Build Tool Maven
CSV Parsing OpenCSV
Hosting AWS EC2 (t2.micro Free Tier)
Data Source USCIS H1B Employer Data Hub

🗂️ Project Structure

visa-scope-api/
├── src/
│   └── main/
│       ├── java/com/h1btracker/
│       │   ├── VisaScopeApiApplication.java
│       │   ├── controller/
│       │   │   └── H1bController.java       # REST endpoints
│       │   ├── service/
│       │   │   └── H1bService.java          # Business logic
│       │   ├── repository/
│       │   │   └── H1bRepository.java       # DB queries
│       │   ├── model/
│       │   │   └── H1bPetition.java         # JPA Entity
│       │   └── loader/
│       │       └── CsvDataLoader.java       # USCIS CSV import
│       └── resources/
│           ├── application.properties
│           └── data/                        # Place USCIS CSVs here
├── pom.xml
└── README.md

🚀 Getting Started

Prerequisites

Installation

# Clone the repo
git clone https://github.com/hvemuri9/visa-scope-api.git
cd visa-scope-api

# Build the project
mvn clean install

# Run locally
mvn spring-boot:run

Database Setup

-- Run in PostgreSQL
CREATE DATABASE h1bdb;
CREATE USER h1badmin WITH PASSWORD 'yourpassword';
GRANT ALL PRIVILEGES ON DATABASE h1bdb TO h1badmin;

application.properties

spring.datasource.url=jdbc:postgresql://localhost:5432/h1bdb
spring.datasource.username=h1badmin
spring.datasource.password=yourpassword
spring.jpa.hibernate.ddl-auto=update
server.port=8080

📥 Loading USCIS Data

  1. Download CSV files from the USCIS H1B Employer Data Hub
  2. Download FY2024 and FY2025 files
  3. Place them in src/main/resources/data/
  4. On app startup, CsvDataLoader will automatically parse and insert records into PostgreSQL

📡 API Reference

Search by Company

GET /api/h1b/search?company={name}

Response: List of H1B petition records matching the company name


Check Last 2 Years

GET /api/h1b/check-recent?company={name}

Response:

{
  "company": "Google",
  "filedNewH1B": true,
  "filedTransfer": true,
  "yearsChecked": [2024, 2025],
  "records": [...]
}

Get All Data (Paginated)

GET /api/h1b/all?page=0&size=20

Response: Paginated list of all H1B petition records


☁️ AWS Deployment

# Build JAR
mvn clean package -DskipTests

# SCP to EC2
scp -i your-key.pem target/visa-scope-api-0.0.1-SNAPSHOT.jar ec2-user@YOUR-EC2-IP:~/

# SSH into EC2 and run
ssh -i your-key.pem ec2-user@YOUR-EC2-IP
java -jar visa-scope-api-0.0.1-SNAPSHOT.jar &

EC2 Security Group: Open inbound port 8080 for your frontend's origin.


🛣️ Roadmap

  • Load USCIS data from FY2023 and earlier
  • Add DOL LCA data for salary info
  • Scheduled quarterly data refresh
  • Add caching with Spring Cache
  • Swagger/OpenAPI documentation

🔗 Frontend Repo

This API is consumed by visa-scope-ui — the Angular 8 frontend.


👨‍💻 Author

hvemuri9
GitHub: @hvemuri9


📄 License

MIT License — free to use and modify.

About

Backend for VisaScope — H1B Petition Tracker

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors