From bb8f9ac451e2bb247383b3a7138e6f789caa7be4 Mon Sep 17 00:00:00 2001 From: Green Hacker Date: Sun, 12 Oct 2025 01:05:03 +0530 Subject: [PATCH] docs: remove all Python references and update for Node.js/Electron - Update installation.md with Node.js instructions - Update SETUP_CHECKLIST.md with Node.js/Electron topics - Update CONTRIBUTING.md with JavaScript/React guidelines - Replace Python commands with npm commands - Update development setup instructions - Fix code examples to use JavaScript - Update resource links --- CONTRIBUTING.md | 72 ++++++++++----------- SETUP_CHECKLIST.md | 149 +++++++++++++++---------------------------- docs/installation.md | 128 +++++++++++++++++++++++++++++++++++++ 3 files changed, 211 insertions(+), 138 deletions(-) create mode 100644 docs/installation.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5622621..7ed3525 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,7 +30,7 @@ Before creating bug reports, please check the existing issues to avoid duplicate - **Provide specific examples** - **Describe the behavior you observed and what you expected** - **Include screenshots if relevant** -- **Include your environment details** (OS, Python version, etc.) +- **Include your environment details** (OS, Node.js version, etc.) ### Suggesting Enhancements 💡 @@ -79,62 +79,51 @@ Unsure where to begin? Look for issues labeled: ### Prerequisites -- Python 3.8 or higher -- pip (Python package manager) +- Node.js 20 or higher +- npm (Node package manager) - Git ### Installation -1. **Create a virtual environment**: +1. **Install dependencies**: ```bash - python -m venv venv - source venv/bin/activate # On Windows: venv\Scripts\activate + npm install ``` -2. **Install dependencies**: +2. **Generate Prisma client**: ```bash - pip install -r requirements.txt - pip install -r requirements-dev.txt # Development dependencies + npx prisma generate ``` -3. **Install pre-commit hooks**: +3. **Run in development mode**: ```bash - pre-commit install + npm run electron:dev ``` ### Running Tests ```bash -# Run all tests -pytest +# Run tests (when implemented) +npm test -# Run with coverage -pytest --cov=src --cov-report=html +# Run linting +npm run lint -# Run specific test file -pytest tests/test_crypto.py - -# Run tests in watch mode -pytest-watch +# Build the application +npm run build ``` ### Code Quality Checks ```bash -# Run linter -flake8 src/ tests/ - -# Run type checker -mypy src/ - -# Format code -black src/ tests/ +# Run ESLint +npm run lint -# Sort imports -isort src/ tests/ +# Build the application +npm run build # Run all checks (recommended before committing) -pre-commit run --all-files +npm run lint && npm run build ``` ## 🔄 Pull Request Process @@ -165,8 +154,9 @@ pre-commit run --all-files Before submitting your PR, ensure: - [ ] Code follows the project's style guidelines -- [ ] All tests pass (`pytest`) -- [ ] New tests added for new features +- [ ] Linting passes (`npm run lint`) +- [ ] Build succeeds (`npm run build`) +- [ ] New tests added for new features (if applicable) - [ ] Documentation updated (if applicable) - [ ] Commit messages follow guidelines - [ ] No merge conflicts with main branch @@ -175,12 +165,12 @@ Before submitting your PR, ensure: ## 🎨 Style Guidelines -### Python Style Guide +### JavaScript/React Style Guide -We follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) with some modifications: +We follow modern JavaScript and React best practices: - **Line length**: Maximum 100 characters -- **Indentation**: 4 spaces (no tabs) +- **Indentation**: 2 spaces (no tabs) - **Quotes**: Use double quotes for strings - **Imports**: Group and sort imports (use `isort`) - **Type hints**: Use type hints for function signatures @@ -188,10 +178,11 @@ We follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) with some modificat ### Example Code Style -```python -from typing import Dict, List, Optional +```javascript +// Use modern ES6+ syntax +import { encrypt } from './crypto'; -def encrypt_secret(secret: str, key: bytes) -> bytes: +const encryptSecret = async (secret, key) => { """Encrypts a secret using the provided key. Args: @@ -329,7 +320,8 @@ All contributors will be: - [GitHub Flow Guide](https://guides.github.com/introduction/flow/) - [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/) -- [Python Best Practices](https://docs.python-guide.org/) +- [JavaScript Best Practices](https://github.com/ryanmcdermott/clean-code-javascript) +- [React Best Practices](https://react.dev/learn) - [Hacktoberfest Official Site](https://hacktoberfest.com/) --- diff --git a/SETUP_CHECKLIST.md b/SETUP_CHECKLIST.md index 0b744b5..33d344e 100644 --- a/SETUP_CHECKLIST.md +++ b/SETUP_CHECKLIST.md @@ -59,14 +59,18 @@ All necessary files have been created! Here's what we have: ``` hacktoberfest hacktoberfest2025 - python + nodejs + electron + react environment-variables secrets-management encryption - cli + desktop-app developer-tools open-source good-first-issue + prisma + sqlite ``` #### Enable Security Features @@ -107,117 +111,66 @@ gh auth login Create some beginner-friendly issues to get started: -- [ ] **Issue 1**: Set up project structure - - Create `src/`, `tests/`, `docs/` directories - - Label: `good first issue`, `hacktoberfest` +- [ ] **Issue 1**: Add search/filter functionality + - Filter environment variables by key/value + - Label: `good first issue`, `hacktoberfest`, `enhancement` -- [ ] **Issue 2**: Create requirements.txt - - Add necessary dependencies - - Label: `good first issue`, `hacktoberfest` +- [ ] **Issue 2**: Add dark/light theme toggle + - Implement theme switcher + - Label: `good first issue`, `hacktoberfest`, `ui` -- [ ] **Issue 3**: Implement basic CLI structure - - Use Click framework - - Label: `enhancement`, `cli` +- [ ] **Issue 3**: Add password strength indicator + - Visual feedback for password creation + - Label: `enhancement`, `security` -- [ ] **Issue 4**: Add encryption module - - Implement AES-256 encryption - - Label: `enhancement`, `crypto` +- [ ] **Issue 4**: Add export templates + - Support for different .env formats + - Label: `enhancement`, `feature` - [ ] **Issue 5**: Write documentation - - Installation guide - - User guide + - User guide improvements + - API documentation - Label: `documentation`, `good first issue` ### 4. Project Structure Setup -Create the basic project structure: +The project structure is already set up: -```bash -# Create directories -mkdir -p src/{core,cli,gui,crypto,utils} -mkdir -p tests/{unit,integration} -mkdir -p docs -mkdir -p examples - -# Create __init__.py files -touch src/__init__.py -touch src/core/__init__.py -touch src/cli/__init__.py -touch src/gui/__init__.py -touch src/crypto/__init__.py -touch src/utils/__init__.py -touch tests/__init__.py - -# Create main entry point -touch src/main.py -touch setup.py +``` +ENV_Storage/ +├── electron/ # Electron main process +├── src/ # React frontend +│ ├── components/ # React components +│ ├── lib/ # Utility functions +│ └── assets/ # Static assets +├── prisma/ # Database schema +├── public/ # Public assets +└── docs/ # Documentation ``` -### 5. Create Essential Files +### 5. Essential Files Already Created -#### requirements.txt -```python -cryptography>=41.0.0 -click>=8.1.0 -sqlalchemy>=2.0.0 -python-dotenv>=1.0.0 -rich>=13.0.0 -``` +All essential files are already in place: -#### requirements-dev.txt -```python -pytest>=7.4.0 -pytest-cov>=4.1.0 -pytest-xdist>=3.3.0 -black>=23.7.0 -flake8>=6.1.0 -isort>=5.12.0 -mypy>=1.5.0 -pylint>=2.17.0 -bandit>=1.7.0 -safety>=2.3.0 -pre-commit>=3.3.0 -``` +#### package.json +- Contains all Node.js dependencies +- Defines npm scripts for development and building +- Configured for Electron desktop app -#### setup.py -```python -from setuptools import setup, find_packages - -setup( - name="env-storage", - version="0.1.0", - packages=find_packages(), - install_requires=[ - "cryptography>=41.0.0", - "click>=8.1.0", - "sqlalchemy>=2.0.0", - "python-dotenv>=1.0.0", - "rich>=13.0.0", - ], - entry_points={ - "console_scripts": [ - "env-storage=src.main:cli", - ], - }, - author="Nitya Jain", - description="Secure environment variable storage manager", - long_description=open("README.md").read(), - long_description_content_type="text/markdown", - url="https://github.com/curiouscoder-cmd/ENV_Storage", - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - ], - python_requires=">=3.8", -) -``` +#### prisma/schema.prisma +- Database schema for SQLite +- Models for Config, Project, EnvVar, and AuditLog + +#### electron/ +- `main.js` - Electron main process +- `preload.js` - IPC bridge +- `ipc-handlers.js` - Backend handlers +- `crypto.js` - Encryption utilities +- `database.js` - Prisma client + +#### src/ +- React components and application logic +- Modern UI with Ant Design and Tailwind CSS ### 6. Git Configuration diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 0000000..4eba52d --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,128 @@ +# Installation Guide + +## Prerequisites + +- Node.js 20 or higher +- npm (Node package manager) +- Git + +## Installation Methods + +### Method 1: Install from Source (Recommended for Contributors) + +```bash +# Clone the repository +git clone https://github.com/curiouscoder-cmd/ENV_Storage.git +cd ENV_Storage + +# Install dependencies +npm install + +# Generate Prisma client +npx prisma generate + +# Run in development mode +npm run electron:dev +``` + +### Method 2: Build Desktop Application + +```bash +# Build for your platform +npm run electron:build +``` + +## Verify Installation + +```bash +# Check Node.js version +node --version + +# Check npm version +npm --version +``` + +## First Time Setup + +When you first launch the application: + +1. You'll be prompted to create a master password +2. This password will be used to encrypt all your environment variables +3. **Important**: Remember this password - it cannot be recovered! + +The application will: +- Create a secure SQLite database for your environment variables +- Set up encryption using your master password +- Initialize the application structure + +## Troubleshooting + +### Node.js Version Issues + +If you encounter Node.js version issues: + +```bash +# Check your Node.js version +node --version + +# Install Node.js 20+ from https://nodejs.org/ +# Or use nvm (Node Version Manager) +nvm install 20 +nvm use 20 +``` + +### Permission Errors + +On macOS/Linux, you might need to use: + +```bash +sudo npm install -g npm@latest +``` + +### Electron Build Issues + +If Electron build fails: + +```bash +# Clear npm cache +npm cache clean --force + +# Remove node_modules and reinstall +rm -rf node_modules package-lock.json +npm install +``` + +### Database Issues + +If you encounter database errors: + +```bash +# Regenerate Prisma client +npx prisma generate + +# Reset database (WARNING: This will delete all data) +rm prisma/dev.db +npx prisma generate +``` + +## Next Steps + +- Read the [Quick Start Guide](../QUICK_START.md) +- Review [Security Best Practices](security.md) +- Check out the [Contributing Guide](../CONTRIBUTING.md) + +## Uninstallation + +```bash +# Simply delete the application folder +# Your data is stored in: +# - macOS: ~/Library/Application Support/env-storage-manager/ +# - Windows: %APPDATA%/env-storage-manager/ +# - Linux: ~/.config/env-storage-manager/ +``` + +## Getting Help + +- [GitHub Issues](https://github.com/curiouscoder-cmd/ENV_Storage/issues) +- [Discussions](https://github.com/curiouscoder-cmd/ENV_Storage/discussions) +- [Contributing Guide](../CONTRIBUTING.md)