7c893dac8a53c29eb0d42653320e26bde4dac215
- Full-stack setup with React, Express, and PostgreSQL - Database management with Drizzle ORM - Authentication and session management - API endpoints documentation - Development and deployment guidelines 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
SAPIENS Web
Full-stack web application for the SAPIENS news platform built with React, Express, and PostgreSQL.
Overview
SAPIENS Web is a modern web application providing a rich user experience for browsing and reading curated news content. Built with a robust tech stack featuring React 18, Express, and PostgreSQL with Drizzle ORM.
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-web/
├── 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
├── shared/ # Shared types and utilities
└── dist/ # Build output
Features
- Server-side rendering with Express
- PostgreSQL database with Drizzle ORM
- Authentication system with Passport.js
- Session management
- Responsive design with Tailwind CSS
- Real-time updates with WebSocket
- Rich UI components from shadcn/ui
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_db
SESSION_SECRET=your-session-secret
NODE_ENV=development
PORT=5000
Development
# Start development server
npm run dev
# Type checking
npm run check
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
GET /api/outlets- List news outletsGET /api/outlets/:id/articles- Get articles from an outletGET /api/articles/:id- Get article detailsPOST /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
- Submit a pull request
License
Proprietary - All rights reserved
Description
Languages
TypeScript
91.9%
HTML
6.6%
CSS
1.5%