modernize project with Docker support and dependency updates

- Pin all dependencies to stable versions (remove 'latest')
- Update lucide-react to 0.554.0 for React 19 compatibility
- Add Docker support with Dockerfile and docker-compose.yml
- Update TypeScript target to ES2022
- Add .nvmrc and netlify.toml for deployment configuration
- Update README with Docker deployment instructions
This commit is contained in:
kilyabin
2025-11-18 03:33:08 +04:00
parent 5feff78420
commit 82c22c54d3
10 changed files with 303 additions and 32 deletions

View File

@@ -10,14 +10,88 @@ Reskin of https://lk.ks.psuti.ru/ since it lacks mobile support.
## Tech stack & features
- React with Next.js v13.5 (pages router)
- Tailwind CSS.
- React 19.2.0 with Next.js 16.0.3 (pages router)
- Tailwind CSS
- @shadcn/ui components (built with Radix UI)
- JSDOM for parsing scraped pages, rehydration strategy for cache
- TypeScript with types for each package
- TypeScript 5.6.0 with types for each package
- Telegram Bot API (via [node-telegram-bot-api]) for parsing failure notifications
- Custom [js parser for teachers' photos](https://gist.github.com/VityaSchel/28f1a360ee7798511765910b39c6086c)
- Accessability & tab navigation support
- Dark theme with automatic switching based on system settings
Tools used: pnpm, eslint, react-icons. Deployed with Netlify and supported by Cloudflare.
## Development
### Prerequisites
- Node.js 20+ (see `.nvmrc`)
- npm 10+ or pnpm
### Local development
```bash
# Install dependencies
npm install
# or
pnpm install
# Run development server
npm run dev
# or
pnpm dev
```
### Docker deployment
#### Build and run with Docker
```bash
# Build the image
docker build -t kspguti-schedule .
# Run the container
docker run -p 3000:3000 kspguti-schedule
```
#### Using Docker Compose
```bash
# Build and start
docker-compose up -d
# View logs
docker-compose logs -f
# Stop
docker-compose down
```
**Environment variables:** Edit `docker-compose.yml` to add your environment variables:
- `PROXY_URL` - URL for schedule parsing
- `PARSING_FAILURE_NOTIFICATIONS_TELEGRAM_BOTAPI_TOKEN` - Telegram bot token
- `PARSING_FAILURE_NOTIFICATIONS_TELEGRAM_CHAT_ID` - Telegram chat ID
### Production deployment
#### Netlify
The project includes `netlify.toml` for automatic deployment configuration.
#### Docker
The Dockerfile uses Next.js standalone output for optimized production builds. The image includes:
- Multi-stage build for smaller image size
- Non-root user for security
- Health checks
- Production optimizations
#### Other platforms
The project can be deployed to any platform supporting Node.js 20+:
- Vercel
- Railway
- DigitalOcean App Platform
- AWS App Runner
- Any Docker-compatible platform