@mars-stack/core
v8.0.4
Published
Core infrastructure for MARS apps -- auth, database, rate limiting, email, logging, and more.
Maintainers
Readme
@mars-stack/core
Core infrastructure for MARS apps -- auth, database, rate limiting, email, logging, and more.
Installation
yarn add @mars-stack/coreWhat's included
- Auth -- Session management (JWE), CSRF protection, password hashing (bcrypt + SHA-256 prehash), input validation
- Database -- Prisma proxy with structured error diagnostics
- Rate limiting -- Upstash Redis with in-memory fallback
- Email -- Provider-agnostic email service (SendGrid, Resend, console)
- Logger -- Structured logging via Pino
- Env -- Zod-based environment validation with human-readable errors
- SEO -- Metadata helpers and JSON-LD generation
- Test utils -- Mock factories, request helpers, render utilities
Usage
import { checkRateLimit, RATE_LIMITS } from '@mars-stack/core/rate-limit';
import { hashPassword, verifyPassword } from '@mars-stack/core/auth/password';
import { apiSchemas } from '@mars-stack/core/auth/validation';License
MIT
