Skip to content

AnsiPress/AnsiPress.com

Repository files navigation

AnsiPress.com

Ansible-powered hosting automation with ZFS snapshots, backups, and one-command deployments.

👉 Get started: AnsiPress.com

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • A Neon database account (free tier available)
  • A Resend account for emails (free tier available)

Installation

  1. Clone the repository:
git clone https://github.com/AnsiPress/AnsiPress.com.git
cd AnsiPress.com
  1. Install dependencies:
npm install
  1. Set up environment variables:
cp .env.example .env.local

Edit .env.local and add your configuration:

  • DATABASE_URL: Get from Neon dashboard
  • RESEND_API_KEY: Get from Resend
  • ADMIN_PASSWORD: Use bcrypt generator to hash your password
  • ADMIN_API_KEY: Generate with openssl rand -hex 32
  • ADMIN_COOKIE_SECRET: Generate with openssl rand -hex 32

Database Setup

  1. Generate database migrations:
npm run db:generate
  1. Push migrations to database:
npm run db:push
  1. (Optional) Seed the database with test data:
npm run db:seed
  1. (Optional) Open Drizzle Studio to view your database:
npm run db:studio

Running the Development Server

npm run dev

Open http://localhost:3000 with your browser to see the result.

Project Structure

.
├── drizzle.config.ts     # Drizzle configuration
├── next.config.ts        # Next.js configuration
├── sentry.edge.config.ts # Sentry Edge config
├── sentry.server.config.ts # Sentry Server config
├── tailwind.config.ts    # Tailwind CSS configuration
└── src/
    ├── app/
    │   ├── (auth)/           # Authentication routes
    │   ├── (dash)/           # Dashboard routes (Phase 2)
    │   ├── (www)/            # Marketing site routes
    │   └── api/              # API routes
    ├── components/           # React components
    │   ├── admin/            # Admin dashboard components
    │   └── ui/               # UI components (BrandLogo, etc.)
    ├── lib/
    │   ├── db/               # Database schema and client
    │   ├── email/            # Email templates and service
    │   ├── auth.ts           # Authentication utilities
    │   └── rate-limit.ts     # Rate limiting
    ├── instrumentation.ts    # OpenTelemetry/Sentry instrumentation
    └── instrumentation-client.ts

Features

Waitlist System

  • Email collection with UTM tracking
  • Email verification flow
  • Unsubscribe functionality
  • Rate limiting to prevent spam

Email Service

  • Welcome emails with verification links
  • Admin notifications for new signups
  • Weekly update emails (automated)

Security

  • Password-protected admin access
  • API key authentication for admin routes
  • Rate limiting (5 signups per IP per hour)
  • Input validation with Zod
  • CSRF protection

Database Scripts

  • npm run db:generate - Generate migrations from schema changes
  • npm run db:push - Push migrations to database
  • npm run db:studio - Open Drizzle Studio
  • npm run db:seed - Seed database with test data

Database Schema

  • waitlist - User waitlist entries
  • email_logs - Email sending logs
  • enterprise_contacts - Enterprise contact form submissions

After modifying schema run:

npm run db:generate
npm run db:push

API Endpoints

Public Endpoints

  • POST /api/waitlist - Join waitlist
  • GET /api/waitlist?email={email} - Check subscription status
  • POST /api/verify - Verify email address
  • POST /api/unsubscribe - Unsubscribe from waitlist
  • POST /api/contact - Submit enterprise contact request

Admin Endpoints (require API key)

  • GET /api/admin/waitlist - List all waitlist entries
  • PATCH /api/admin/waitlist/[id] - Update waitlist entry
  • DELETE /api/admin/waitlist/[id] - Delete waitlist entry
  • GET /api/admin/email-logs - View email history
  • GET /api/admin/stats - Get dashboard statistics

Admin Pages

  • /admin - Dashboard (Coming Soon)
  • /admin/waitlist - Waitlist management (Internal)

Deployment

See DEPLOYMENT.md for detailed deployment instructions.

Learn More

To learn more about the technologies used:

License

MIT

About

AnsiPress - Automate your Infrastructure via Ansible

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages