One of my biggest projects that I built for the Saudi Government during my current employment, I lead this project as the main developer managing a team of 6 developers, assigning tasks, building templates, reviewing code, deployment, alignment with product teams and stakeholders.
An internal organizational tool built with Next.js that provides employees with centralized access to HR services, information management, and request processing systems. This portal streamlines internal workflows and serves as a central hub for employee self-service functions.
A comprehensive internal portal that provides employees with centralized access to organizational services, information management, and request processing systems.
- Personalized Dashboard - Customizable widgets for quick access to information and actions
- News & Announcements - Company news, family updates, and internal advertisements
- Profile Management - Personal and employment information management
- Request System - Submit and track various requests (vacations, HR letters, medical claims)
- Employee Directory - Search colleagues and view department structures
- Form Management - Unified form submission system with validation
- Multi-language Support - Arabic and English interfaces
- Frontend: Next.js 15 (App Router), React 19, TypeScript
- Styling: Tailwind CSS, Radix UI Components
- State Management: Jotai
- Forms: React Hook Form with Zod validation
- Database: File-based storage (db.json)
- Testing: Vitest, React Testing Library
- Development: Storybook, ESLint, Prettier
- Deployment: Docker support
- Development Setup - Complete setup instructions
- Project Tour - Guided walkthrough
- Architecture Overview - Technical architecture details
- Features Guide - In-depth feature documentation
- UI & State Management - Component and state patterns
- Project Map - Feature-to-file mapping
- Form Submission Guide - Unified form submission logic
- Migration Guide - Form migration guidelines
- Testing Guide - Running and writing tests
- API Documentation - API schemas and endpoints
- Node.js 18+ (20+ recommended)
- pnpm 9+ (package manager)
- Git for version control
-
Clone the repository
git clone <repository-url> cd Internal-Portal
-
Install dependencies
pnpm install
-
Environment Setup
cp .env.example .env.local # Edit .env.local with your configuration -
Initialize the database
# Ensure the database file exists mkdir -p app/db # Copy default database if needed cp app/db/db.json.example app/db/db.json
Start the development server:
pnpm devThe application will be available at http://localhost:3000
Development with debugging:
pnpm dev:debugRun Storybook for component development:
pnpm storybookStorybook will be available at http://localhost:6006
Build the application:
pnpm buildStart the production server:
pnpm serve
# or
node .next/standalone/server.jsUsing Next.js server (alternative):
pnpm start
⚠️ Note: This method may produce unexpected results. See Next.js Documentation for details.
Run tests:
pnpm test # Run all tests
pnpm test:watch # Run tests in watch mode
pnpm test:coverage # Run tests with coverageLinting and formatting:
pnpm lint # Run ESLint
pnpm format # Format code with PrettierBuild Docker image:
docker build -t internal-portal:latest .Run Docker container:
docker run -it -p 3000:3000 internal-portal:latestThe application will be available at http://localhost:3000
Create a .env.local file in the root directory:
# Database Configuration
DATABASE_PATH=./app/db/db.json
# Authentication (if applicable)
AUTH_SECRET=your-auth-secret
AUTH_URL=http://localhost:3000
# External API URLs (customize as needed)
NEXT_PUBLIC_API_BASE_URL=http://localhost:3000/api
# Feature Flags
NEXT_PUBLIC_ENABLE_FEATURE_X=trueThe application uses a file-based database stored in app/db/db.json. For production deployments, ensure:
- The database directory is writable
- Regular backups are configured
- Proper file permissions are set
Node/pnpm version conflicts:
node --version # Should be 18+
pnpm --version # Should be 9+Build failures:
# Clean install
pnpm reset # This runs: rm -rf .next && rm -rf node_modules && pnpm iDatabase issues:
# Reset database to default state
cp app/db/db.json.example app/db/db.jsonPort conflicts:
# Check if port 3000 is in use
lsof -i :3000
# Kill process if needed
kill -9 <PID>If you encounter unexpected errors, run this complete reset:
# Clean all generated files
rm -rf .next
rm -rf node_modules
rm -rf pnpm-lock.yaml
# Reinstall dependencies
pnpm install
# Rebuild the application
pnpm build
# Copy required files for standalone mode
cp -r public .next/standalone/
cp -r .next/static .next/standalone/.next/
mkdir -p .next/standalone/app/db
cp app/db/db.json .next/standalone/app/db/
# Start the server
node .next/standalone/server.jsFor debugging issues:
# Enable debug output
NODE_OPTIONS='--inspect' pnpm dev
# For server debugging
pnpm dev-debug-server