☰
DMCall
slpx2
Edit Rule
Cancel
Title *
Slug
Publicly accessible (AI models can read without auth)
Content (Markdown)
# Project Initialization Rules ## Directory Structure All projects live under `/var/www/mssql.danmarcrm.com/` (web-accessible) or `/dev1/` (development). ### Standard project layout: ``` project-name/ ├── public/ # Web-accessible entry points │ ├── index.php # Front controller / dashboard │ ├── api.php # API endpoint │ └── assets/ # CSS, JS, images ├── src/ # PHP classes (PSR-4 autoload) ├── config/ │ └── config.php # All configuration in one file ├── vendor/ # Composer dependencies ├── logs/ # Application logs (gitignored) ├── composer.json └── PROJECT_OVERVIEW.md # Required: project description for AI context ``` ## First Steps for a New Project 1. Create the directory under the appropriate parent 2. Initialize `composer.json` with `php >=7.4` and `mongodb/mongodb ^1.19` 3. Create `config/config.php` with DB credentials and app settings 4. Create `PROJECT_OVERVIEW.md` documenting what the project does 5. Register the project in DMCall: `POST /api/projects` with access methods, tech stack, databases 6. Set up error logging to `logs/` directory ## Configuration Pattern All projects use PHP `define()` constants in `config/config.php`: ```php define('DB_HOST', 'localhost'); define('MONGODB_HOST', '127.0.0.1'); define('MONGODB_PORT', 27017); define('MONGODB_NAME', 'project_name'); define('APP_URL', 'https://mssql.danmarcrm.com/...'); date_default_timezone_set('Europe/Bucharest'); ``` ## Database Setup - **MongoDB** is the primary database for new projects - Database name should match the project slug - Use `mongodb/mongodb` PHP driver (already on server) - MySQL available if relational queries are needed - Both MongoDB and MySQL run on localhost, no auth required ## Registering with DMCall After creating the project, register it in the central hub: ```bash curl -X POST https://mssql.danmarcrm.com/dev1/dmcall/public/api/projects \ -H "X-API-Key: YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Project Name", "slug": "project-slug", "description": "What this project does", "status": "development", "access": [ {"type": "web", "value": "https://...", "server_path": "/var/www/..."} ], "tech_stack": ["PHP", "MongoDB"], "databases": [{"type": "mongodb", "name": "db_name", "host": "127.0.0.1"}] }' ```
Update Rule
Cancel