Skip to content

The MSWD Livelihood Rizal Palawan Web App is a digital platform designed for the Municipal Social Welfare and Development Office (MSWD) of Rizal, Palawan.

Notifications You must be signed in to change notification settings

KNIGHTPROJEKS-0/MSWD-Livelihood-Rizal-Palawan-Web-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MSWD Livelihood Rizal Palawan Web Application

πŸ“‹ Project Overview

Name: MSWD-Livelihood-Rizal-Palawan-Web-App
Version: 1.0.0
Status: Active Development
Repository: https://github.com/KNIGHTPROJEKS-0/MSWD-Livelihood-Rizal-Palawan-Web-App

A comprehensive digital platform for the Municipal Social Welfare and Development Office (MSWD) of Rizal, Palawan, designed to modernize and streamline social welfare program management across 11 barangays.

🎯 Key Objectives

  • Digital Transformation: Transition from manual to automated MSWD operations
  • Enhanced Service Delivery: Faster processing and real-time updates for beneficiaries
  • Data-Driven Insights: Analytics and reporting for informed decision-making
  • Accessibility: Multi-platform support (web and mobile) with inclusive design

πŸ‘₯ User Ecosystem

Role Responsibilities
Superadmin System configuration, user management, comprehensive analytics
Admin (MSWD Staff) Program oversight, application processing, beneficiary management
Beneficiary Self-service registration, program applications, status tracking

πŸ›οΈ Service Portfolio

Core Services

  • Livelihood Programs: Financial assistance, skills training, business development
  • Child & Youth Services: Daycare, development programs, protection services
  • Family Support: Counseling, solo parent assistance, victim support
  • Social Pension: Senior citizen and PWD support programs
  • Emergency Response: Crisis intervention and disaster relief coordination

πŸ—οΈ Technical Architecture

Technology Stack

  • Frontend: React 18 + Vite + TypeScript + Chakra UI (Web), Expo React Native (Mobile)
  • Backend: FastAPI (Python 3.11+) + PostgreSQL 15+ + Redis 7+
  • Authentication: Firebase Auth + JWT
  • Storage: Firebase Storage
  • Deployment: Railway, Render, Platform.sh
  • DevOps: Docker, GitHub Actions, n8n Workflows

Project Structure

