Add websitebuilder app
This commit is contained in:
241
README.md
241
README.md
@@ -1,36 +1,235 @@
|
||||
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
||||
# MoreMinimore SAAS
|
||||
|
||||
## Getting Started
|
||||
A modern AI-powered web application development platform built with Next.js 16, TypeScript, and PostgreSQL.
|
||||
|
||||
First, run the development server:
|
||||
## 🚀 Getting Started
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Node.js 20 or higher
|
||||
- PostgreSQL 14 or higher
|
||||
- Redis (optional, for caching)
|
||||
|
||||
### Installation
|
||||
|
||||
1. Clone the repository:
|
||||
```bash
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
bun dev
|
||||
git clone <repository-url>
|
||||
cd Websitebuilder
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
2. Install dependencies:
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
||||
3. Set up environment variables:
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
||||
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
|
||||
```
|
||||
|
||||
## Learn More
|
||||
4. Run database migrations:
|
||||
```bash
|
||||
npm run db:migrate
|
||||
```
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
5. Start the development server:
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
The application will be available at `http://localhost:3000`.
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
||||
## 📁 Project Structure
|
||||
|
||||
## Deploy on Vercel
|
||||
```
|
||||
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
|
||||
```
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
## 🧪 Testing
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
||||
### 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.
|
||||
|
||||
Reference in New Issue
Block a user