Greenova is a Django web application designed for environmental management, focusing on tracking environmental obligations and compliance requirements. Built with accessibility and simplicity in mind, it helps organizations manage their environmental responsibilities efficiently.
- Environmental obligation tracking
- Compliance requirement management
- Project-based organization
- Mechanism and procedure documentation
- User responsibility assignment
- Accessible, HTML-first interface
Greenova is a Django web application that prioritizes semantic HTML structure, progressive enhancement, and accessibility. The project follows data-oriented programming principles and provides a modular framework for building robust web applications.
- Django-Hyperscript 1.0.2
- Django-Tailwind 3.6.0
- Django-Allauth 65.4.1
- HTML5
- PicoCSS (classless framework)
- Django-Tailwind (for utility classes)
- Modern-Normalize
- Docker
- GitHub CI/CD
- venv (virtual environment)
The application follows a modular design with clear separation of concerns:
- Data Definition Layer: Immutable data structures with validation
- Data Processing Layer: Functional transformations using map, filter, and reduce
- Data Flow Layer: Pipelines for managing workflow
- Exception Handling Layer: Business rule and system exception management
- Data Storage Layer: Immutable data storage with optimized queries
- Automation Layer: Task execution and monitoring
- Security Layer: Role-based access control and data encryption
- Python 3.12.9
- Node.js 20.19.1
- NPM 11.3.0
-
Clone the repository:
git clone https://github.com/enssol/greenova.git cd greenova -
Create and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate.fish -
Install pip-tools and compile requirements:
pip install --upgrade pip pip-tools pip-compile requirements/requirements.in pip-compile requirements/requirements-dev.in pip-compile requirements/requirements-prod.in pip-compile --all-build-deps --all-extras --output-file=requirements/constraints.txt --strip-extras requirements/requirements.in
-
Install Python dependencies with pip-sync:
pip-sync requirements/requirements.txt requirements/requirements-dev.txt -c requirements/constraints.txt -
Install Node.js dependencies:
npm install
-
Apply migrations:
python manage.py migrate
Note: All dependencies are managed with pip-tools and constraints.txt for reproducibility. See requirements/README.md for details.
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
The Greenova project uses a structured approach to manage Python dependencies, ensuring consistency across development, testing, and production environments. The dependencies are organized as follows:
requirements/requirements.in: Contains essential runtime dependencies required for the application to function.requirements/requirements-dev.in: Referencesrequirements.inand includes additional dependencies for development, such as testing and linting tools.requirements/requirements-prod.in: Referencesrequirements.inand includes production-specific dependencies, such as WSGI servers.requirements/constraints.txt: Pins versions for all dependencies (both direct and indirect) to ensure reproducible builds.
-
Development Environment:
-
Install dependencies using:
pip-sync requirements/requirements.txt requirements/requirements-dev.txt -c requirements/constraints.txt
-
-
Production Environment:
-
Install dependencies using:
pip-sync requirements/requirements.txt requirements/requirements-prod.txt -c requirements/constraints.txt
-
The .devcontainer configuration automatically installs the development
dependencies (requirements/requirements-dev.in) when the container is built
or started. This ensures a consistent development environment.
The setup.py file includes only the minimal core dependencies required for
runtime, with flexible version specifications. Additional development
dependencies are specified under extras_require.
- No Duplication: Dependencies are defined in a single location, avoiding inconsistencies.
- Reproducibility: Pinned versions in
constraints.txtensure consistent builds across environments. - Modularity: Separate files for runtime, development, and production dependencies make it easy to manage and update.
Refer to the requirements/ directory for detailed dependency specifications.
To enable type checking for certain libraries, you need to manually install the
microsoft-python-type-stubs package. This package is not available on PyPI
and must be installed directly from GitHub:
pip install git+https://github.com/microsoft/python-type-stubs.gitEnsure this is done in your development environment before running mypy or
other type-checking tools.
Greenova requires a .env file to store sensitive configuration values. Below
are the required and optional environment variables:
DJANGO_SECRET_KEY: The secret key for Django. Must be set to a secure value.DJANGO_DEBUG: Set toTruefor development orFalsefor production.DJANGO_ALLOWED_HOSTS: A comma-separated list of allowed hostnames (e.g.,localhost,127.0.0.1).
GITHUB_CLIENT_ID: GitHub OAuth client ID for social authentication.GITHUB_CLIENT_SECRET: GitHub OAuth client secret for social authentication.
-
Create a
.envfile in the project root:touch .env
-
Populate the file with the required variables:
DJANGO_SECRET_KEY="your-secure-secret-key" DJANGO_DEBUG=True DJANGO_ALLOWED_HOSTS="localhost,127.0.0.1"
-
Add any optional variables as needed.
Ensure the .env file is not committed to version control by verifying it is
listed in .gitignore.
Access the application at http://localhost:8000 after starting the development server.
- Log in using the credentials created during setup
- Create projects and define environmental mechanisms
- Add obligations related to your projects
- Assign responsibilities to users
- Monitor compliance status
We welcome contributions to Greenova! Please check our contributing guidelines in the CONTRIBUTING.md file.
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.
Greenova is under active development. Check our roadmap for upcoming features and improvements.