MSWD-Livelihood-Rizal-Palawan-Web-App/
β”œβ”€β”€ apps/                               # Frontend Applications
β”‚   β”œβ”€β”€ web/                            # React Web Application
β”‚   β”‚   β”œβ”€β”€ public/                     # Static assets
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ components/             # Reusable UI components
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ common/             # Shared components
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ forms/              # Form components
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ layout/             # Layout components
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ui/                 # Base UI components
β”‚   β”‚   β”‚   β”‚   └── webflow/            # Webflow integration
β”‚   β”‚   β”‚   β”œβ”€β”€ pages/                  # Route page components
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ auth/               # Authentication pages
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ dashboard/          # Dashboard pages
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ programs/           # Program-specific pages
β”‚   β”‚   β”‚   β”‚   └── profile/            # User profile pages
β”‚   β”‚   β”‚   β”œβ”€β”€ services/               # API clients & Firebase
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ api/                # Backend API client
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ firebase/           # Firebase services
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ webflow/            # Webflow API integration
β”‚   β”‚   β”‚   β”‚   └── types/              # Service type definitions
β”‚   β”‚   β”‚   β”œβ”€β”€ store/                  # State management (Zustand/Redux)
β”‚   β”‚   β”‚   β”œβ”€β”€ hooks/                  # Custom React hooks
β”‚   β”‚   β”‚   β”œβ”€β”€ lib/                    # Utility functions
β”‚   β”‚   β”‚   β”œβ”€β”€ theme/                  # Chakra UI theme
β”‚   β”‚   β”‚   β”œβ”€β”€ types/                  # TypeScript definitions
β”‚   β”‚   β”‚   β”œβ”€β”€ App.tsx                 # Root component
β”‚   β”‚   β”‚   └── main.tsx                # Application entry point
β”‚   β”‚   β”œβ”€β”€ vite.config.ts              # Vite configuration
β”‚   β”‚   β”œβ”€β”€ tsconfig.json               # TypeScript config
β”‚   β”‚   └── package.json                # Dependencies
β”‚   β”‚
β”‚   β”œβ”€β”€ mobile/                         # React Native Mobile App
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ components/             # Mobile UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ screens/                # Screen components
β”‚   β”‚   β”‚   β”œβ”€β”€ navigation/             # Navigation configuration
β”‚   β”‚   β”‚   β”œβ”€β”€ services/               # API & Firebase services
β”‚   β”‚   β”‚   └── types/                  # Type definitions
β”‚   β”‚   β”œβ”€β”€ app.json                    # Expo configuration
β”‚   β”‚   └── package.json                # Dependencies
β”‚   β”‚
β”‚   └── webflow-extension/              # Webflow Designer Extension
β”‚       β”œβ”€β”€ src/index.ts                # Extension logic
β”‚       β”œβ”€β”€ public/                     # Extension UI
β”‚       β”œβ”€β”€ webflow.json                # Extension config
β”‚       └── package.json                # Dependencies
β”‚
β”œβ”€β”€ services/                           # Backend Services
β”‚   └── api/                            # FastAPI Backend
β”‚       β”œβ”€β”€ app/
β”‚       β”‚   β”œβ”€β”€ api/v1/endpoints/       # API route handlers
β”‚       β”‚   β”‚   β”œβ”€β”€ auth.py             # Authentication routes
β”‚       β”‚   β”‚   β”œβ”€β”€ users.py            # User management
β”‚       β”‚   β”‚   β”œβ”€β”€ programs.py         # Program management
β”‚       β”‚   β”‚   β”œβ”€β”€ applications.py     # Application handling
β”‚       β”‚   β”‚   β”œβ”€β”€ admin.py            # Admin operations
β”‚       β”‚   β”‚   └── oauth.py            # OAuth integration
β”‚       β”‚   β”œβ”€β”€ core/                   # Core configuration
β”‚       β”‚   β”œβ”€β”€ db/                     # Database configuration
β”‚       β”‚   β”œβ”€β”€ models/                 # SQLAlchemy models
β”‚       β”‚   β”œβ”€β”€ schemas/                # Pydantic schemas
β”‚       β”‚   β”œβ”€β”€ services/               # Business logic
β”‚       β”‚   β”œβ”€β”€ utils/                  # Utility functions
β”‚       β”‚   β”œβ”€β”€ tests/                  # Test files
β”‚       β”‚   └── main.py                 # FastAPI application entry
β”‚       β”œβ”€β”€ requirements.txt            # Python dependencies
β”‚       β”œβ”€β”€ Dockerfile                  # Docker configuration
β”‚       └── alembic.ini                 # Database migrations
β”‚
β”œβ”€β”€ packages/                           # Shared Packages
β”‚   β”œβ”€β”€ shared-types/                   # Shared TypeScript types
β”‚   └── utils/                          # Shared utilities
β”‚
β”œβ”€β”€ infra/                              # Infrastructure Configuration
β”‚   β”œβ”€β”€ docker-compose.yml              # Development environment
β”‚   β”œβ”€β”€ railway.json                    # Railway deployment config
β”‚   └── render.yaml                     # Render deployment config
β”‚
β”œβ”€β”€ .env.template                       # Environment template
β”œβ”€β”€ .env.railway                        # Railway environment template
β”œβ”€β”€ start-dev.sh                        # Development startup script
β”œβ”€β”€ deploy-railway.sh                   # Railway deployment script
└── package.json                        # Root package scripts

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.11+
  • PostgreSQL 15+
  • Redis 7+
  • Docker & Docker Compose

Development Setup

# Clone repository
git clone https://github.com/KNIGHTPROJEKS-0/MSWD-Livelihood-Rizal-Palawan-Web-App.git
cd MSWD-Livelihood-Rizal-Palawan-Web-App

# Install dependencies
pnpm install

# Configure environment
cp .env.template .env
# Edit .env with your configuration

# Start development environment
./start-dev.sh

# Or manually:
docker compose up -d  # Start PostgreSQL & Redis
cd apps/web && pnpm run dev  # Start web app

Access Points

πŸ”§ Development Scripts

