README
English Content (from README.md)
🚀 Quick Start (Using Make)
# 1. Clone the repository and enter the folder
git clone https://github.com/magdielcardoso/discuza.git
cd discuza
# 2. Run the automated setup
make setup
# 3. Configure credentials (required the first time)
# Follow the instructions in the editor that opens.
make credentials
# 4. Start the server
make start
Access the application at http://localhost:3000
. See other useful commands with make help
.
🚀 About Discuza
Discuza is a platform designed to facilitate online discussions in an organized and efficient way. Built with the robustness of Ruby on Rails and the interactivity of Hotwire (Turbo + Stimulus), it offers a fast and modern user experience.
✨ Key Features (Planned)
- Discussion Topic Creation
- Nested Reply System
- Post Reactions
- User Authentication (Devise)
- User Profiles
- Real-time Notifications (Action Cable)
- Markdown Support in Messages
- Efficient Search
📸 Screenshots
See what Discuza looks like:
Login Page

Main Dashboard

🛠️ Running Locally (Manual Steps)
Follow these steps to set up the development environment manually (alternative to make setup
):
- Clone the repository:
git clone https://github.com/magdielcardoso/discuza.git cd discuza
- Install dependencies:
- Make sure you have the correct Ruby version installed (check
.ruby-version
). - Install Bundler:
gem install bundler
- Install gems and dependencies:
bundle install
- Make sure you have the correct Ruby version installed (check
- Configure the Database:
- Ensure PostgreSQL is installed and running.
- Check
config/database.yml
. - Create database:
rails db:create
- Run migrations:
rails db:migrate
- (Optional) Seed data:
rails db:seed
- Configure Credentials:
bin/rails credentials:edit
- Configure Environment Variables: Copy
.env.example
to.env
and edit. - Start the Server:
Access at./bin/dev
http://localhost:3000
. - Configure Git Hooks (Recommended):
or manually../bin/setup --skip-server
- Running Tests:
rails test
🤖 AI Development (StanDev)
This project uses an AI Coding Agent (StanDev) to accelerate development.
### System Prompt Summary (StanDev)
* Prioritize Rails Generators: Use '''rails g''' whenever possible.
* Test Everything: No features without tests.
* Document Progress: Update '''standev/app_progress.md'''.
* Vanilla Rails: Avoid external gems unless necessary.
* ERB Partials: Use partials for views.
* Simplicity: Lightweight controllers, logic in models/services.
- Follow Guidelines
- Review Progress
- Focus on Clear Tasks
- Atomic Commits
🤝 How to Contribute
We are an open-source project and would love your help!
- Fork the project.
- Create a Branch for your feature.
- Commit your changes.
- Push to the Branch.
- Open a Pull Request.
Please make sure your tests pass and follow the project's code style.
📄 License
This project is licensed under the MIT License. See the LICENSE
file for more details.
✨ Acknowledgements
- To the Ruby on Rails community.
- To the project contributors.
🚀 Deploying with Kamal
This project is configured for continuous deployment using Kamal.
- Configure Servers
- Prepare Deploy File (
config/deploy.yml
from example) - Prepare Secrets File (
.kamal/secrets
from example) - Initial Setup (First time):
kamal setup
- Deploy:
kamal deploy
- Useful Commands:
kamal details
,kamal logs
, etc.
Contributing to Discuza
English Contribution Guide (from CONTRIBUTING.md)
First off, thank you for considering contributing to Discuza! It's people like you that make Discuza such a great tool.
We welcome contributions of all kinds, from reporting bugs and suggesting enhancements to submitting pull requests for new features or bug fixes.
How Can I Contribute?
Reporting Bugs
If you find a bug, please ensure it wasn't already reported by searching on GitHub under Issues. If not, open a new one with a title, clear description, and a code sample or test case.
Suggesting Enhancements
If you have an idea, search Issues first. If not discussed, open a new issue with a clear description and why it would be valuable.
Pull Requests
We love pull requests! Discuss significant changes in an issue first.
Steps to contribute code:
- Fork the repository.
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/discuza.git cd discuza
- Set up your development environment: Follow instructions in README.md. Ensure Git pre-commit hooks are active.
- Create a new branch:
git checkout -b feature/your-descriptive-feature-name
- Make your changes: Write code and add tests. Ensure all tests pass (
rails test
). - Commit your changes: Use clear commit messages (consider Conventional Commits).
git add . git commit -m "feat: Add my new feature"
- Push your branch:
git push origin feature/your-descriptive-feature-name
- Open a Pull Request (PR): Go to the original Discuza repository and click "New Pull Request".
Pull Request Guidelines:
- Ensure all tests pass (
rails test
). - Follow existing code style (RuboCop via pre-commit hook should help).
- Provide a clear description of the problem and solution. Link to relevant issue.
- Keep PRs focused on a single issue or feature.
Code of Conduct
This project adheres to a Code of Conduct. Please review it before contributing.
Questions?
Reach out via email at contato@stacklab.digital or join our WhatsApp group.
License
MIT License
Copyright (c) [ano] [nome do detentor dos direitos autorais]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Support
How to Get Help
If you need help with Discuza, have questions, or want to discuss features, here are the ways you can reach out:
- GitHub Issues: For bug reports and feature requests, please use the GitHub Issues tracker.
- WhatsApp Group: For general discussion, join our WhatsApp group: Discuza 💬 StackLab.
- Email: For specific inquiries, contact [contato@stacklab.digital].
Community Support
Please remember that Discuza is an open-source project. When asking for help, provide as much detail as possible.
Contributing
If you'd like to contribute, please see our Contributing Guidelines.
Security Policy
Supported Versions
Version | Supported |
---|---|
1.x.x | ✔️ |
< 1.0 | ❌ |
Reporting a Vulnerability
We take security vulnerabilities seriously. Please do not report security vulnerabilities through public GitHub issues.
Instead, please email the details to [contato@stacklab.digital].
Please include:
- A description of the vulnerability and its potential impact.
- Steps to reproduce the vulnerability.
- Any relevant code snippets, logs, or screenshots.
- Information about the affected version(s).
We will acknowledge receipt of your report within 48 hours and aim to provide a more detailed response within 72 hours.
Contributor Covenant Code of Conduct
Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
Our Standards
Examples of behavior that contributes to a positive environment include:
- Demonstrating empathy and kindness.
- Being respectful of differing opinions.
- Giving and gracefully accepting constructive feedback.
- Accepting responsibility and apologizing for mistakes.
- Focusing on what is best for the overall community.
Examples of unacceptable behavior include:
- Sexualized language or imagery, and sexual attention or advances.
- Trolling, insulting comments, and personal or political attacks.
- Public or private harassment.
- Publishing others' private information without permission.
- Other conduct considered inappropriate in a professional setting.
Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards and will take appropriate corrective action in response to any behavior they deem inappropriate, threatening, offensive, or harmful.
Scope
This Code of Conduct applies within all community spaces and when an individual is officially representing the community in public spaces.
Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to [contato@stacklab.digital]. All complaints will be reviewed and investigated.
Enforcement Guidelines
Community leaders will follow Community Impact Guidelines in determining consequences:
- Correction: Private warning for unprofessional behavior.
- Warning: Consequences for continued behavior, potential temporary restriction.
- Temporary Ban: For serious violations or sustained inappropriate behavior.
- Permanent Ban: For a pattern of violation, harassment, or aggression.
Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 2.0.
Changelog
[0.1.0] - 2025-05-03
Added
- Installed and configured ActionText for rich text editing.
- Generated scaffold for
Discussion
(title:string
,content:rich_text
,user:references
,pinned:boolean
,closed:boolean
). - Generated scaffold for
Reply
(discussion:references
,user:references
,content:rich_text
,marked_as_answer:boolean
). - Generated
Vote
model (user:references
,votable:references{polymorphic}
,value:integer
). - Generated
Reaction
model (user:references
,reactable:references{polymorphic}
,emoji:string
). - Executed corresponding migrations for new models/scaffolds.
- Configured basic associations and validations in models (
User
,Discussion
,Reply
,Vote
,Reaction
). - Generated basic test files for new models/scaffolds.
- Implemented
before_action :authenticate_user!
inDiscussionsController
. - Generated and styled Devise views (login, sign up, password recovery, confirmation) with Tailwind, including dark mode.
- Created specific
auth.html.erb
layout for Devise, centering content and adding a side image with a quote. - Created
user_initials
helper to generate name initials. - Created Stimulus
dropdown
controller to manage the user menu in the navbar.
Changed
- Adjusted spacing and appearance of the New Discussion page.
- Updated navbar to:
- Use the Stimulus
dropdown
controller. - Display user initials (via
user_initials
helper) when no avatar is present. - Show "Sign In" / "Sign Up" buttons for logged-out users.
- Use the Stimulus
- Refactored
modal_controller.js
to fix the Devise profile edit modal:- Abandoned generic modal approach.
- Added specific
profileModal
target andopenProfileModal
action. - Adjusted
close
andcloseWithBackground
actions for the new target. - Updated
devise/registrations/edit.html.erb
view to use the new modal target and action.
Fixed
- Fixed issue where the Devise profile edit modal did not open correctly after previous modifications to
modal_controller.js
.