From 7c893dac8a53c29eb0d42653320e26bde4dac215 Mon Sep 17 00:00:00 2001 From: jungwoo choi Date: Thu, 23 Oct 2025 14:50:07 +0900 Subject: [PATCH] docs: Add comprehensive README for SAPIENS Web MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- README.md | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8d01db9 --- /dev/null +++ b/README.md @@ -0,0 +1,131 @@ +# 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 + +```bash +# Install dependencies +npm install + +# Set up database +npm run db:push +``` + +### Environment Variables + +Create a `.env` file: + +```env +DATABASE_URL=postgresql://user:password@localhost:5432/sapiens_db +SESSION_SECRET=your-session-secret +NODE_ENV=development +PORT=5000 +``` + +### Development + +```bash +# Start development server +npm run dev + +# Type checking +npm run check +``` + +### Production Build + +```bash +# Build the application +npm run build + +# Start production server +npm start +``` + +## Database Management + +```bash +# 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 outlets +- `GET /api/outlets/:id/articles` - Get articles from an outlet +- `GET /api/articles/:id` - Get article details +- `POST /api/auth/login` - User login +- `POST /api/auth/register` - User registration + +## Contributing + +1. Create a feature branch +2. Make your changes +3. Run type checking with `npm run check` +4. Test your changes +5. Submit a pull request + +## License + +Proprietary - All rights reserved