SCP Portal App is a comprehensive platform for managing companies, contacts, tasks, emails, quotes, and inventory. It features a modern React/TypeScript frontend and a robust Node.js/Sails.js backend, providing a seamless, responsive user experience.
- Frontend: React 19.0.0, TypeScript 5.4.5, Tailwind CSS 4.1.18, shadcn/ui, Vite
- Backend: Node.js, Sails.js 1.5.2, MySQL/PostgreSQL
- UI System: Tailwind CSS, shadcn/ui, Radix UI
- Other Libraries: React Router, TanStack React Table, React Hook Form, Axios, Notistack
- Architecture: RESTful API with JWT authentication
- π Dashboard - Overview of tasks, companies, and analytics
- π’ Company Management - Add, edit, and manage companies
- π₯ Contact Management - Maintain contact information
- β Task Management - Create and track tasks
- π§ Email Integration - Send and manage emails
- π Notes System - Create and organize notes
- π¦ Inventory Management - Track inventory items
- π° Quote Management - Generate and manage quotes
- π€ User Profiles - User account management
- π User Authentication - Secure login with JWT tokens
- π Dashboard Analytics - Business insights and reporting
- π¨ Responsive Design - Mobile-friendly interface
- π Advanced Search & Filtering - Quick data retrieval
- Node.js (v18.0 or higher)
- npm or yarn
- MySQL or PostgreSQL database
git clone https://github.com/sonusindhu/scp-portal-app.git
cd scp-portal-appcd web-api
npm install
npm startcd web-app
npm install
npm run devAccess the application:
- π Frontend: http://localhost:5173
- π§ Backend API: http://localhost:1337
- π API Docs: http://localhost:1337/docs
src/
βββ components/ # Feature and UI components
β βββ Home/ # Home page
β βββ Profile/ # User profile
β βββ CompanyList/ # Company management (CRUD, forms, list)
β βββ Contacts/ # Contact management
β βββ Inventory/ # Inventory management
β βββ Quote/ # Quote management
β βββ Login/ # Auth/login UI
β βββ ui/ # Custom UI primitives (Button, Card, Tabs, etc.)
βββ layouts/ # Page layout components
βββ models/ # TypeScript type definitions
βββ services/ # API service functions
βββ shared/ # Shared utilities and components
β βββ components/ # Shared components (Tasks, Emails, Notes)
β βββ common/ # Common utilities
βββ utils/ # Helper functions and utilities
βββ App.tsx # Main App component
βββ index.tsx # Application entry point
- Tailwind CSS and shadcn/ui are used for all new UI components, providing a modern, accessible, and customizable design system.
- Radix UI primitives are used for accessibility and composability.
See src/components/ui/ for custom UI primitives (Button, Card, Tabs, etc.).
See src/components/TailwindDemo.tsx for a demo of the new UI system.
Reusable hooks simplify state management and common patterns:
useAuth- Authentication state and user infouseDeleteConfirmation- Standardized delete confirmation dialogsuseDrawer- Drawer open/close stateuseGridActions- Grid/list action menu logicuseLoading,useLoadingStates- Loading state managementuseRefresh- Simple refresh triggersuseFormSubmit- Form submission helpers
See src/hooks/HOOKS_USAGE_GUIDE.tsx for usage examples.
Consistent loading UI is provided by reusable components in src/shared/components/Loading/:
LoadingButton- Button with loading stateLoadingContainer- Wrapper for loading/error/empty statesLoadingOverlay- Blocks interaction during async opsLoadingSpinner,PageLoader,InlineLoadingSpinner- Spinners for various contexts
Use with hooks: useLoading, useLoadingStates (see QUICK_REFERENCE.md).
Example:
const { isLoading, withLoading } = useLoading();
await withLoading(saveData(data));
<LoadingButton loading={isLoading}>Save</LoadingButton>All constants are centralized in src/constants/ and re-exported via src/utils/constants.util.ts for easy import.
- types.constants.ts - Core types and entity enums
- domain.constants.ts - Business/domain values (statuses, types, etc.)
- ui.constants.ts - UI config (field widths, date formats, etc.)
- api.constants.ts - API endpoints and HTTP status codes
- routes.constants.ts - All route paths (see
ROUTES)
See src/constants/README.md and src/utils/CONSTANTS_GUIDE.md for details and usage patterns.
Create a .env file in the web-app root directory:
# API Configuration
VITE_API_ENDPOINT=http://localhost:1337/api/v1/app/Create a .env file in the web-app root directory:
# API Configuration
VITE_API_ENDPOINT=http://localhost:1337/api/v1/app/Testing is set up with Jest and React Testing Library. Example test: src/components/CompanyList/test/CompanyList.spec.tsx.
Scripts:
npm test
npm test -- --coverage
npm test -- --watchAllThis project includes:
- Unit Tests - Component testing with React Testing Library
- Integration Tests - API integration testing
- E2E Tests - End-to-end user flow testing
See the Vite deployment documentation for more information on deploying this React application.
Built with β€οΈ by Sonu Sindhu