Files
websitebuilder/README.md
Kunthawat Greethong 4d1bb6892b
Some checks failed
CI / build (push) Has been cancelled
CI / test (push) Has been cancelled
CI / e2e (push) Has been cancelled
CI / lint (push) Has been cancelled
Add websitebuilder app
2026-01-26 12:50:12 +07:00

4.8 KiB

MoreMinimore SAAS

A modern AI-powered web application development platform built with Next.js 16, TypeScript, and PostgreSQL.

🚀 Getting Started

Prerequisites

  • Node.js 20 or higher
  • PostgreSQL 14 or higher
  • Redis (optional, for caching)

Installation

  1. Clone the repository:
git clone <repository-url>
cd Websitebuilder
  1. Install dependencies:
npm install
  1. Set up environment variables:
cp .env.example .env

Edit .env with your configuration:

DATABASE_URL=postgresql://user:password@localhost:5432/moreminimore
JWT_SECRET=your-secret-key-here
REDIS_URL=redis://localhost:6379
  1. Run database migrations:
npm run db:migrate
  1. Start the development server:
npm run dev

The application will be available at http://localhost:3000.

📁 Project Structure

src/
├── app/                    # Next.js App Router pages
│   ├── api/                 # API routes
│   │   ├── auth/             # Authentication endpoints
│   │   └── users/            # User management endpoints
│   ├── dashboard/           # Dashboard pages
│   └── admin/               # Admin pages
├── components/             # React components
│   ├── auth/               # Authentication components
│   ├── admin/               # Admin components
│   └── ui/                 # shadcn/ui components
├── lib/                    # Utility libraries
│   ├── auth/                # Authentication utilities
│   ├── db/                  # Database configuration
│   └── utils.ts             # Utility functions
└── services/               # Business logic services
    ├── auth.service.ts      # Authentication service
    └── user.service.ts      # User management service

🧪 Testing

Unit Tests

Run unit tests with Vitest:

npm test

Run tests with UI:

npm run test:ui

Run tests with coverage:

npm run test:coverage

Check coverage thresholds:

npm run test:coverage:check

E2E Tests

Run E2E tests with Playwright:

npm run test:e2e

🏗️ Building

Build for production:

npm run build

Start production server:

npm run start

📊 Coverage

We maintain high test coverage to ensure code quality:

  • Critical: Business logic, data transformations (100%)
  • High: Public APIs, user-facing features (90%+)
  • Medium: Utilities, helpers (80%+)

Coverage reports are generated in the coverage/ directory.

🔄 CI/CD

The project uses GitHub Actions for continuous integration and deployment:

Workflow Triggers

  • Push to main or develop branches
  • Pull requests to main or develop branches

CI Pipeline Stages

  1. Build: Validates Next.js build
  2. Unit Tests: Runs Vitest unit tests with coverage
  3. E2E Tests: Runs Playwright tests
  4. Lint: Runs ESLint
  5. Type Check: Runs TypeScript type checking

Coverage Enforcement

The CI pipeline enforces coverage thresholds:

  • Lines: 80%
  • Functions: 80%
  • Branches: 80%
  • Statements: 80%

Builds will fail if:

  • Tests fail
  • Coverage falls below thresholds
  • Linting errors
  • TypeScript errors

Coverage Reports

Coverage reports are uploaded to Codecov for tracking and visualization.

🗄️ Database

Running Migrations

Generate migration files:

npm run db:generate

Apply migrations:

npm run db:migrate

Push schema changes (development only):

npm run db:push

Database Studio

Open Drizzle Studio for database management:

npm run db:studio

📝 Development

Code Style

  • Use TypeScript for type safety
  • Follow the code standards in /Users/kunthawatgreet/.config/opencode/context/core/standards/code-quality.md
  • Follow the testing standards in /Users/kunthawatgreet/.config/opencode/context/core/standards/test-coverage.md

Commit Convention

Follow conventional commits:

  • feat: - New features
  • fix: - Bug fixes
  • docs: - Documentation changes
  • test: - Test changes
  • refactor: - Code refactoring
  • chore: - Maintenance tasks

Branching Strategy

  • main - Production branch
  • develop - Development branch
  • Feature branches from develop

🚢 Deployment

The application is designed to be deployed to Vercel, AWS, or any Node.js hosting platform.

Environment Variables

Required environment variables:

  • DATABASE_URL - PostgreSQL connection string
  • JWT_SECRET - Secret for JWT tokens
  • REDIS_URL - Redis connection string (optional)

📄 License

[Your License Here]

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and ensure they pass
  5. Submit a pull request

📞 Support

For support, please open an issue in the repository.