Skip to content
kiogaarhusPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GIDAS Explorer

Full-stack web application for managing and analyzing environmental case data from GIDAS database system.

πŸ—οΈ Architecture

Technology Stack:

  • Backend: FastAPI with SQLAlchemy ORM
  • Frontend: React with TypeScript
  • Database: Microsoft SQL Server
  • State Management: React Query (TanStack Query)
  • UI Components: Custom UI component library
  • Build Tools: Vite (frontend), Python pip (backend)

πŸ“‹ Features

πŸ“Š Dashboard System

  • Separering Dashboard: Specialized UI for separation cases
  • Γ…ben Land Dashboard: Environmental case management
  • Dispensationssag Dashboard: Dispensation case tracking
  • Nedsivningstilladelse Dashboard: Permits and authorizations
  • Analytics Page: Comprehensive reporting and visualizations

πŸ“‹ Case Management (Sagsbehandling)

  • Advanced Filtering: Filter by project type, project name, status, dates
  • Full CRUD Operations: Create, read, update, delete cases
  • Export Functionality: CSV and Excel export with filter preservation
  • Search: Full-text search across case fields
  • Status Workflow: Active β†’ FΓ¦rdigmeldt β†’ Closed

πŸ” Case Details

  • Comprehensive Views: Complete case information display
  • Registration Tracking: Dynamic field registration (BBR status, etc.)
  • Timeline View: Activity history and event tracking
  • Document Management: PDF generation and export

πŸ“ˆ Analytics & Reporting

  • Real-time Statistics: KPI tracking across all project types
  • Trend Analysis: Monthly trends and growth metrics
  • Project Distribution: Visual breakdown by project types
  • Export Reports: Excel and CSV report generation

πŸš€ Quick Start

Prerequisites

  • Python 3.9+
  • Node.js 18+
  • Microsoft SQL Server
  • Git

Installation

  1. Clone Repository

    git clone <repository-url>
    cd gidas_explorer
  2. Backend Setup

    # Create virtual environment
    python -m venv venv
    
    # Activate (Windows)
    venv\Scripts\activate
    
    # Install dependencies
    pip install -r requirements.txt
  3. Frontend Setup

    cd frontend
    npm install
    cd ..
  4. Configuration

    # Create .env file with your database credentials
    # See example in Installation section
  5. Run Application

    # Start backend (Terminal 1)
    cd backend
    uvicorn main:app --reload --port 8000
    
    # Start frontend (Terminal 2)
    cd frontend
    npm run dev

πŸ“ Project Structure

gidas_explorer/
β”œβ”€β”€ backend/                    # FastAPI backend
β”‚   β”œβ”€β”€ api/                   # API endpoints
β”‚   β”‚   β”œβ”€β”€ sager.py           # Case management API
β”‚   β”‚   β”œβ”€β”€ separering.py      # Separation dashboard
β”‚   β”‚   β”œβ”€β”€ aabenland.py       # Γ…ben Land dashboard
β”‚   β”‚   β”œβ”€β”€ dispensationssag.py # Dispensation cases
β”‚   β”‚   β”œβ”€β”€ nedsivningstilladelse.py # Permits
β”‚   β”‚   β”œβ”€β”€ reports.py         # Analytics API
β”‚   β”‚   └── forecasts.py       # Forecasting
β”‚   β”œβ”€β”€ models/               # SQLAlchemy ORM models
β”‚   β”‚   └── amo.py            # AMO database models
β”‚   β”œβ”€β”€ schemas/              # Pydantic response schemas
β”‚   β”œβ”€β”€ database/             # Database session management
β”‚   └── main.py               # FastAPI application entry
β”œβ”€β”€ frontend/                  # React frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/           # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SepareringDashboard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ AabenlandDashboard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ DispensationssagDashboard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ NedsivningstilladelseDashboard.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ AnalyticsPage.tsx
β”‚   β”‚   β”‚   └── Sager/        # Case management
β”‚   β”‚   β”œβ”€β”€ components/       # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ hooks/            # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ types/            # TypeScript type definitions
β”‚   β”‚   └── utils/            # Utility functions
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.ts
β”œβ”€β”€ .gitignore               # Git ignore rules
β”œβ”€β”€ requirements.txt         # Python dependencies
└── README.md               # This file

πŸ”§ Configuration

Environment Variables (.env)

# Database Configuration
DATABASE_URL=sqlalchemy+pyodbc://username:password@server/database

# API Configuration
API_HOST=0.0.0.0
API_PORT=8000

# Frontend Configuration
VITE_API_URL=http://localhost:8000
VITE_APP_TITLE=GIDAS Explorer

Database Connection

Ensure your database connection string follows this format:

sqlalchemy+pyodbc://username:password@server_name/database_name?driver=ODBC+Driver+17+for+SQL+Server

πŸ“Š API Endpoints

Case Management

  • GET /api/sager - List cases with filtering and pagination
  • GET /api/sager/{id} - Get case details
  • POST /api/sager - Create new case
  • PUT /api/sager/{id} - Update case
  • GET /api/sager/export/csv - Export cases to CSV
  • GET /api/sager/export/excel - Export cases to Excel

Dashboards

  • GET /api/dashboard/separering/stats - Separation statistics
  • GET /api/dashboard/aabenland/stats - Γ…ben Land statistics
  • GET /api/dashboard/dispensationssag/stats - Dispensation statistics
  • GET /api/dashboard/nedsivningstilladelse/stats - Permit statistics

Analytics

  • GET /api/reports/monthly - Monthly overview
  • GET /api/reports/projekttyper - Project type distribution
  • GET /api/reports/export/excel - Export reports to Excel

🎨 UI Components

The application uses a custom UI component library with:

  • Cards: Structured content containers
  • Buttons: Various button styles and states
  • Badges: Status indicators and labels
  • Tables: Sortable, paginated data tables
  • Forms: Input validation and form handling
  • Charts: Data visualization components

πŸ”’ Security

  • Authentication: Session-based authentication system
  • Authorization: Role-based access control
  • Data Validation: Comprehensive input validation
  • SQL Injection Protection: Parameterized queries
  • CORS Configuration: Cross-origin resource sharing setup

πŸ§ͺ Development

Code Quality

# Backend code formatting
black backend/
isort backend/
flake8 backend/

# Frontend code formatting
cd frontend
npm run lint
npm run format

Testing

# Backend tests
pytest backend/

# Frontend tests
cd frontend
npm test

πŸ“¦ Deployment

Production Build

# Frontend build
cd frontend
npm run build

# Backend deployment
# Use WSGI server like Gunicorn
gunicorn backend.main:app -w 4 -k uvicorn.workers.UvicornWorker

Environment Setup

  • Use environment variables for all configuration
  • Ensure proper database connection pooling
  • Configure reverse proxy (nginx/Apache) for production
  • Set up monitoring and logging

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

πŸ“„ License

[Add your license information here]

πŸ“ž Support

For technical support and questions:

  • Create an issue in the repository
  • Contact the development team

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages