{"id":24321074,"url":"https://github.com/ttibbs/create-mvc-server","last_synced_at":"2026-03-11T03:31:41.299Z","repository":{"id":272080859,"uuid":"915467777","full_name":"TTibbs/create-mvc-server","owner":"TTibbs","description":"A developer friendly CLI tool to quickly scaffold an MVC architecture app, with options for frameworks and database.","archived":false,"fork":false,"pushed_at":"2025-08-25T01:24:37.000Z","size":626,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-27T20:28:29.680Z","etag":null,"topics":["cli","express","filesystem","javascript","scaffolding-tool","typescript"],"latest_commit_sha":null,"homepage":"https://create-mvc-server.vercel.app/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TTibbs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["TTibbs"]}},"created_at":"2025-01-11T23:10:04.000Z","updated_at":"2025-09-30T17:54:45.000Z","dependencies_parsed_at":"2025-01-14T02:31:33.207Z","dependency_job_id":"4d89906f-fcad-49ae-8ea1-b17b6f11a03b","html_url":"https://github.com/TTibbs/create-mvc-server","commit_stats":null,"previous_names":["ttibbs/quick-ex-db","ttibbs/create-mvc-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TTibbs/create-mvc-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTibbs%2Fcreate-mvc-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTibbs%2Fcreate-mvc-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTibbs%2Fcreate-mvc-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTibbs%2Fcreate-mvc-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TTibbs","download_url":"https://codeload.github.com/TTibbs/create-mvc-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TTibbs%2Fcreate-mvc-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30369379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","express","filesystem","javascript","scaffolding-tool","typescript"],"created_at":"2025-01-17T16:31:07.100Z","updated_at":"2026-03-11T03:31:41.282Z","avatar_url":"https://github.com/TTibbs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/TTibbs"],"categories":[],"sub_categories":[],"readme":"## Create MVC Server\n\nWelcome to the Create MVC Server tool! This utility helps you easily scaffold a new MVC server for your project with an interactive setup.\n\n### Available Options\n\nYou can customise your server with the following options:\n\n- **Server Framework**: Choose between Express or Hono (PostgreSQL only).\n- **Database**: Select from PostgreSQL, MongoDB, MySQL, or SQLite.\n- **Language**: Pick either JavaScript or TypeScript.\n\n### How to Use\n\nYou can create your project in two ways:\n\n#### 1. Interactive Mode\n\nThe interactive mode guides you through a series of prompts to configure your project:\n\n```bash\nnpx create-mvc-server my-project\n```\n\nThe process includes:\n\n1. **Project Name**: Enter your project name (defaults to \"mvc-server\" if not specified).\n2. **Configuration Mode**: Choose between individual component selection or a pre-defined template.\n3. **Component Selection** (if choosing individual components):\n   - Select your server framework (Express or Hono).\n   - Choose your database (PostgreSQL, MongoDB, MySQL, or SQLite).\n   - Pick your language (JavaScript or TypeScript).\n4. **Template Selection** (if choosing template mode):\n   - Select from available templates that match your framework, database, and language choices.\n5. **Directory Handling**: Decide what to do if the target directory exists (overwrite, merge, or cancel).\n6. **Package Name Validation**: Verify or modify the package name for npm compatibility.\n7. **Configuration Summary**: Review your selections before proceeding.\n8. **Project Creation**: Files are copied and customised based on your selections.\n\n#### 2. Template Mode\n\nIf you already know which template you want to use, you can skip the interactive prompts by specifying a template directly:\n\n```bash\nnpx create-mvc-server my-project --template \u003ctemplate-name\u003e\n```\n\nThis mode is perfect for:\n\n- Quickly creating projects with the same configuration.\n- Using the tool in scripts or CI/CD pipelines.\n\n#### Command Line Options\n\n```bash\nUsage: create-mvc-server [options] [project-name]\n\nOptions:\n  -t, --template NAME        Specify a template to use.\n  -h, --help                 Display this help message.\n```\n\n### Available Templates\n\nThe CLI dynamically discovers templates from the filesystem. Here are some standard templates you can use:\n\n- `pg-ts`: Express + PostgreSQL + TypeScript\n- `pg`: Express + PostgreSQL + JavaScript\n- `mongo-ts`: Express + MongoDB + TypeScript\n- `mongo`: Express + MongoDB + JavaScript\n- `mysql-ts`: Express + MySQL + TypeScript\n- `mysql`: Express + MySQL + JavaScript\n- `sqlite-ts`: Express + SQLite + TypeScript\n- `sqlite`: Express + SQLite + JavaScript\n- `hono-pg-ts`: Hono + PostgreSQL + TypeScript\n- `hono-pg`: Hono + PostgreSQL + JavaScript\n\n### Features\n\n- Interactive CLI prompts for easy project configuration.\n- Dynamic template discovery from the filesystem.\n- Option to initialise a Git repository.\n- Automatic package name validation.\n- Smart template selection based on your choices.\n- Support for multiple package managers (npm, yarn).\n- Directory conflict resolution.\n- Automatic file renaming (e.g., \\_gitignore → .gitignore).\n\n### Project Structure\n\nThe generated project will include:\n\n- Basic server setup with your chosen framework.\n- Database configuration.\n- Type definitions (for TypeScript projects).\n- Basic routing structure.\n- Error handling middleware.\n- Environment configuration.\n- Testing setup.\n\n### Example Usage\n\n```bash\n# Create a new project with interactive prompts\nnpx create-mvc-server my-server\n\n# Create a new project using a specific template\nnpx create-mvc-server my-server --template pg-ts\n```\n\nAfter creating your project, follow the printed instructions to:\n\n1. Navigate to the project directory.\n2. Install dependencies.\n3. Start the development server.\n\n### Database Setup\n\nDepending on your chosen database, you'll need to set it up accordingly:\n\n#### PostgreSQL\n\n- Install PostgreSQL locally or use a cloud service (e.g., AWS RDS, DigitalOcean).\n- Set up connection details in your `.env` file:\n  ```\n  DATABASE_URL=postgresql://user:password@localhost:5432/dbname\n  ```\n\n#### MongoDB\n\n- Install MongoDB locally or use MongoDB Atlas.\n- Set up connection details in your `.env` file:\n  ```\n  MONGODB_URI=mongodb://localhost:27017/dbname\n  ```\n\n#### MySQL\n\n- Install MySQL locally or use a cloud service.\n- Set up connection details in your `.env` file:\n  ```\n  DATABASE_URL=mysql://user:password@localhost:3306/dbname\n  ```\n\n#### SQLite\n\n- No additional installation required.\n- Set up the database path in your `.env` file:\n  ```\n  DATABASE_URL=file:./dev.db\n  ```\n\n### Deployment\n\nYou can deploy the generated server to various platforms, including:\n\n- **Supabase**: Supports PostgreSQL, MongoDB, MySQL, and SQLite.\n- **Heroku**: Compatible with all database options.\n- **Vercel**: Works well with Serverless deployment (especially Hono).\n- **DigitalOcean**: Supports all database options.\n- **AWS**: Can be deployed to EC2, ECS, or Lambda.\n- **Railway**: Excellent for both application and database hosting.\n\nRemember to:\n\n1. Set up appropriate environment variables.\n2. Configure your database connection string.\n3. Implement proper security measures (e.g., SSL, firewalls).\n\n## How It Works\n\nThe Create MVC Server tool uses a dynamic template discovery system to find and manage available templates:\n\n1. The CLI scans for directories with the naming pattern `template-{id}`.\n2. Template requirements are automatically inferred from the ID based on naming conventions.\n3. Available options (frameworks, databases, languages) are mapped to parts of the template ID.\n4. The CLI provides a fallback to default templates if none are discovered.\n\n### Template Discovery Process\n\n- Template directories must follow the naming pattern: `template-[server]-[database]-[language]`.\n- Some parts can be omitted, and defaults will be used:\n  - If the server is omitted: Express is assumed.\n  - If the language is omitted: JavaScript is assumed.\n  - The database must always be specified.\n\n### Technology Mappings\n\nThe CLI recognises these technology identifiers in template names:\n\n- **Servers**: `express`, `hono`\n- **Databases**: `pg` (PostgreSQL), `mongo` (MongoDB), `mysql` (MySQL), `sqlite` (SQLite)\n- **Languages**: `ts` (TypeScript) - omit for JavaScript\n\n## Contributing\n\nWe welcome contributions to improve Create MVC Server! Here's how you can help:\n\n### Standard Contribution Process\n\n1. **Fork the Repository**: Visit the GitHub repository and click the \"Fork\" button to create a copy in your GitHub account.\n2. **Clone Your Fork**:\n   ```bash\n   git clone https://github.com/your-username/create-mvc-server.git\n   cd create-mvc-server\n   ```\n3. **Install Dependencies**:\n   ```bash\n   npm install\n   ```\n4. **Create a Feature Branch**:\n   ```bash\n   git checkout -b feature/your-feature-name\n   ```\n5. **Make Your Changes**: Implement your features or bug fixes while following the project's code style and conventions.\n6. **Build and Test**:\n   ```bash\n   npm run build\n   # Test your changes thoroughly\n   ```\n7. **Commit Your Changes**:\n   ```bash\n   git commit -m \"Add feature: your feature description\"\n   ```\n8. **Push to Your Fork**:\n   ```bash\n   git push origin feature/your-feature-name\n   ```\n9. **Create a Pull Request**: Go to the original repository, click \"New Pull Request,\" select \"compare across forks,\" and describe your changes in detail.\n10. **Wait for Review**: Maintainers will review your PR. Address any requested changes, and once approved, your PR will be merged.\n\n### Adding New Templates\n\nYou can contribute by creating new templates. Here's how:\n\n1. Create a new directory in the project using the naming convention: `template-[server]-[database]-[language]`.\n2. Structure your template following existing templates as a guide.\n3. Ensure your template includes:\n   - A complete server setup with the specified framework.\n   - Database configuration for the specified database.\n   - Standard MVC architecture (models, views, controllers).\n   - A `package.json` file with appropriate dependencies.\n   - Any special files like `_gitignore` (which will be renamed to `.gitignore`).\n\n### Template Creation Guidelines\n\nFor the best compatibility:\n\n1. Use consistent folder structures across templates.\n2. Include clear documentation within the template.\n3. Add appropriate TypeScript types (for TypeScript templates).\n4. Include basic security measures (e.g., helmet for Express).\n5. Add sensible defaults for configuration.\n6. Ensure all environment variables are properly documented.\n7. Include example routes and controllers.\n\n### Testing New Templates\n\nAfter creating a new template:\n\n1. Build the project with `npm run build`.\n2. Test your template with:\n   ```bash\n   node packages/create-mvc/index.js my-test-project --template your-template-id\n   ```\n3. Validate that the generated project works as expected.\n\n### Reporting Issues\n\nIf you find a bug or have a feature request:\n\n1. Check if the issue already exists in the GitHub issues.\n2. If not, create a new issue with a descriptive title.\n3. Include detailed steps to reproduce the bug or a clear description of the feature.\n4. Provide relevant information like your operating system, Node.js version, etc.\n\nWe appreciate your contributions to making Create MVC Server better!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttibbs%2Fcreate-mvc-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttibbs%2Fcreate-mvc-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttibbs%2Fcreate-mvc-server/lists"}