| Name | Unity ID | Role |
|---|---|---|
| Bipin Gowda | bvgowda | Infrastructure and Monitoring |
| Makarand Pundlik | mpundli | Quality Assurance and Security |
| Michelle Varghese | mmvarghe | Deployment and Release Management |
All required deliverables are documented below.
- The Project integrated into CI/CD workflow.
- GitHub Actions configured for
developandreleasebranch triggers. - Automated build, test, and deployment pipeline created.
- Static analysis and security scans run through SonarQube.
- Docker image built and deployed via Ansible to the Dev environment.
- Feature Merge Triggers Automated Dev Pipeline
Describes CI trigger, build, test, and Dev deployment flow. - Feature Enablement via Feature Flags Describes dynamic rollout of new features using configuration flags.
- Test and linting reports generated on each pipeline run.
- Logs and artifacts uploaded automatically for instructor review.
- Reports shared through email or Slack integration.
- Dev, Staging, and Production configured through Ansible.
- Inventory files maintain separation of credentials.
- Feature flags controlled in environment configuration.
feature/*: Used for new feature development.develop: Integrates completed features.release/*: Prepares stable builds for staging.main: Production-ready branch.hotfix/*: Handles urgent fixes in production.
Each merge into develop triggers an automatic Dev pipeline.
The Release Manager triggers the Staging and Production pipelines manually.
All reports, test summaries, and deployment logs are stored as build artifacts.
Slack or email notifications provide quick visibility into pipeline results.
Versions follow the format major.minor.patch (for example, 1.0.1).
Each release is tagged on merge to main.
Hotfix versions increment the patch number.
This repository hosts the DevOps pipeline for our Project.
All team deliverables and documentation are available here.
Recipe sharing app built with Node.js and MySQL. You can add recipes, rate them, and search by ingredients..
First, create a .env file in the root directory. You can copy the example:
# On Windows (PowerShell)
Copy-Item example.env .env
# On Windows (Command Prompt)
copy example.env .env
# On Linux/Mac
cp example.env .envOr create .env manually with these values (copy from example.env):
DB_HOST=mysql
DB_PORT=3306
DB_USER=root
DB_PASSWORD=recipe_password
DB_NAME=recipe_app
PORT=3000
NODE_ENV=developmentImportant: All values must be set in your .env file. The application requires these environment variables and will not work without them.
Then just run:
docker-compose upApp should be at http://localhost:3000
To run in the background:
docker-compose up -dStop it:
docker-compose downIf you have MySQL running locally, just set up the .env file with DB_HOST=localhost and run:
npm install
npm run migrate
npm startGET /api/recipes- List all recipesGET /api/recipes/:id- Get a recipePOST /api/recipes- Create recipePUT /api/recipes/:id- Update recipeDELETE /api/recipes/:id- Delete recipePOST /api/ratings- Add ratingGET /api/search/ingredient/:ingredient- Search recipes by ingredient
The application uses feature flags to enable/disable features dynamically. Feature flags can be toggled via the admin API endpoints.
new_ui- Enable new UI design theme (dark launch)search_feature- Enable/disable recipe search functionalitycompact_list_view- Enable horizontal compact list layout recipe cardshelmet- Enable HTTP header hardening via thehelmetmiddleware (mitigates XSS, clickjacking, MIME sniffing)api_key_auth- Require an internal API key header (X-API-Key) for criticalPOSTAPI endpoints
Enable feature flags using the admin API. Replace HOST with your actual server host (e.g., http://localhost:3000 or http://csc519-164-host.csc.ncsu.edu:3000):
Enable New UI:
curl -X POST http://HOST:3000/api/admin/feature-flags/new_ui/toggle \
-H "Content-Type: application/json" \
-d '{"enabled": true}'Enable Search Feature:
curl -X POST http://HOST:3000/api/admin/feature-flags/search_feature/toggle \
-H "Content-Type: application/json" \
-d '{"enabled": true}'Enable Compact List View:
curl -X POST http://HOST:3000/api/admin/feature-flags/compact_list_view/toggle \
-H "Content-Type: application/json" \
-d '{"enabled": true}'- Enable Helmet via the admin API (no restart required):
curl -X POST http://HOST:3000/api/admin/feature-flags/helmet/toggle \
-H "Content-Type: application/json" \
-d '{"enabled": true}'To disable a feature flag, set enabled to false:
curl -X POST http://HOST:3000/api/admin/feature-flags/new_ui/toggle \
-H "Content-Type: application/json" \
-d '{"enabled": false}'GET /api/admin/feature-flags- List all feature flagsGET /api/admin/feature-flags/:name- Get details for a specific feature flagPOST /api/admin/feature-flags/:name/toggle- Toggle a feature flag (requiresenabledboolean in request body)
Everything goes in .env. All variables are required - the application will not work without them:
DB_HOST- MySQL host (mysqlfor Docker,localhostfor local development)DB_PORT- MySQL port (typically3306)DB_USER- MySQL user (userootfor simplicity)DB_PASSWORD- MySQL passwordDB_NAME- Database namePORT- Application portNODE_ENV-developmentorproduction
Don't commit .env to git. Copy example.env to .env and update the values as needed.
If you get "Access denied" or connection errors:
-
Check your
.envfile - Make sure all required variables are set:DB_HOST,DB_PORT,DB_USER,DB_PASSWORD,DB_NAME,PORT,NODE_ENV- Values must match your MySQL configuration
-
Reset the database (this will delete all data):
docker-compose down -v docker-compose up -d
The
-vflag removes volumes, so the database is recreated with proper permissions. -
Verify environment variables are loaded:
- For Docker: Ensure
.envfile exists in the project root - For local: Ensure
.envfile is in the same directory aspackage.json
- For Docker: Ensure
The MySQL data is stored in a Docker volume. Your data stays when you:
- Restart containers
- Rebuild the app image
- Run
docker-compose down(without -v)
You'll lose data if you:
- Run
docker-compose down -v(removes the volume) - Delete the volume manually
- Change the volume config
-
CI: runs via
gitleaks/gitleaks-action@v2onrelease*/security-check, fails on findings, uploadsgitleaks-report.json. -
Local:
brew install gitleaksthengitleaks detect --source . --no-git --redact --report-format json --report-path gitleaks-report.json(exit 0 = clean). -
Optional Docker:
docker run --rm -v "$PWD":/path zricethezav/gitleaks:latest detect --source /path --no-git --redact --report-format json --report-path /path/gitleaks-report.json. -
Dependency audit:
npm audit --audit-level=high --json > npm-audit-report.json(exit non-zero on high/critical); view the report for details.
The migrations/init.sql only runs on a fresh database. It won't re-run if data already exists.
Quick backup (using environment variables):
docker exec recipe-app-mysql mysqldump -u ${DB_USER} -p${DB_PASSWORD} ${DB_NAME} > backup.sqlOr if running from host (load .env first):
source .env
docker exec recipe-app-mysql mysqldump -u ${DB_USER} -p${DB_PASSWORD} ${DB_NAME} > backup.sqlRestore:
source .env
docker exec -i recipe-app-mysql mysql -u ${DB_USER} -p${DB_PASSWORD} ${DB_NAME} < backup.sql