# 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: ```bash git clone cd Websitebuilder ``` 2. Install dependencies: ```bash npm install ``` 3. Set up environment variables: ```bash cp .env.example .env ``` Edit `.env` with your configuration: ```env DATABASE_URL=postgresql://user:password@localhost:5432/moreminimore JWT_SECRET=your-secret-key-here REDIS_URL=redis://localhost:6379 ``` 4. Run database migrations: ```bash npm run db:migrate ``` 5. Start the development server: ```bash 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: ```bash npm test ``` Run tests with UI: ```bash npm run test:ui ``` Run tests with coverage: ```bash npm run test:coverage ``` Check coverage thresholds: ```bash npm run test:coverage:check ``` ### E2E Tests Run E2E tests with Playwright: ```bash npm run test:e2e ``` ## ๐Ÿ—๏ธ Building Build for production: ```bash npm run build ``` Start production server: ```bash 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: ```bash npm run db:generate ``` Apply migrations: ```bash npm run db:migrate ``` Push schema changes (development only): ```bash npm run db:push ``` ### Database Studio Open Drizzle Studio for database management: ```bash 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.