Skip to content

Feature/go rewrite#26

Closed
timmy-time wants to merge 107 commits into
mainfrom
feature/go-rewrite
Closed

Feature/go rewrite#26
timmy-time wants to merge 107 commits into
mainfrom
feature/go-rewrite

Conversation

@timmy-time

Copy link
Copy Markdown
Member

Summary

This pull request rewrites Momento from Python to Golang.

Checklist

  • If code changes were made then they have been tested.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

timmy-time and others added 23 commits September 23, 2021 08:47
Trailing whitespaces
- Add project structure with Go modules
- Implement config system with Viper
- Implement logging with Zap
- Create database models (GORM)
- Implement bot core with discordgo
- Add slash command support
- Create Docker configuration
- Add Makefile for common tasks
- Create comprehensive README

This completes Phase 1: Foundation & Infrastructure

Technologies:
- discordgo for Discord API
- GORM for database (PostgreSQL/MySQL/SQLite)
- Viper for configuration
- Zap for logging
- Docker for deployment
- Pin Alpine Docker image to version 3.20 instead of latest
- Update golang.org/x/crypto from v0.31.0 to v0.35.0 (fixes CVE-2025-22869)
- This resolves CodeFactor warnings about vulnerable dependencies and unstable image tags
- Remove obsolete 'version' declaration from docker-compose.yml
- Fix Dockerfile path resolution in docker-compose.yml
- Create .env file from .env.example (prevents missing env vars warning)
- Add configs/application.yml.example for Lavalink configuration
- Update README with complete setup instructions
- Add helpful comments to .env.example

This resolves Docker Compose warnings:
- Missing LAVALINK_PASSWORD warning
- Obsolete version warning
- Dockerfile path error preventing build
- Remove unnecessary git installation in builder stage
- Remove 'go mod download' command that was causing build failure
- Dependencies are already in go.sum, no need to download

This fixes the error:
  'process "/bin/sh -c go mod download" did not complete successfully'

The Dockerfile now correctly builds the Go binary from go.mod and go.sum
- Update Dockerfile base image from golang:1.21-alpine to golang:1.25-alpine
- This fixes build error: 'go.mod requires go >= 1.25.5'
- Ensures Docker build completes successfully
@timmy-time timmy-time self-assigned this Feb 1, 2026
- Move Dockerfile and docker-compose.yml to project root
- Create docker-stack.yml for Docker Swarm deployment
- Simplify Dockerfile with minimal build flags
- Update Makefile with new Docker targets (docker-up, docker-down, docker-logs, docker-clean, docker-deploy)
- Create comprehensive .env.example with SQLite default
- Add Docker secrets support in docker-stack.yml
- Add resource limits and restart policies
- Create proper volume management

Docker improvements:
- Uses env_file for secrets management
- Supports both development (compose) and production (swarm)
- Defaults to SQLite for simplicity, supports PostgreSQL
- Configs mounted as volumes for easy editing
- Better resource limits and restart policies
- Lavalink config mounted as volume

This makes the Docker deployment:
✅ Simple - files at root, intuitive structure
✅ Elegant - clear separation of concerns
✅ Working - minimal flags, proven build command
✅ Maintainable - easy to update configs without rebuilds
- Add comprehensive Docker deployment documentation
- Document development and production workflows
- Add troubleshooting section
- Document all available Makefile commands
- Add quick reference for common tasks
- Explain SQLite default vs PostgreSQL option
- Add secrets management documentation
- Include project structure overview

The README now provides:
✅ Clear setup instructions for both local and Docker
✅ Development and production deployment guides
✅ Troubleshooting section for common issues
✅ Complete command reference
✅ Project structure documentation
- Delete entire Python Momento bot directory
- Delete Python entry files (index.py, run.py)
- Delete Python dependencies (requirements.txt, config.yaml)
- Update root README.md to point to new Go version in momento-go/
- Clean project structure to contain only Go rewrite

The project is now a clean Go-only Discord bot with:
- Modern architecture using discordgo, GORM, Zap
- Complete Docker deployment setup
- SQLite default with PostgreSQL/MySQL support
- Lavalink integration for music
- Comprehensive documentation

This removes all legacy Python code and provides a clean,
maintainable foundation for future development.
…ze Go migration

- Delete old Python docker-compose.yml that's no longer needed
- The entire Momento/ directory with Python code is gone
- All Docker deployment files now live in momento-go/
- Main README.md updated to redirect to Go version
- Project is now clean and Go-only

The migration from Python to Go is complete!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants