diff --git a/.cursor/rules/01-project-overview.mdc b/.cursor/rules/01-project-overview.mdc new file mode 100644 index 000000000..35f4e3446 --- /dev/null +++ b/.cursor/rules/01-project-overview.mdc @@ -0,0 +1,30 @@ +--- +description: +globs: +alwaysApply: false +--- +# Lilishop Project Overview + +This is a comprehensive B2B2C e-commerce system built with Spring Boot (backend) and Vue/uniapp (frontend). The project supports multi-tenant merchant access and distributed deployment. + +## Key Project Components + +### Backend APIs +- [buyer-api/](mdc:buyer-api) - Buyer-facing APIs for shopping functionality +- [seller-api/](mdc:seller-api) - Merchant-facing APIs for store management +- [manager-api/](mdc:manager-api) - Platform admin APIs +- [common-api/](mdc:common-api) - Shared API components +- [im-api/](mdc:im-api) - Instant messaging APIs + +### Core Components +- [framework/](mdc:framework) - Core framework and shared utilities +- [consumer/](mdc:consumer) - Message queue consumers +- [config/](mdc:config) - System configuration files + +### Documentation +- [docs/](mdc:docs) - Project documentation +- [README.md](mdc:README.md) - Project overview and setup instructions + +### Build & Deployment +- [pom.xml](mdc:pom.xml) - Maven project configuration +- [deploy-api.yml](mdc:deploy-api.yml) - Deployment configuration diff --git a/.cursor/rules/02-technical-architecture.mdc b/.cursor/rules/02-technical-architecture.mdc new file mode 100644 index 000000000..161fcc4d6 --- /dev/null +++ b/.cursor/rules/02-technical-architecture.mdc @@ -0,0 +1,38 @@ +--- +description: +globs: +alwaysApply: false +--- +# Technical Architecture + +## Backend Stack +- Spring Boot - Core framework +- Spring MVC - Web framework +- Mybatis-Plus - ORM framework +- Spring Security - Security framework +- JWT - Authentication +- RocketMQ - Message queue +- Redis & MongoDB - Caching +- Elasticsearch - Search engine +- MySQL - Primary database +- Sharding - Database sharding +- XXL-Job - Distributed scheduling + +## Frontend Stack +### Admin & Seller Portals ([admin/](mdc:admin)) +- Vue.js - Frontend framework +- iView - UI components +- Vuex - State management +- Vue Router - Routing +- Axios - HTTP client + +### Mobile Applications +- Uni-app - Cross-platform framework +- uViewui - UI components +- SCSS - Styling + +## Infrastructure +- Nginx - Load balancing & reverse proxy +- Aliyun OSS - Object storage +- Docker - Containerization +- Docker Compose - Container orchestration diff --git a/.cursor/rules/03-development-guidelines.mdc b/.cursor/rules/03-development-guidelines.mdc new file mode 100644 index 000000000..7c97da161 --- /dev/null +++ b/.cursor/rules/03-development-guidelines.mdc @@ -0,0 +1,43 @@ +--- +description: +globs: +alwaysApply: false +--- +# Development Guidelines + +## Project Setup +1. Ensure you have the following prerequisites: + - JDK 1.8+ + - Maven 3.x + - MySQL 5.7+ + - Redis + - RocketMQ + - Elasticsearch + - Node.js 12+ + +## Database Setup +- Initial database scripts can be found in [DB/](mdc:DB) +- For Docker deployment, refer to docker-compose configuration + +## API Development Guidelines +1. All new APIs should be placed in appropriate modules: + - Customer-facing APIs in [buyer-api/](mdc:buyer-api) + - Merchant APIs in [seller-api/](mdc:seller-api) + - Admin APIs in [manager-api/](mdc:manager-api) + - Shared components in [common-api/](mdc:common-api) + +2. Follow RESTful API conventions: + - Use appropriate HTTP methods (GET, POST, PUT, DELETE) + - Use consistent URL patterns + - Implement proper error handling + +## Security Guidelines +1. All sensitive operations must be authenticated +2. Use Spring Security for access control +3. Store sensitive configuration in environment variables +4. Never commit sensitive credentials to version control + +## Testing +1. Write unit tests for critical business logic +2. Ensure API endpoints are properly documented +3. Test both success and error scenarios diff --git a/.cursor/rules/04-deployment-guide.mdc b/.cursor/rules/04-deployment-guide.mdc new file mode 100644 index 000000000..56a9ed4c6 --- /dev/null +++ b/.cursor/rules/04-deployment-guide.mdc @@ -0,0 +1,37 @@ +--- +description: +globs: +alwaysApply: false +--- +# Deployment Guide + +## Local Development Setup +1. Clone the repository +2. Import as Maven project +3. Configure environment variables in [config/](mdc:config) +4. Start required services (MySQL, Redis, RocketMQ, Elasticsearch) +5. Run individual API modules + +## Docker Deployment +- Use [deploy-api.yml](mdc:deploy-api.yml) for container configuration +- Execute [docker-image.sh](mdc:docker-image.sh) to build images + +## Production Deployment +1. Configure load balancer (Nginx recommended) +2. Set up database replication/clustering +3. Configure message queue clusters +4. Set up monitoring and logging +5. Configure CDN for static assets + +## Configuration Files +- Database: [DB/](mdc:DB) +- API deployment: [deploy-api.yml](mdc:deploy-api.yml) +- Docker scripts: [docker-image.sh](mdc:docker-image.sh) + +## Deployment Checklist +1. Database migration and backup +2. Environment variable configuration +3. Service dependencies verification +4. SSL certificate setup +5. Monitoring and alerting setup +6. Backup and recovery procedures