- Enhanced version with improved architecture - Key improvements over Web v1 - Extended API endpoints documentation - Migration guide from Web v1 - Development and deployment guidelines 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
3.1 KiB
3.1 KiB
SAPIENS Web2
Enhanced version of SAPIENS Web with additional features and improved architecture.
Overview
SAPIENS Web2 is an evolved version of the SAPIENS platform, featuring enhanced user experience, improved performance, and additional functionality for news content delivery.
Tech Stack
Frontend
- Framework: React 18.3 with Vite 5.4
- Language: TypeScript 5.6
- Styling: Tailwind CSS 3.4 with shadcn/ui components
- State Management: TanStack React Query 5.60
- Routing: Wouter 3.3
- UI Library: Radix UI primitives
Backend
- Runtime: Node.js with Express 4.21
- Database: PostgreSQL with Drizzle ORM 0.44
- Authentication: Passport.js with local and OpenID strategies
- Session: express-session with PostgreSQL store
Project Structure
sapiens-web2/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # UI components
│ │ ├── hooks/ # Custom React hooks
│ │ └── lib/ # Utilities
├── server/ # Express backend
│ ├── index.ts # Server entry point
│ ├── routes.ts # API routes
│ └── db/ # Database schemas
├── scripts/ # Build and utility scripts
├── shared/ # Shared types and utilities
└── dist/ # Build output
Key Improvements over Web v1
- Enhanced UI/UX with refined component library
- Improved performance optimization
- Additional API endpoints
- Enhanced database schema
- Better error handling and logging
Getting Started
Prerequisites
- Node.js 18+ and npm/yarn
- PostgreSQL 14+
Installation
# Install dependencies
npm install
# Set up database
npm run db:push
Environment Variables
Create a .env file:
DATABASE_URL=postgresql://user:password@localhost:5432/sapiens_db2
SESSION_SECRET=your-session-secret
NODE_ENV=development
PORT=5000
Development
# Start development server
npm run dev
# Type checking
npm run check
# Run scripts
npm run scripts
Production Build
# Build the application
npm run build
# Start production server
npm start
Database Management
# Push schema changes to database
npm run db:push
# Generate migrations
drizzle-kit generate
# Run migrations
drizzle-kit migrate
API Endpoints
Extended API from Web v1 with additional endpoints:
GET /api/outlets- List news outletsGET /api/outlets/:id/articles- Get articles from an outletGET /api/articles/:id- Get article detailsGET /api/categories- List categoriesPOST /api/auth/login- User loginPOST /api/auth/register- User registration
Contributing
- Create a feature branch
- Make your changes
- Run type checking with
npm run check - Test your changes thoroughly
- Submit a pull request
Migration from Web v1
If migrating from SAPIENS Web v1:
- Update database connection string
- Run migrations:
npm run db:push - Review and update environment variables
- Test all features
License
Proprietary - All rights reserved