Thank you for considering contributing to EcoLife! π Your participation helps make this project better for everyone and contributes to environmental and animal safety awareness.
- Getting Started
- Development Setup
- Code Style Guidelines
- Making Contributions
- Pull Request Process
- Issue Reporting
- Community Guidelines
Before you begin, ensure you have the following installed:
| Tool | Version | Download |
|---|---|---|
| Git | Latest | git-scm.com |
| Node.js | v18.x+ | nodejs.org |
| npm | v9.x+ | Comes with Node.js |
| VS Code | Latest | code.visualstudio.com |
- Live Server - Local development server with live reload
- Prettier - Code formatter
- ESLint - JavaScript linting
- HTMLHint - HTML linting
- CSS Peek - CSS class definitions
Click the Fork button at the top-right of the repository page to create your own copy.
git clone https://github.com/your-username/Environment_Animal_Safety_Hub.git
cd Environment_Animal_Safety_Hubnpm install# Create a .env file from the example
cp .env.example .env # On Windows: copy .env.example .env
# Edit .env with your configuration (if needed)# Start the backend server
npm run dev
# OR for frontend-only development:
# Use VS Code's Live Server extension on frontend/index.html- Backend API: http://localhost:3000
- Frontend: Open
frontend/index.htmlin browser
Environment_Animal_Safety_Hub/
βββ frontend/ # Frontend source code
β βββ assets/ # Static resources
β β βββ images/ # Images & illustrations
β β β βββ 3d/ # 3D assets (WebP format)
β β βββ icons/ # Icon files
β β βββ data/ # JSON data files
β βββ components/ # Reusable HTML components
β βββ css/ # Stylesheets
β β βββ global/ # Design tokens & variables
β β βββ components/ # Component styles
β β βββ pages/ # Page-specific styles
β β βββ style.css # Main stylesheet
β βββ js/ # JavaScript modules
β βββ pages/ # HTML pages
β β βββ style-guide.html # Design system reference
β βββ index.html # Main entry point
βββ backend/ # Backend server
βββ docs/ # Documentation
βββ package.json # Dependencies
βββ README.md # Project overview
<!-- β
Good: Semantic HTML with proper attributes -->
<button type="button" class="btn btn-primary" aria-label="Submit form">
<i class="fas fa-paper-plane"></i> Submit
</button>
<!-- β Bad: Non-semantic, missing attributes -->
<div class="btn" onclick="submit()">Submit</div>- Use semantic HTML5 elements (
<header>,<nav>,<main>,<section>,<article>,<footer>) - Include proper
altattributes for all images - Use
aria-attributes for accessibility - Use
type="button"for non-submit buttons
/* β
Good: Use CSS variables from design system */
.card {
background: var(--bg-card);
border-radius: var(--radius-md);
box-shadow: var(--shadow-md);
transition: var(--transition-normal);
}
/* β Bad: Hardcoded values */
.card {
background: #ffffff;
border-radius: 12px;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}- Always use CSS variables from
frontend/css/global/variables.css - Follow BEM naming convention when possible
- Mobile-first responsive design
- Use
remfor font sizes,pxfor borders/shadows
// β
Good: Descriptive names, const/let, arrow functions
const handleFormSubmit = (event) => {
event.preventDefault();
const formData = new FormData(event.target);
// Process form...
};
// β Bad: var, unclear naming
var x = function(e) {
e.preventDefault();
// ...
};- Use
constandlet(nevervar) - Use descriptive function and variable names
- Add comments for complex logic
- Use ES6+ features (arrow functions, template literals, destructuring)
Before creating new UI components, consult the Living Style Guide:
π Location: frontend/pages/style-guide.html
| Color | Hex | Variable |
|---|---|---|
| Primary Green | #2E7D32 |
--primary-color |
| Primary Dark | #1b5e20 |
--primary-dark |
| Primary Light | #4caf50 |
--primary-light |
| Secondary Orange | #ff9800 |
--secondary-color |
| Accent Cyan | #00bcd4 |
--accent-color |
Use FontAwesome icons. Common icons:
| Icon | Class | Usage |
|---|---|---|
| π | fa-leaf |
Environment |
| πΎ | fa-paw |
Animals |
| π³ | fa-tree |
Nature |
| β»οΈ | fa-recycle |
Recycling |
| π± | fa-seedling |
Growth |
- Format: Use WebP for all images
- Max Width: 400px for 3D illustrations
- Location:
frontend/assets/images/ - Naming: Use kebab-case (e.g.,
eco-hero-image.webp)
git checkout -b fix-issue-name
# Example: git checkout -b fix-navbar-responsiveBranch naming conventions:
fix-*- Bug fixesfeature-*- New featuresdocs-*- Documentationrefactor-*- Code refactoring
- Follow the code style guidelines above
- Test your changes locally
- Ensure responsive design works
- Check accessibility (keyboard navigation, screen readers)
git add .
git commit -m "Fix: short description of change"Commit message format:
Fix:- Bug fixesFeature:- New featuresDocs:- Documentation updatesStyle:- CSS/UI changesRefactor:- Code improvements
git push origin fix-issue-name- Go to your forked repository on GitHub
- Click "Compare & Pull Request"
- Fill in the PR template:
- Describe what you changed and why
- Reference the issue number (e.g., "Fixes #123")
- Include screenshots for UI changes
- Wait for review - Maintainers will review your PR
- Address feedback if requested
- Merge! π
- Code follows project style guidelines
- Changes are tested locally
- No console errors or warnings
- Responsive design verified
- Accessibility checked
- Screenshots included (for UI changes)
- Go to Issues
- Click New Issue
- Provide:
- Clear title
- Steps to reproduce
- Expected vs actual behavior
- Browser/device information
- Screenshots (if applicable)
- Go to Issues
- Click New Issue
- Describe:
- The feature you'd like
- Why it would be useful
- Any implementation ideas
- Be respectful in all interactions
- Be constructive in feedback and reviews
- Be patient - maintainers are volunteers
- Be helpful - answer questions when you can
- Be inclusive - welcome newcomers
- Discord: Join our server
- Issues: Open a GitHub issue
- Discussions: Use GitHub Discussions for questions
Every contribution, no matter how small, helps make EcoLife better. Together, we're building awareness for environmental and animal safety! ππ
Happy Contributing! π±