{"id":44989725,"url":"https://github.com/iwouldrathercode/echo","last_synced_at":"2026-02-18T21:12:45.925Z","repository":{"id":300327891,"uuid":"1004295806","full_name":"iwouldrathercode/echo","owner":"iwouldrathercode","description":"Echo family tree project for devpost hackathon","archived":false,"fork":false,"pushed_at":"2025-06-21T03:52:56.000Z","size":220,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-21T04:30:05.390Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/iwouldrathercode.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}},"created_at":"2025-06-18T12:09:23.000Z","updated_at":"2025-06-21T03:38:11.000Z","dependencies_parsed_at":"2025-06-21T04:30:23.927Z","dependency_job_id":"7e72ebd0-b0da-4bcb-bb0a-b3b1e9a172b4","html_url":"https://github.com/iwouldrathercode/echo","commit_stats":null,"previous_names":["iwouldrathercode/echo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iwouldrathercode/echo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwouldrathercode%2Fecho","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwouldrathercode%2Fecho/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwouldrathercode%2Fecho/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwouldrathercode%2Fecho/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iwouldrathercode","download_url":"https://codeload.github.com/iwouldrathercode/echo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwouldrathercode%2Fecho/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-02-18T21:12:45.211Z","updated_at":"2026-02-18T21:12:45.919Z","avatar_url":"https://github.com/iwouldrathercode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AdonisJS v6 React Starter Kit with Docker\n\nThis project provides a complete Docker setup for running an AdonisJS v6 React starter kit application with SurrealDB and Nginx.\n\n## Project Structure\n\n```\n.\n├── backend/                 # AdonisJS v6 React starter kit application\n│   ├── app/                # Application code\n│   ├── config/             # Configuration files\n│   ├── resources/          # Frontend resources\n│   ├── package.json        # Node.js dependencies\n│   └── ...\n├── infra/                  # Infrastructure configuration\n│   ├── container/          # Docker configuration\n│   │   ├── Dockerfile      # Production Docker image\n│   │   ├── Dockerfile.dev  # Development Docker image\n│   │   ├── docker-compose.yml      # Production services\n│   │   ├── docker-compose.dev.yml  # Development services\n│   │   ├── docker-scripts.sh       # Management script\n│   │   ├── .dockerignore           # Docker build exclusions\n│   │   └── nginx/          # Nginx configuration\n│   │       ├── nginx.conf         # Main Nginx configuration\n│   │       └── conf.d/\n│   │           └── default.conf   # Server configuration with wildcard support\n│   └── kubernetes/         # Kubernetes configuration (future)\n└── README.md              # This file\n```\n\n## Architecture\n\n- **Web**: AdonisJS v6 React starter kit application\n- **Database**: SurrealDB (NoSQL database)\n- **Reverse Proxy**: Nginx for load balancing, SSL termination, and **wildcard subdomain support**\n\n## Prerequisites\n\n- Docker\n- Docker Compose\n- Node.js 18+ (for local development)\n\n## Quick Start\n\n### Production\n\n1. Navigate to the container directory:\n```bash\ncd infra/container\n```\n\n2. Build and start all services:\n```bash\n./docker-scripts.sh prod\n# or\ndocker-compose up --build\n```\n\n3. Access your application:\n   - Web App: http://localhost (or any subdomain)\n   - SurrealDB: http://localhost:8000\n   - Direct App: http://localhost:3333\n\n### Development\n\n1. Navigate to the container directory:\n```bash\ncd infra/container\n```\n\n2. Start development environment with hot reloading:\n```bash\n./docker-scripts.sh dev\n# or\ndocker-compose -f docker-compose.dev.yml up --build\n```\n\n3. Access your application:\n   - Web App: http://localhost:8080 (or any subdomain)\n   - SurrealDB: http://localhost:8000\n   - Direct App: http://localhost:3333\n\n## Wildcard Subdomain Support\n\n**IMPORTANT**: This setup includes wildcard subdomain support! All subdomains will point to your AdonisJS v6 app's welcome page.\n\n### How it works:\n- Any subdomain (e.g., `api.example.com`, `admin.example.com`, `test.example.com`) will be handled by Nginx\n- All requests are proxied to the AdonisJS v6 application\n- The application receives the original hostname in the `Host` header\n- You can access your app via any subdomain you configure in your DNS\n\n### Examples:\n- `localhost` → AdonisJS app\n- `api.localhost` → AdonisJS app\n- `admin.localhost` → AdonisJS app\n- `test.localhost` → AdonisJS app\n- `anything.localhost` → AdonisJS app\n\n### Configuration:\n- Nginx uses a wildcard server block with `server_name ~^.*$;`\n- All subdomains are automatically handled\n- The original hostname is preserved in headers for your application logic\n\n## Services\n\n### Web Application (AdonisJS v6)\n- **Port**: 3333 (internal), 3333 (external)\n- **Environment**: Production/Development\n- **Features**: React frontend with AdonisJS backend\n- **Subdomain Support**: All subdomains point to this application\n- **Location**: `backend/` directory\n\n### SurrealDB\n- **Port**: 8000\n- **Credentials**: root/root\n- **Storage**: Persistent volume\n- **Mode**: Memory (for development)\n\n### Nginx\n- **Port**: 80 (HTTP), 443 (HTTPS - commented out)\n- **Features**: Reverse proxy, load balancing, SSL termination, **wildcard subdomain support**\n- **Static files**: Served from `/app/public/`\n- **Subdomain Handling**: All subdomains are automatically routed to the AdonisJS app\n- **Location**: `infra/container/nginx/` directory\n\n## Configuration\n\n### Environment Variables\n\nThe following environment variables are available:\n\n- `NODE_ENV`: Environment (production/development)\n- `PORT`: Application port (default: 3333)\n- `DATABASE_URL`: SurrealDB connection string\n\n### Nginx Configuration\n\n- Main config: `infra/container/nginx/nginx.conf`\n- Server config: `infra/container/nginx/conf.d/default.conf` (includes wildcard support)\n- SSL certificates: `infra/container/ssl/` directory (create your own)\n\n### SurrealDB Configuration\n\n- Username: `root`\n- Password: `root`\n- Database: In-memory (development) or file-based (production)\n\n## Development Workflow\n\n1. **Navigate to container directory**:\n   ```bash\n   cd infra/container\n   ```\n\n2. **Start development environment**:\n   ```bash\n   ./docker-scripts.sh dev\n   ```\n\n3. **Make changes to your code** in the `backend/` directory - they will be automatically reflected due to volume mounting\n\n4. **Test subdomains** - access your app via any subdomain (e.g., `api.localhost:8080`)\n\n5. **View logs**:\n   ```bash\n   ./docker-scripts.sh logs web\n   ```\n\n6. **Stop services**:\n   ```bash\n   ./docker-scripts.sh stop\n   ```\n\n## Production Deployment\n\n1. **Navigate to container directory**:\n   ```bash\n   cd infra/container\n   ```\n\n2. **Build and start production services**:\n   ```bash\n   ./docker-scripts.sh prod\n   ```\n\n3. **Set up SSL certificates**:\n   - Place your SSL certificates in the `ssl/` directory\n   - Uncomment HTTPS configuration in `nginx/conf.d/default.conf`\n   - Consider using wildcard SSL certificates for subdomain support\n\n4. **Configure environment variables**:\n   - Create a `.env` file in the `backend/` directory with production values\n   - Update `docker-compose.yml` with proper environment variables\n\n5. **DNS Configuration**:\n   - Point your domain to your server\n   - Configure wildcard DNS record (`*.yourdomain.com`) to point to your server\n   - All subdomains will automatically work\n\n## Useful Commands\n\nAll commands should be run from the `infra/container/` directory:\n\n```bash\n# Navigate to container directory\ncd infra/container\n\n# Use the management script\n./docker-scripts.sh dev          # Start development\n./docker-scripts.sh prod         # Start production\n./docker-scripts.sh stop         # Stop all services\n./docker-scripts.sh logs web     # View web logs\n./docker-scripts.sh status       # Show service status\n./docker-scripts.sh cleanup      # Clean up everything\n\n# Or use docker-compose directly\ndocker-compose up --build        # Production\ndocker-compose -f docker-compose.dev.yml up --build  # Development\ndocker-compose down              # Stop services\ndocker-compose logs -f web       # View logs\ndocker-compose exec web npm test # Run tests\n```\n\n## Local Development with Custom Domain\n\nTo use `myapp.test` locally:\n\n1. **Edit your `/etc/hosts` file**:\n   ```bash\n   sudo nano /etc/hosts\n   ```\n   Add:\n   ```\n   127.0.0.1 myapp.test *.myapp.test\n   ```\n\n2. **Start the development environment**:\n   ```bash\n   cd infra/container\n   ./docker-scripts.sh dev\n   ```\n\n3. **Access your app**:\n   - http://myapp.test:8080\n   - http://api.myapp.test:8080\n   - http://admin.myapp.test:8080\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Port conflicts**: Ensure ports 80, 3333, and 8000 are available\n2. **Permission issues**: Run Docker commands with appropriate permissions\n3. **Build failures**: Check if all dependencies are properly specified in `backend/package.json`\n4. **Subdomain not working**: Check DNS configuration and ensure wildcard records are set up\n5. **Wrong directory**: Make sure you're running commands from `infra/container/`\n\n### Logs\n\nView logs for specific services:\n```bash\ncd infra/container\n./docker-scripts.sh logs web\n./docker-scripts.sh logs surrealdb\n./docker-scripts.sh logs nginx\n```\n\n### Database Connection\n\nTo connect to SurrealDB directly:\n```bash\ncd infra/container\ndocker-compose exec surrealdb surreal sql --conn http://localhost:8000 --user root --pass root\n```\n\n### Testing Subdomains\n\nTest wildcard subdomain functionality:\n```bash\n# Test different subdomains\ncurl -H \"Host: api.localhost\" http://localhost:8080\ncurl -H \"Host: admin.localhost\" http://localhost:8080\ncurl -H \"Host: test.localhost\" http://localhost:8080\n```\n\n## Security Notes\n\n- Change default SurrealDB credentials in production\n- Set up proper SSL certificates (consider wildcard certificates for subdomains)\n- Configure firewall rules\n- Use environment variables for sensitive data\n- Regularly update Docker images\n- Consider rate limiting for subdomains if needed\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes in the appropriate directories (`backend/` for app code, `infra/container/` for Docker config)\n4. Test with Docker and subdomains\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwouldrathercode%2Fecho","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiwouldrathercode%2Fecho","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwouldrathercode%2Fecho/lists"}