Thank you for your interest in contributing to Preswald! This document outlines the project structure, how to set up your development environment, and the guidelines for contributing. Whether you’re fixing bugs, adding new features, or improving documentation, we appreciate your time and effort.
- Project Structure
- Setup Guide
- Development Workflow
- Style Guide
- Pull Request Guidelines
- Issue Reporting Guidelines
- Community Support
- Acknowledgments
Preswald uses a modern tech stack to deliver its functionality:
- Backend: Python with FastAPI.
- Frontend: React + Vite.
The project structure looks like this:
preswald/
├── preswald/ # Core Python FastAPI backend
├── frontend/ # React + Vite frontend application
├── examples/ # Sample apps to showcase Preswald's capabilities
├── tests/ # Unit and integration tests
├── setup.py # Python package configuration
└── README.md # Project overview
- Fork the repository on GitHub.
- Clone your fork to your local machine:
git clone https://github.com/StructuredLabs/preswald.git cd preswald
We recommend using Conda to manage dependencies:
- Create and activate a Conda environment:
conda create -n preswald python=3.11 -y conda activate preswald
- Install dependencies:
pip install -e ".[dev]"
- Build the frontend assets:
python setup.py build_frontend
- Build the backend:
python -m build
- Install the local package:
Replace
pip install dist/preswald-0.xx.xx.tar.gz
0.xx.xx
with the current version number from PyPI.
Verify your setup by running the sample app:
preswald run examples/earthquakes.py
Here’s a quick summary of the contributing workflow:
- Fork and clone the repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
- Make your changes and follow the Style Guide.
- Push your branch to your fork:
git push origin feature/your-feature-name
- Open a Pull Request on the main repository.
Follow these style guidelines to maintain consistency:
- Python: Use PEP 8.
- React: Follow React Best Practices.
- Linting:
- Python: Use
flake8
andblack
.black . && flake8
- JavaScript: Use ESLint with the provided configuration.
npm run lint
- Python: Use
When submitting a PR:
- Use a descriptive branch name (e.g.,
feature/add-widget
orfix/typo-readme
). - Write a clear and concise PR title and description.
- Title: Start with a type prefix, such as
feat
,fix
, ordocs
. - Description: Include context, screenshots (if applicable), and links to relevant issues.
- Title: Start with a type prefix, such as
- Ensure your PR includes:
- Relevant tests for your changes.
- Updates to the documentation if applicable.
Example PR description:
feat: add new user authentication system
This PR adds user authentication via JWT tokens. Includes:
- Backend API endpoints for login and signup.
- React context integration for frontend.
- Unit tests for new functionality.
Fixes #42
When reporting an issue:
- Use a clear and concise title.
- Provide relevant details, such as:
- Steps to reproduce the issue.
- Expected vs. actual behavior.
- Environment details (OS, Python version, browser).
- Screenshots or logs, if applicable.
Example issue template:
**Describe the bug**
A clear and concise description of the issue.
**Steps to Reproduce**
1. Go to '...'
2. Click on '...'
3. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain the issue.
**Environment**
- OS: [e.g., Windows, macOS, Linux]
- Python version: [e.g., 3.9]
- Browser: [e.g., Chrome, Firefox]
If you have questions or need help:
- Email us at [email protected].
- Join the Structured Users Slack for discussions and support:
Structured Users Slack Invite.
We’re deeply grateful for your contributions! Every bug report, feature suggestion, and PR helps us build a better Preswald. Let’s create something amazing together! 🚀