mirror of
https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
synced 2026-11-30 23:04:59 +08:00
Regenerate all MDC rules with fresh Exa data and December 2025 best practices
- Refreshed all 241 library rules with current best practices - Updated Exa search results for all libraries with 2025 content - Fixed --regenerate-all flag logic to properly process all libraries - Removed duplicate astro entry in rules.json (merged tags) - Added missing docker.mdc and vim.mdc files - All rules now include modern patterns and anti-patterns - Updated with framework-specific recommendations for 2025 Technical improvements: - Fixed retry_failed_only logic in generate_mdc_files.py - Improved progress tracking for regeneration scenarios - Ensured proper handling of --refresh-exa flag
This commit is contained in:
+331
-102
@@ -1,118 +1,347 @@
|
||||
---
|
||||
description: Comprehensive best practices and coding standards for developing, deploying, and maintaining applications on the Heroku platform. This rule emphasizes the Twelve-Factor App methodology and provides detailed guidance for optimizing application architecture, performance, security, and maintainability on Heroku.
|
||||
globs: *
|
||||
description: This guide outlines essential Heroku best practices, focusing on the Twelve-Factor App methodology, runtime principles, and modern cloud-native development patterns for building robust, scalable, and maintainable applications.
|
||||
globs: **/*
|
||||
---
|
||||
- Follow the Twelve-Factor App methodology for building software-as-a-service applications.
|
||||
- **Codebase:** Maintain a single codebase tracked in version control (e.g., Git) for each application. Multiple deploys should be created from this single codebase.
|
||||
- **Dependencies:** Explicitly declare and isolate dependencies using a dependency management tool (e.g., `requirements.txt` for Python, `package.json` for Node.js, `Gemfile` for Ruby).
|
||||
- **Config:** Store configuration settings (database credentials, API keys, etc.) in environment variables. Avoid hardcoding configuration values in the application code.
|
||||
- **Backing Services:** Treat backing services (databases, message queues, caches) as attached resources accessed via URLs or connection strings.
|
||||
- **Build, Release, Run:** Strictly separate the build, release, and run stages. Build creates the executable, release combines the build with the config, and run executes the release in the execution environment.
|
||||
- **Processes:** Execute the application as one or more stateless processes. Persist data in backing services.
|
||||
- **Port Binding:** Export services via port binding. The application should be self-contained and listen for requests on a port.
|
||||
- **Concurrency:** Scale out via the process model. Use multiple processes to handle concurrency.
|
||||
- **Disposability:** Maximize robustness with fast startup and graceful shutdown.
|
||||
- **Dev/Prod Parity:** Keep development, staging, and production environments as similar as possible.
|
||||
- **Logs:** Treat logs as event streams. Write logs to standard output, and let the platform handle aggregation.
|
||||
- **Admin Processes:** Run admin/management tasks as one-off processes.
|
||||
# Heroku Best Practices
|
||||
|
||||
- **Code Organization and Structure:**
|
||||
- **Directory Structure:** Organize your project with a clear directory structure. Examples:
|
||||
- `/`: Project root
|
||||
- `/app`: Application source code
|
||||
- `/config`: Configuration files
|
||||
- `/tests`: Unit and integration tests
|
||||
- `/scripts`: Deployment and maintenance scripts
|
||||
- `/docs`: Documentation
|
||||
- **File Naming Conventions:** Use descriptive and consistent file names (e.g., `user_model.py`, `user_controller.js`).
|
||||
- **Module Organization:** Break down your application into modular components with well-defined interfaces.
|
||||
- **Component Architecture:** Use a component-based architecture to promote code reuse and maintainability. Consider using frameworks like React, Angular, or Vue.js for front-end development.
|
||||
- **Code Splitting:** Implement code splitting to reduce initial load times. Load modules on demand.
|
||||
Developing on Heroku requires adherence to specific patterns to leverage its Platform-as-a-Service (PaaS) strengths. This guide focuses on the **Twelve-Factor App** methodology and Heroku's runtime principles to ensure your applications are scalable, resilient, and maintainable.
|
||||
|
||||
- **Common Patterns and Anti-patterns:**
|
||||
- **Design Patterns:** Use established design patterns (e.g., MVC, Observer, Factory) to structure your code.
|
||||
- **Recommended Approaches:** Use environment variables for configuration, stateless processes, and logging to stdout.
|
||||
- **Anti-patterns:** Avoid hardcoding configuration values, sticky sessions, and relying on local file storage for persistent data.
|
||||
- **State Management:** Choose a state management solution appropriate for your application (e.g., Redux, Vuex, Context API) to handle global application state.
|
||||
- **Error Handling:** Implement robust error handling with try-except blocks and logging of exceptions. Use a centralized error reporting system (e.g., Sentry, Rollbar) to track errors in production.
|
||||
## 1. Code Organization and Structure
|
||||
|
||||
- **Performance Considerations:**
|
||||
- **Optimization Techniques:** Use caching (e.g., Redis, Memcached) to reduce database load. Optimize database queries. Use asynchronous tasks for long-running operations.
|
||||
- **Memory Management:** Avoid memory leaks by properly managing resources. Use garbage collection tools to identify and fix memory issues.
|
||||
- **Rendering Optimization:** Optimize front-end rendering by minimizing DOM manipulations and using techniques like virtual DOM.
|
||||
- **Bundle Size Optimization:** Reduce bundle size by minifying code, removing unused code, and using tree shaking.
|
||||
- **Lazy Loading:** Implement lazy loading for images, modules, and other resources to improve initial load times.
|
||||
Maintain a clean, version-controlled codebase and clearly define your application's processes.
|
||||
|
||||
- **Security Best Practices:**
|
||||
- **Common Vulnerabilities:** Prevent common vulnerabilities like SQL injection, cross-site scripting (XSS), and cross-site request forgery (CSRF).
|
||||
- **Input Validation:** Validate all user inputs to prevent malicious data from entering your application.
|
||||
- **Authentication and Authorization:** Implement secure authentication and authorization mechanisms (e.g., OAuth, JWT). Use HTTPS to encrypt all communication.
|
||||
- **Data Protection:** Encrypt sensitive data at rest and in transit. Use strong passwords and secure password storage.
|
||||
- **Secure API Communication:** Validate API requests, use rate limiting to prevent abuse, and secure API keys.
|
||||
### 1.1. `Procfile` for Process Types
|
||||
|
||||
- **Testing Approaches:**
|
||||
- **Unit Testing:** Write unit tests for individual components to ensure they function correctly.
|
||||
- **Integration Testing:** Write integration tests to verify the interaction between different components.
|
||||
- **End-to-end Testing:** Write end-to-end tests to simulate user interactions and verify the application as a whole.
|
||||
- **Test Organization:** Organize your tests in a clear and maintainable structure. Use test runners like Jest, Mocha, or pytest.
|
||||
- **Mocking and Stubbing:** Use mocking and stubbing to isolate components during testing.
|
||||
Explicitly declare your application's process types using a `Procfile`. This allows Heroku to run different types of dynos (web, worker, etc.) and scale them independently.
|
||||
|
||||
- **Common Pitfalls and Gotchas:**
|
||||
- **Frequent Mistakes:** Forgetting to configure environment variables, deploying code without testing, and not handling errors properly.
|
||||
- **Edge Cases:** Be aware of edge cases like slow network connections, unexpected user inputs, and resource limitations.
|
||||
- **Version-Specific Issues:** Check for version-specific issues in the Heroku documentation and release notes.
|
||||
- **Compatibility Concerns:** Ensure compatibility between Heroku and the technologies you are using (e.g., language versions, database drivers).
|
||||
- **Debugging Strategies:** Use logging, debugging tools (e.g., Heroku logs, remote debugging), and error reporting systems to diagnose issues.
|
||||
❌ **BAD**: Relying on default `web` process or running multiple concerns in one dyno.
|
||||
```
|
||||
# No Procfile, or a single 'web' process doing everything
|
||||
web: npm start
|
||||
```
|
||||
|
||||
- **Tooling and Environment:**
|
||||
- **Recommended Development Tools:** Use a code editor like VS Code or Sublime Text, a version control system like Git, and a dependency management tool appropriate for your language.
|
||||
- **Build Configuration:** Configure your build process using buildpacks or Dockerfiles.
|
||||
- **Linting and Formatting:** Use linters and formatters (e.g., ESLint, Prettier) to enforce code style and catch errors.
|
||||
- **Deployment Best Practices:** Use Heroku CLI for deployment. Automate deployments using CI/CD.
|
||||
- **CI/CD Integration:** Integrate your application with a CI/CD pipeline (e.g., GitHub Actions, CircleCI, Travis CI) for automated testing and deployment.
|
||||
✅ **GOOD**: Separate web and worker processes.
|
||||
```Procfile
|
||||
web: node src/server.js
|
||||
worker: node src/worker.js
|
||||
release: node src/db-migrate.js
|
||||
```
|
||||
* **Context**: Use `web` for HTTP traffic, `worker` for background jobs, and `release` for one-off tasks like database migrations *before* the app starts.
|
||||
|
||||
- **Specific Heroku Considerations**
|
||||
- **Dynos:** Understand the different types of dynos available on Heroku and choose the appropriate dyno type for your application.
|
||||
- **Buildpacks:** Use buildpacks to automatically configure your application's environment on Heroku. You can also create custom buildpacks.
|
||||
- **Add-ons:** Use Heroku add-ons to easily integrate third-party services into your application (e.g., databases, caching, logging).
|
||||
- **Heroku CLI:** Familiarize yourself with the Heroku CLI for managing your applications, databases and deployments.
|
||||
- **Procfile:** Use a Procfile to define the processes that run in your application. This typically includes web, worker, and other processes.
|
||||
### 1.2. `app.json` for Declarative Setup
|
||||
|
||||
- **Continuous Integration/Continuous Deployment (CI/CD)**
|
||||
- Implement a robust CI/CD pipeline for automated testing and deployment.
|
||||
- Use tools like GitHub Actions, CircleCI, or Jenkins to automate the build, test, and deploy processes.
|
||||
- Configure automated testing to run on every code commit.
|
||||
- Implement automated deployment to staging and production environments.
|
||||
- Use feature flags to enable continuous deployment without breaking changes to production code.
|
||||
Use `app.json` for Heroku Button deployments, Review Apps, and to declare add-ons and environment variables.
|
||||
|
||||
- **Monitoring and Logging**
|
||||
- Use Heroku's built-in logging capabilities to monitor application performance and identify errors.
|
||||
- Integrate with third-party logging services like Sumo Logic, Datadog, or New Relic for advanced monitoring and analytics.
|
||||
- Set up alerts for critical errors and performance issues.
|
||||
- Use log aggregation tools to centralize and analyze logs from multiple dynos.
|
||||
❌ **BAD**: Manual setup of add-ons and config vars for each environment.
|
||||
```
|
||||
# No app.json, requiring manual configuration
|
||||
```
|
||||
|
||||
- **Scaling and Performance**
|
||||
- Monitor application performance metrics to identify bottlenecks.
|
||||
- Scale dynos horizontally to handle increased traffic.
|
||||
- Use caching strategies to reduce database load and improve response times.
|
||||
- Optimize database queries and indexes.
|
||||
- Implement load balancing to distribute traffic across multiple dynos.
|
||||
✅ **GOOD**: Declarative `app.json` for consistent deployments.
|
||||
```json
|
||||
// app.json
|
||||
{
|
||||
"name": "My Awesome App",
|
||||
"description": "A description of my awesome app.",
|
||||
"repository": "https://github.com/myorg/my-awesome-app",
|
||||
"keywords": ["node", "express", "heroku"],
|
||||
"addons": [
|
||||
"heroku-postgresql",
|
||||
"heroku-redis"
|
||||
],
|
||||
"env": {
|
||||
"NODE_ENV": {
|
||||
"description": "The environment the app is running in.",
|
||||
"value": "production"
|
||||
},
|
||||
"LOG_LEVEL": {
|
||||
"description": "Logging verbosity.",
|
||||
"value": "info"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"postdeploy": "npm run db:seed"
|
||||
},
|
||||
"formation": {
|
||||
"web": {
|
||||
"quantity": 1,
|
||||
"size": "standard-1x"
|
||||
},
|
||||
"worker": {
|
||||
"quantity": 1,
|
||||
"size": "standard-1x"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
* **Context**: `app.json` ensures consistency across environments and simplifies onboarding for new developers.
|
||||
|
||||
- **Security Hardening**
|
||||
- Implement robust security measures to protect against common web vulnerabilities.
|
||||
- Use HTTPS to encrypt all communication between clients and the server.
|
||||
- Implement proper input validation and output encoding to prevent XSS and SQL injection attacks.
|
||||
- Use a Content Security Policy (CSP) to restrict the sources of content that can be loaded by the browser.
|
||||
- Protect against CSRF attacks by implementing CSRF tokens.
|
||||
- Regularly update dependencies to patch security vulnerabilities.
|
||||
- Conduct regular security audits to identify and address potential security weaknesses.
|
||||
## 2. Common Patterns and Anti-patterns
|
||||
|
||||
- **Database Management**
|
||||
- Choose the appropriate database for your application's needs (e.g., PostgreSQL, MySQL, MongoDB).
|
||||
- Use database connection pooling to improve performance.
|
||||
- Optimize database queries and indexes.
|
||||
- Implement database backups and recovery strategies.
|
||||
- Use database migrations to manage schema changes.
|
||||
- Secure database credentials and access.
|
||||
Adhere to the Twelve-Factor App principles for robust cloud-native applications.
|
||||
|
||||
By adhering to these best practices, developers can build and maintain robust, scalable, and secure applications on the Heroku platform.
|
||||
### 2.1. Configuration in the Environment
|
||||
|
||||
Store all configuration that varies between deploys (database credentials, API keys) in environment variables, not in code.
|
||||
|
||||
❌ **BAD**: Hardcoding secrets or committing config files.
|
||||
```javascript
|
||||
// config.js
|
||||
const DB_URL = "postgres://user:pass@host:port/db"; // BAD: hardcoded secret
|
||||
const API_KEY = "super-secret-key"; // BAD: hardcoded secret
|
||||
```
|
||||
|
||||
✅ **GOOD**: Fetch configuration from environment variables.
|
||||
```javascript
|
||||
// config.js
|
||||
const DB_URL = process.env.DATABASE_URL;
|
||||
const API_KEY = process.env.EXTERNAL_API_KEY;
|
||||
|
||||
if (!DB_URL || !API_KEY) {
|
||||
console.error("Missing critical environment variables!");
|
||||
process.exit(1);
|
||||
}
|
||||
```
|
||||
* **Context**: Heroku automatically injects add-on credentials (e.g., `DATABASE_URL`, `REDIS_URL`) as environment variables. Always use `process.env.PORT` for the server port.
|
||||
|
||||
### 2.2. Stateless Processes
|
||||
|
||||
Ensure your application processes are stateless and share-nothing. Any data that needs to persist must be stored in a backing service.
|
||||
|
||||
❌ **BAD**: Storing user sessions or uploaded files on the local filesystem.
|
||||
```javascript
|
||||
// server.js
|
||||
const express = require('express');
|
||||
const session = require('express-session');
|
||||
const fs = require('fs');
|
||||
|
||||
const app = express();
|
||||
app.use(session({ secret: 'my-secret', resave: false, saveUninitialized: false })); // BAD: default session store is in-memory
|
||||
app.post('/upload', (req, res) => {
|
||||
fs.writeFileSync(`/tmp/${req.file.name}`, req.file.buffer); // BAD: writing to ephemeral filesystem
|
||||
});
|
||||
```
|
||||
|
||||
✅ **GOOD**: Use external backing services for state.
|
||||
```javascript
|
||||
// server.js
|
||||
const express = require('express');
|
||||
const session = require('express-session');
|
||||
const RedisStore = require('connect-redis').default;
|
||||
const { createClient } = require('redis');
|
||||
const { S3Client, PutObjectCommand } = require('@aws-sdk/client-s3'); // Or any cloud storage
|
||||
|
||||
const app = express();
|
||||
|
||||
// Use Redis for session storage
|
||||
const redisClient = createClient({ url: process.env.REDIS_URL });
|
||||
redisClient.connect().catch(console.error);
|
||||
app.use(session({
|
||||
store: new RedisStore({ client: redisClient }),
|
||||
secret: process.env.SESSION_SECRET,
|
||||
resave: false,
|
||||
saveUninitialized: false
|
||||
}));
|
||||
|
||||
// Upload files to S3
|
||||
const s3 = new S3Client({ region: process.env.AWS_REGION });
|
||||
app.post('/upload', async (req, res) => {
|
||||
const command = new PutObjectCommand({
|
||||
Bucket: process.env.S3_BUCKET_NAME,
|
||||
Key: req.file.name,
|
||||
Body: req.file.buffer
|
||||
});
|
||||
await s3.send(command);
|
||||
res.send('File uploaded to S3');
|
||||
});
|
||||
```
|
||||
* **Context**: Heroku's filesystem is ephemeral and unique to each dyno. Data written to it will be lost on dyno restart or scale events.
|
||||
|
||||
## 3. Performance Considerations
|
||||
|
||||
Optimize for Heroku's dyno model to achieve high performance and scalability.
|
||||
|
||||
### 3.1. Background Jobs
|
||||
|
||||
Offload long-running tasks to worker dynos to keep web dynos responsive.
|
||||
|
||||
❌ **BAD**: Performing heavy computations or sending emails directly in a web request.
|
||||
```javascript
|
||||
// web_route.js
|
||||
app.post('/process-data', async (req, res) => {
|
||||
const result = await performHeavyComputation(req.body.data); // Blocks web dyno
|
||||
await sendEmail(req.user.email, result); // Blocks web dyno
|
||||
res.json({ status: 'completed', result });
|
||||
});
|
||||
```
|
||||
|
||||
✅ **GOOD**: Queue background jobs for worker dynos.
|
||||
```javascript
|
||||
// web_route.js
|
||||
const { Queue } = require('bullmq'); // Example with BullMQ (requires Redis)
|
||||
const myQueue = new Queue('my-processing-queue', { connection: { host: process.env.REDIS_HOST, port: process.env.REDIS_PORT } });
|
||||
|
||||
app.post('/process-data', async (req, res) => {
|
||||
await myQueue.add('process-task', { data: req.body.data, userEmail: req.user.email });
|
||||
res.json({ status: 'processing', message: 'Task queued successfully.' });
|
||||
});
|
||||
|
||||
// worker.js (running on a worker dyno)
|
||||
const { Worker } = require('bullmq');
|
||||
const worker = new Worker('my-processing-queue', async job => {
|
||||
const result = await performHeavyComputation(job.data.data);
|
||||
await sendEmail(job.data.userEmail, result);
|
||||
}, { connection: { host: process.env.REDIS_HOST, port: process.env.REDIS_PORT } });
|
||||
```
|
||||
* **Context**: Web dynos should respond quickly (ideally < 500ms). Use a queueing add-on (e.g., Heroku Redis with BullMQ/Celery) for any task that takes longer.
|
||||
|
||||
### 3.2. Database Optimization
|
||||
|
||||
Use Heroku Postgres efficiently. Optimize queries, add indexes, and consider connection pooling.
|
||||
|
||||
❌ **BAD**: Opening a new database connection for every request, N+1 queries.
|
||||
```javascript
|
||||
// In a Node.js Express app without connection pooling
|
||||
app.get('/users/:id', async (req, res) => {
|
||||
const client = new pg.Client({ connectionString: process.env.DATABASE_URL });
|
||||
await client.connect();
|
||||
const user = await client.query('SELECT * FROM users WHERE id = $1', [req.params.id]);
|
||||
// ... potentially more queries for related data without proper joins
|
||||
await client.end();
|
||||
res.json(user.rows[0]);
|
||||
});
|
||||
```
|
||||
|
||||
✅ **GOOD**: Use a connection pool and optimize queries.
|
||||
```javascript
|
||||
// In a Node.js Express app with pg-pool
|
||||
const { Pool } = require('pg');
|
||||
const pool = new Pool({
|
||||
connectionString: process.env.DATABASE_URL,
|
||||
ssl: { rejectUnauthorized: false } // Required for Heroku Postgres
|
||||
});
|
||||
|
||||
app.get('/users/:id', async (req, res) => {
|
||||
const user = await pool.query('SELECT * FROM users WHERE id = $1', [req.params.id]);
|
||||
res.json(user.rows[0]);
|
||||
});
|
||||
```
|
||||
* **Context**: Heroku Postgres is a managed service. Focus on application-level database performance. Always use SSL when connecting to Heroku Postgres.
|
||||
|
||||
## 4. Common Pitfalls and Gotchas
|
||||
|
||||
Avoid these common mistakes to ensure smooth operation on Heroku.
|
||||
|
||||
### 4.1. Binding to `PORT` Environment Variable
|
||||
|
||||
Your web process *must* listen on the port specified by the `PORT` environment variable. Heroku dynamically assigns this port.
|
||||
|
||||
❌ **BAD**: Hardcoding a port (e.g., `3000`).
|
||||
```javascript
|
||||
// server.js
|
||||
const PORT = 3000; // BAD: hardcoded port
|
||||
app.listen(PORT, () => console.log(`Listening on ${PORT}`));
|
||||
```
|
||||
|
||||
✅ **GOOD**: Use `process.env.PORT`.
|
||||
```javascript
|
||||
// server.js
|
||||
const PORT = process.env.PORT || 5000; // Use Heroku's PORT, fallback for local dev
|
||||
app.listen(PORT, () => console.log(`Listening on ${PORT}`));
|
||||
```
|
||||
* **Context**: Heroku routes traffic to your web dyno on a dynamically assigned port. Failing to bind to `process.env.PORT` will cause your app to crash.
|
||||
|
||||
### 4.2. Handling Graceful Shutdown
|
||||
|
||||
Heroku sends a `SIGTERM` signal to dynos before shutting them down. Your app should catch this signal and perform cleanup.
|
||||
|
||||
❌ **BAD**: Abruptly exiting on `SIGTERM`.
|
||||
```javascript
|
||||
// server.js
|
||||
process.on('SIGTERM', () => {
|
||||
console.log('Received SIGTERM. Exiting immediately.');
|
||||
process.exit(0); // BAD: no time for cleanup
|
||||
});
|
||||
```
|
||||
|
||||
✅ **GOOD**: Implement graceful shutdown.
|
||||
```javascript
|
||||
// server.js
|
||||
const server = app.listen(PORT, () => console.log(`Listening on ${PORT}`));
|
||||
|
||||
process.on('SIGTERM', () => {
|
||||
console.log('Received SIGTERM. Shutting down gracefully...');
|
||||
server.close(() => {
|
||||
console.log('HTTP server closed.');
|
||||
// Close database connections, flush logs, etc.
|
||||
// Ensure all pending requests are handled or rejected.
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
// Force close if server doesn't close within a timeout
|
||||
setTimeout(() => {
|
||||
console.error('Forcefully shutting down after timeout.');
|
||||
process.exit(1);
|
||||
}, 10000); // 10 seconds grace period
|
||||
});
|
||||
```
|
||||
* **Context**: Heroku gives your dyno 10 seconds to shut down. This is crucial for preventing data loss and ensuring a smooth user experience during deploys or scaling events.
|
||||
|
||||
## 5. Testing Approaches
|
||||
|
||||
Integrate testing into your Heroku development workflow, especially with Heroku Flow.
|
||||
|
||||
### 5.1. Automated CI/CD with Heroku Flow
|
||||
|
||||
Leverage Heroku Flow for automated testing, linting, and deployment. This ensures code quality and prevents regressions.
|
||||
|
||||
❌ **BAD**: Manual testing and deployment, no automated checks.
|
||||
```
|
||||
# No CI/CD setup, manual deploys to production
|
||||
```
|
||||
|
||||
✅ **GOOD**: Configure Heroku CI for automated testing on every push.
|
||||
```json
|
||||
// app.json (excerpt for Heroku CI)
|
||||
{
|
||||
"scripts": {
|
||||
"test": "npm test"
|
||||
},
|
||||
"environments": {
|
||||
"test": {
|
||||
"addons": ["heroku-postgresql:mini"],
|
||||
"env": {
|
||||
"NODE_ENV": "test"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
* **Context**: Heroku CI runs your `test` script (defined in `package.json` or `app.json`) on a fresh dyno for every push to GitHub, providing immediate feedback.
|
||||
|
||||
### 5.2. Review Apps for Feature Testing
|
||||
|
||||
Use Review Apps to automatically spin up a disposable Heroku app for every pull request, enabling easy testing and collaboration.
|
||||
|
||||
❌ **BAD**: Developers testing features locally or on a shared staging environment.
|
||||
```
|
||||
# No Review Apps, PRs are reviewed without a dedicated deploy
|
||||
```
|
||||
|
||||
✅ **GOOD**: Enable Review Apps in Heroku Dashboard.
|
||||
```json
|
||||
// app.json (ensure this file exists and is configured)
|
||||
{
|
||||
"name": "My Awesome App",
|
||||
"description": "A description of my awesome app.",
|
||||
"repository": "https://github.com/myorg/my-awesome-app",
|
||||
"keywords": ["node", "express", "heroku"],
|
||||
"addons": [
|
||||
"heroku-postgresql:hobby-dev"
|
||||
],
|
||||
"env": {
|
||||
"NODE_ENV": "development"
|
||||
}
|
||||
}
|
||||
```
|
||||
* **Context**: Review Apps provide an isolated, production-like environment for each feature, making code reviews more effective and catching environment-specific bugs early.
|
||||
Reference in New Issue
Block a user