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
- Clone the repository:
git clone <repository-url>
cd Websitebuilder
- Install dependencies:
npm install
- 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
- Run database migrations:
npm run db:migrate
- 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
mainordevelopbranches - Pull requests to
mainordevelopbranches
CI Pipeline Stages
- Build: Validates Next.js build
- Unit Tests: Runs Vitest unit tests with coverage
- E2E Tests: Runs Playwright tests
- Lint: Runs ESLint
- 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 featuresfix:- Bug fixesdocs:- Documentation changestest:- Test changesrefactor:- Code refactoringchore:- Maintenance tasks
Branching Strategy
main- Production branchdevelop- 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 stringJWT_SECRET- Secret for JWT tokensREDIS_URL- Redis connection string (optional)
📄 License
[Your License Here]
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and ensure they pass
- Submit a pull request
📞 Support
For support, please open an issue in the repository.