Real-time access to 1.7M+ New Zealand company data through a modern BI platform
Features β’ Tech Stack β’ Quick Start β’ Deployment β’ API Docs
NZCompanies is a comprehensive business intelligence platform providing real-time access to New Zealand company data for enterprises and individuals. Through a modern web interface and high-performance API, users can instantly access complete business registration information, director profiles, shareholder structures, and other critical commercial data.
- π¦ Financial Services: Risk assessment, KYC compliance, credit checks
- π₯ Recruitment & HR: Employer verification, background checks
- π Market Research: Industry analysis, competitive intelligence, market segmentation
- βοΈ Legal & Compliance: Due diligence, regulatory checks
- π Supply Chain: Vendor verification, risk management
-
Landing Page:
- Metro Style UI: Modern tile-based design with neon aesthetics
- Vertical Scrolling Ticker: Real-time company activity feed
- Persona-based Content: Tailored views for Job Seekers and Lenders
- AI Predictive Scoring: Visual indicators for company health and risk
- 3D starfield background animation (Three.js)
- Typewriter effect dynamic headlines
- Responsive design with mobile support
- Pricing tiers (Starter/Professional/Enterprise)
-
Dashboard:
- Real-time statistics cards
- Annual registration trend charts
- Company type distribution pie charts
- Recent registrations table
-
Search Page:
- Multi-dimensional search (company name, NZBN, address, director name)
- Real-time search results
- Pagination support
-
Company Details:
- Complete company information (registration date, status, address, website)
- Directors list with appointment dates
- Shareholder structure with ownership percentages
- Map location (Leaflet integration)
- RESTful API: Built with FastAPI for high concurrency
- Database: MySQL storing 1.7M+ company records
- CORS Support: Cross-origin access enabled
- Endpoints:
GET /api/v1/dashboard- Dashboard dataGET /api/v1/companies/search- Search companiesGET /api/v1/companies/{nzbn}- Company detailsPOST /api/v1/contact- Contact form submission
- Framework: React 19 + Vite 7
- Styling: Tailwind CSS 3
- Routing: React Router DOM 7
- Charts: Recharts 3
- 3D Rendering: Three.js + React Three Fiber
- Maps: Leaflet + React Leaflet
- Icons: Lucide React
- Language: TypeScript 5
- Framework: FastAPI (Python)
- Database: MySQL 8
- ORM: SQLAlchemy
- Migrations: Alembic
- CORS: FastAPI CORS Middleware
- Version Control: Git
- Package Management: npm (frontend) + pip (backend)
- Build Tools: Vite (frontend)
- Dev Server: Uvicorn (backend)
- Node.js: >= 18.x
- Python: >= 3.9
- MySQL: >= 8.0
- Git: Latest version
git clone <repository-url>
cd NZCompanies-- Create database
CREATE DATABASE nzcompanies CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- Import data (assuming you have CSV files)
-- Use import scripts in backend/scriptscd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Configure environment variables (optional)
# Edit backend/app/core/config.py to modify database connection
# Run database migrations (if needed)
alembic upgrade head
# Start backend server
uvicorn app.main:app --reloadBackend will run at http://localhost:8001
cd frontend
# Install dependencies
npm install
# Start development server
npm run devFrontend will run at http://localhost:5173
- Frontend: http://localhost:5173
- Backend API Docs: http://localhost:8001/docs
- Backend Redoc: http://localhost:8001/redoc
cd backend
# Install production dependencies
pip install -r requirements.txt
# Run with Gunicorn (recommended)
gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000
# Or use Uvicorn
uvicorn app.main:app --host 0.0.0.0 --port 8001 --workers 4Environment Configuration:
- Modify
DATABASE_URLinbackend/app/core/config.py - Use
.envfile for sensitive information
cd frontend
# Build production version
npm run build
# dist directory will contain static files
# Deploy to Nginx, Apache, Vercel, Netlify, etc.Nginx Configuration Example:
server {
listen 80;
server_name yourdomain.com;
root /path/to/NZCompanies/frontend/dist;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass http://localhost:8001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}# Backend Dockerfile example
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8001"]# Frontend Dockerfile example
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80GET /api/v1/dashboardResponse Example:
{
"totalCompanies": 1700000,
"companiesByType": [
{"name": "Limited Company", "value": 850000},
{"name": "Sole Trader", "value": 450000}
],
"registrationsPerYear": [
{"year": 2023, "count": 85000},
{"year": 2024, "count": 92000}
],
"recentRegistrations": [...]
}GET /api/v1/companies/search?query=example&limit=20&offset=0Query Parameters:
query: Search keyword (company name, NZBN, address, director)limit: Number of results (default 20)offset: Pagination offset
GET /api/v1/companies/{nzbn}Response Example:
{
"NZBN": "9429030096851",
"ENTITY_NAME": "Example Ltd",
"REGISTRATION_DATE": "2020-01-15",
"ENTITY_STATUS": "Registered",
"PHYSICAL_ADDRESS": "123 Queen St, Auckland",
"WEBSITE": "https://example.com",
"directors": [...],
"shareholders": [...]
}Full API documentation: http://localhost:8001/docs
NZCompanies/
βββ backend/ # Backend code
β βββ app/
β β βββ api/ # API routes
β β βββ core/ # Core configuration
β β βββ db/ # Database connection
β β βββ models/ # SQLAlchemy models
β β βββ main.py # FastAPI app entry
β βββ scripts/ # Data import scripts
β βββ alembic/ # Database migrations
β βββ requirements.txt # Python dependencies
β
βββ frontend/ # Frontend code
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ types/ # TypeScript types
β β βββ App.tsx # App entry
β β βββ main.tsx # React entry
β βββ public/ # Static assets
β βββ package.json # npm dependencies
β
βββ README.md # Project documentation
-
Database Security:
- Never hardcode database passwords in code
- Use environment variables or secret management services
- Restrict database access by IP
-
API Security:
- Disable
allow_origins=["*"]in production CORS settings - Implement API rate limiting
- Add JWT authentication (if needed)
- Disable
-
Frontend Security:
- Never store sensitive information in frontend
- Use HTTPS
- Implement CSP (Content Security Policy)
This project is for educational and research purposes only. Contact the author for commercial use.
Issues and Pull Requests are welcome!
- Email: Sparksqlmvp@gmail.com
- Website: NZCompanies Platform
Β© 2025 NZCompanies. All systems nominal.
Made with β€οΈ using React, FastAPI, and MySQL