# Root level commands
pnpm install              # Install all dependencies
pnpm run dev:web          # Start web development server
pnpm run dev:api          # Start API development server
pnpm run build:web        # Build web application
pnpm run test             # Run all tests
pnpm run lint             # Run linting
pnpm run format           # Format code

# Web app specific (apps/web/)
pnpm run dev              # Start development server
pnpm run build            # Build for production
pnpm run preview          # Preview production build
pnpm run type-check       # TypeScript type checking

# API specific (services/api/)
uvicorn app.main:app --reload  # Start API server
pytest                    # Run API tests
alembic upgrade head      # Run database migrations

πŸ” Security & Authentication

Firebase Configuration

  • Authentication: Email/Password, Google Sign-in
  • Database: Firestore for real-time data
  • Storage: Firebase Storage for file uploads
  • Messaging: FCM for push notifications

Security Features

  • JWT token-based authentication
  • Role-based access control (RBAC)
  • API rate limiting
  • CORS protection
  • Input validation and sanitization
  • Audit logging for all operations

🚒 Deployment

Railway Deployment (Recommended)

# Install Railway CLI
npm install -g @railway/cli

# Deploy to Railway
./deploy-railway.sh

Alternative Deployments

  • Render: Automated via infra/render.yaml
  • Platform.sh: Configuration in infra/platform.app.yaml
  • Docker: Use provided Dockerfiles

Environment Variables

Key environment variables needed:

# Database
DATABASE_URL=postgresql://user:pass@host:port/db
REDIS_URL=redis://host:port

# Firebase
VITE_FIREBASE_API_KEY=your-api-key
VITE_FIREBASE_AUTH_DOMAIN=your-domain
VITE_FIREBASE_PROJECT_ID=your-project-id

# API
SECRET_KEY=your-secret-key
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30

πŸ§ͺ Testing

Running Tests

# Frontend tests
cd apps/web
pnpm run test

# Backend tests
cd services/api
pytest

# E2E tests
pnpm run test:e2e

Test Coverage

  • Unit tests for components and services
  • Integration tests for API endpoints
  • E2E tests for critical user flows
  • Performance testing for scalability

πŸ“Š Monitoring & Analytics

Health Monitoring

  • API health checks at /health
  • Database connection monitoring
  • Redis cache performance tracking
  • Error logging and alerting

Analytics Dashboard

  • User engagement metrics
  • Program application statistics
  • System performance monitoring
  • Audit trail reporting

πŸ”„ Workflow Automation (n8n)

Automated Workflows

  • Application Processing: Auto-notifications and status updates
  • Beneficiary Management: Status change notifications and reporting
  • Program Monitoring: Scheduled reports and deadline reminders
  • Data Synchronization: Cross-system data consistency

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Write tests for new features
  • Use conventional commit messages
  • Update documentation as needed

πŸ“š Documentation

πŸ› Troubleshooting

Common Issues

  1. Database Connection: Check DATABASE_URL and ensure PostgreSQL is running
  2. Firebase Auth: Verify Firebase configuration and API keys
  3. CORS Errors: Check BACKEND_CORS_ORIGINS environment variable
  4. Build Failures: Clear node_modules and reinstall dependencies

Getting Help

πŸ“ˆ Roadmap

Phase 1: Foundation (Completed)

  • βœ… Project setup and architecture
  • βœ… Authentication system
  • βœ… Basic CRUD operations
  • βœ… Database schema design

Phase 2: Core Features (In Progress)

  • πŸ”„ Program management system
  • πŸ”„ Application processing workflow
  • πŸ”„ Beneficiary dashboard
  • πŸ”„ Admin panel

Phase 3: Advanced Features (Planned)

  • πŸ“± Mobile application
  • πŸ€– AI-powered analytics
  • πŸ”— Blockchain integration
  • πŸ“Š Advanced reporting

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“ž Contact & Support


This platform represents a significant step toward modernizing social welfare services in Rizal, Palawan, ensuring efficient, transparent, and accessible support for community members.

Last Updated: January 2025
Deployment Status: βœ… Ready for Production

About

The MSWD Livelihood Rizal Palawan Web App is a digital platform designed for the Municipal Social Welfare and Development Office (MSWD) of Rizal, Palawan.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published