{"id":24517870,"url":"https://github.com/roniardev/elysia-pg","last_synced_at":"2026-05-18T05:41:46.505Z","repository":{"id":273298064,"uuid":"919246659","full_name":"roniardev/elysia-pg","owner":"roniardev","description":"Simple elysia + postgre + drizzle backend template","archived":false,"fork":false,"pushed_at":"2025-11-20T03:11:26.000Z","size":466,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-20T04:15:46.362Z","etag":null,"topics":["bun","drizzle","drizzle-orm","elysia","elysiajs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roniardev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-20T03:19:02.000Z","updated_at":"2025-11-18T02:45:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"c3b092b1-e36e-43e8-9b95-b8a740994a07","html_url":"https://github.com/roniardev/elysia-pg","commit_stats":null,"previous_names":["roniardev/elysia-pg"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/roniardev/elysia-pg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roniardev%2Felysia-pg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roniardev%2Felysia-pg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roniardev%2Felysia-pg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roniardev%2Felysia-pg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roniardev","download_url":"https://codeload.github.com/roniardev/elysia-pg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roniardev%2Felysia-pg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33166642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","drizzle","drizzle-orm","elysia","elysiajs"],"created_at":"2025-01-22T01:35:47.991Z","updated_at":"2026-05-18T05:41:46.488Z","avatar_url":"https://github.com/roniardev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elysia PostgreSQL - Template\n\nOpinionated template for building a REST API using [ElysiaJS](https://elysiajs.com/) and [PostgreSQL](https://www.postgresql.org/).\n\n## 👨‍💻 Developer\n\n**[@roniardev](https://github.com/roniardev)** - Maintainer\n\nSpecializing in:\n- Full-stack development with modern technologies\n- DevOps and automation\n- Security-first development practices\n- Performance optimization\n- Team collaboration and knowledge sharing\n\n## 🚀 Quick Start\n\n```bash\n# Clone the repository\ngit clone \u003cyour-repo-url\u003e\ncd elysia-pg\n\n# Full development setup (recommended for new team members)\nmake full-setup\n\n# Or step by step\nmake setup-dev\nmake db-migrate\nmake db-seed\n```\n\n## 🛠️ Makefile Automation\n\nThis project includes a comprehensive Makefile that automates all development, deployment, and release workflows. Run `make help` to see all available commands.\n\n### 🐳 Docker Management\n\n```bash\n# Build and run services\nmake build          # Build production image\nmake build-dev      # Build development image\nmake up             # Start production services\nmake up-dev         # Start development services (exposes ports 5432, 6379)\nmake down           # Stop all services\nmake restart        # Restart all services\n\n# Monitoring and debugging\nmake logs           # View all service logs\nmake logs-app       # Application logs only\nmake logs-db        # Database logs only\nmake logs-redis     # Redis logs only\nmake status         # Check service health\nmake monitor        # Real-time monitoring\n\n# Container access\nmake shell          # Access application container\nmake shell-dev      # Access development database\n\n# Cleanup\nmake clean          # Remove all containers, images, and volumes\n```\n\n### 🗄️ Database Operations\n\n```bash\n# Migration management\nmake db-generate    # Create new migration files\nmake db-push        # Push schema changes to database\nmake db-migrate     # Run pending migrations\nmake db-seed        # Seed database with initial data\nmake db-reset       # Reset database (drop and recreate)\n\n# Database utilities\nmake db-diagram     # Generate database diagram\nmake db-connect     # Connect to production database\nmake db-connect-dev # Connect to development database\nmake backup         # Create database backup\nmake restore        # Restore database from backup\n```\n\n### 🛠️ Development Workflow\n\n```bash\n# Development server\nmake dev            # Start development server with hot reload\n\n# Code quality\nmake lint           # Run linting checks\nmake lint-fix       # Fix linting issues automatically\n\n# Code generation\nmake generate       # Generate CRUD operations\n\n# Testing\nmake test           # Run test suite\n```\n\n### 🚀 Release Management\n\n```bash\n# Create releases\nmake release-patch  # Patch release (0.0.x) - bug fixes\nmake release-minor  # Minor release (0.x.0) - new features\nmake release-major  # Major release (x.0.0) - breaking changes\nmake release-custom # Custom version release\n\n# Changelog and documentation\nmake changelog      # Generate comprehensive changelog\nmake changelog-preview # Preview changelog without writing\nmake release-notes  # Generate release notes for latest version\n\n# Publishing\nmake release-push   # Push release tags to remote\nmake release-clean  # Clean up release artifacts\n```\n\n### 🔧 Utility Commands\n\n```bash\n# Dependency management\nmake install        # Install dependencies\nmake clean-deps     # Clean and reinstall dependencies\n\n# Environment setup\nmake setup-dev      # Setup development environment\nmake setup-prod     # Setup production environment\nmake full-setup     # Complete development setup with database\n```\n\n## 🏗️ Technology Stack\n\n- **Web Framework**: [ElysiaJS](https://elysiajs.com/) - Fast, type-safe web framework\n- **Database**: [PostgreSQL](https://www.postgresql.org/) with [Drizzle ORM](https://orm.drizzle.team/)\n- **Runtime**: [Bun](https://bun.sh/) - Fast JavaScript runtime and package manager\n- **Linter**: [Biome](https://biomejs.dev/) - Fast formatter and linter\n- **Containerization**: [Docker](https://www.docker.com/) with [Docker Compose](https://docs.docker.com/compose/)\n- **Automation**: [Make](https://www.gnu.org/software/make/) - Build automation tool\n\n### Elysia Plugins\n- [CORS](https://elysiajs.com/plugins/cors.html) - Cross-origin resource sharing\n- [Swagger](https://elysiajs.com/plugins/swagger.html) - API documentation\n- [JWT](https://elysiajs.com/plugins/jwt.html) - JSON Web Token authentication\n- [Autoload](https://github.com/kravetsone/elysia-autoload) - Route autoloading\n- [Logger](https://github.com/bogeychan/elysia-logger) - Request logging\n- [Bearer](https://elysiajs.com/plugins/bearer.html) - Bearer token authentication\n- [Server Timing](https://elysiajs.com/plugins/server-timing.html) - Performance monitoring\n\n## 📋 Prerequisites\n\n- [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/)\n- [Bun](https://bun.sh/) (JavaScript runtime and package manager)\n- [Make](https://www.gnu.org/software/make/) (Build automation tool)\n\n## 🏗️ Project Structure\n\n```\nelysia-pg/\n├── app/                    # Application entry points\n├── src/                    # Source code\n│   ├── auth/              # Authentication system\n│   ├── users/             # User management\n│   ├── permissions/       # Permission system\n│   ├── posts/             # Post management\n│   └── general/           # General utilities\n├── db/                    # Database configuration\n│   ├── migrations/        # Database migrations\n│   ├── schema/            # Database schemas\n│   └── seeds/             # Database seeders\n├── docs/                  # Generated documentation\n│   ├── CHANGELOG.md       # Project changelog\n│   └── RELEASE_NOTES_*.md # Release notes\n├── scripts/               # Utility scripts\n├── vibe-log/              # Project documentation\n├── docker-compose.yml     # Production services\n├── docker-compose.dev.yml # Development services\n├── Dockerfile             # Application container\n├── Makefile               # Build automation\n└── package.json           # Project configuration\n```\n\n## 🗄️ Database Schema\n\n### ERD (Entity Relationship Diagram)\n\n![ERD](./schema.svg)\n\nThe database schema includes:\n- **Users**: User authentication and profile management\n- **Permissions**: Role-based access control system\n- **Posts**: Content management system\n- **Scopes**: Resource access scoping\n- **User Permissions**: Many-to-many relationship between users and permissions\n- **Scope User Permissions**: Granular permission control per scope\n\n## 🔄 Development Workflow\n\n### Daily Development\n```bash\n# Start development environment\nmake up-dev\nmake dev\n\n# Make changes and test\n# ... your development work ...\n\n# Stop services when done\nmake down\n```\n\n### Database Changes\n```bash\n# Modify schema files\n# Generate and apply migrations\nmake db-generate\nmake db-migrate\n\n# Add test data\nmake db-seed\n```\n\n### Code Quality\n```bash\n# Check code quality\nmake lint\n\n# Fix issues automatically\nmake lint-fix\n\n# Run tests\nmake test\n```\n\n## 🚀 Release Workflow\n\n### 1. Development Phase\n```bash\n# Make changes and commit\ngit add .\ngit commit -m \"feat: add new feature\"\n```\n\n### 2. Release Creation\n```bash\n# Choose release type based on changes\nmake release-minor   # For new features\n# OR\nmake release-patch   # For bug fixes\n# OR\nmake release-major   # For breaking changes\n```\n\n### 3. Changelog Generation\n```bash\n# Generate comprehensive changelog\nmake changelog\n\n# Or preview first\nmake changelog-preview\n```\n\n### 4. Publishing\n```bash\n# Push to remote repository\nmake release-push\n```\n\n### 5. Cleanup (Optional)\n```bash\n# Clean temporary files\nmake release-clean\n```\n\n## 🔒 Security Features\n\n- **OWASP Compliance**: Built-in security measures and best practices\n- **Environment Isolation**: Clear separation between production and development\n- **Access Control**: Proper authentication and authorization\n- **Audit Trail**: Comprehensive logging for all operations\n- **Input Validation**: Secure handling of all user inputs\n\n## 📊 Monitoring and Maintenance\n\n### Service Health\n```bash\nmake status          # Check service status\nmake monitor         # Real-time monitoring\nmake logs            # View service logs\n```\n\n### Release Tracking\n- **Version History**: Complete version history in git tags\n- **Change Logging**: All changes tracked in CHANGELOG.md\n- **Release Notes**: Detailed notes for each release\n- **Automated Cleanup**: Prevents artifact accumulation\n\n## 🆘 Troubleshooting\n\n### Common Issues\n1. **Service Not Starting**: Use `make status` and `make logs`\n2. **Database Connection**: Use `make db-connect-dev` to test\n3. **Version Conflicts**: Ensure git is clean before release\n4. **Permission Issues**: Verify Docker and git permissions\n\n### Debug Commands\n```bash\nmake status          # Service status\nmake logs            # Service logs\nmake shell-dev       # Database access\ngit status           # Git status\ngit tag --sort=-version:refname  # Version tags\n```\n\n## 🔗 Integration\n\n### CI/CD Integration\n```yaml\n# Example GitHub Actions workflow\n- name: Create Release\n  run: |\n    make release-patch\n    make changelog\n    make release-push\n```\n\n### Git Integration\n- **Automatic Versioning**: Package.json always in sync with git tags\n- **Commit Management**: Automatic commit creation for version changes\n- **Tag Management**: Annotated tags with release messages\n- **Remote Sync**: Automatic pushing to remote repository\n\n## 📚 Documentation\n\n- **`make help`** - Show all available commands\n- **`docs/CHANGELOG.md`** - Project changelog\n- **`scripts/release-demo.sh`** - Release workflow demonstration\n\n## 🎯 Best Practices\n\n### Development\n- **Environment Management**: Always use `make down` before switching\n- **Database Changes**: Use migrations for all schema changes\n- **Code Quality**: Run linting before commits\n- **Testing**: Ensure tests pass before release\n\n### Release Management\n- **Semantic Versioning**: Follow semver.org standards strictly\n- **Commit Messages**: Use conventional commit format\n- **Changelog Updates**: Generate changelog for every release\n- **Release Timing**: Maintain consistent release schedule\n\n### Security\n- **Credential Management**: Use environment variables for secrets\n- **Access Control**: Limit production access to authorized users\n- **Audit Logging**: Monitor all release activities\n- **Regular Updates**: Keep dependencies and images updated\n\n## 🤝 Contributing\n\n### Project Maintainer\n**[@roniardev](https://github.com/roniardev)** - Senior Software Engineer \u0026 Project Maintainer\n\n### Contribution Guidelines\n1. **Setup Environment**: Use `make full-setup` for development\n2. **Follow Standards**: Use provided linting and formatting rules\n3. **Test Changes**: Ensure all tests pass before submitting\n4. **Update Documentation**: Keep README and changelog current\n5. **Security First**: Follow OWASP guidelines and security best practices\n6. **Code Quality**: Maintain high standards for readability and performance\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n---\n\n**Built with ❤️ by [@roniardev](https://github.com/roniardev) using [ElysiaJS](https://elysiajs.com/), [PostgreSQL](https://www.postgresql.org/), and comprehensive automation tools.**\n\n---\n\n**Maintained by [@roniardev](https://github.com/roniardev)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froniardev%2Felysia-pg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froniardev%2Felysia-pg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froniardev%2Felysia-pg/lists"}