# GoodGo Microservices Platform Enterprise-grade microservices monorepo built with modern technologies and best practices. ## ๐Ÿ—๏ธ Architecture This monorepo follows a microservices architecture pattern with: - **Apps**: Frontend applications (Web + Mobile) - **Services**: Backend microservices (starting with Auth Service) - **Packages**: Shared libraries and utilities - **Infrastructure**: Traefik, Observability, Databases - **Deployments**: Environment-specific configurations ## ๐Ÿ“ Project Structure ``` โ”œโ”€โ”€ apps/ # Frontend applications โ”‚ โ”œโ”€โ”€ web-admin/ # Next.js admin web application โ”‚ โ”œโ”€โ”€ web-client/ # Next.js client web application โ”‚ โ”œโ”€โ”€ app-admin/ # Flutter admin mobile application โ”‚ โ””โ”€โ”€ app-client/ # Flutter client mobile application โ”œโ”€โ”€ services/ # Backend microservices โ”‚ โ”œโ”€โ”€ auth-service/ # Authentication service โ”‚ โ””โ”€โ”€ _template/ # Service template โ”œโ”€โ”€ packages/ # Shared libraries โ”‚ โ”œโ”€โ”€ logger/ # Centralized logging โ”‚ โ”œโ”€โ”€ types/ # TypeScript types โ”‚ โ”œโ”€โ”€ config/ # Shared configs โ”‚ โ”œโ”€โ”€ http-client/ # API client wrapper โ”‚ โ”œโ”€โ”€ auth-sdk/ # Auth utilities โ”‚ โ””โ”€โ”€ tracing/ # OpenTelemetry setup โ”œโ”€โ”€ infra/ # Infrastructure as Code โ”‚ โ”œโ”€โ”€ traefik/ # Traefik configuration โ”‚ โ”œโ”€โ”€ docker/ # Docker configs โ”‚ โ”œโ”€โ”€ observability/ # Monitoring stack โ”‚ โ””โ”€โ”€ databases/ # Database configs โ”œโ”€โ”€ deployments/ # Environment configs โ”‚ โ”œโ”€โ”€ local/ # Local development โ”‚ โ”œโ”€โ”€ staging/ # Staging environment โ”‚ โ””โ”€โ”€ production/ # Production environment โ”œโ”€โ”€ .github/ # CI/CD workflows โ”œโ”€โ”€ scripts/ # Automation scripts โ””โ”€โ”€ docs/ # Documentation ``` ## ๐Ÿš€ Getting Started ### Prerequisites - Node.js >= 20.0.0 - pnpm >= 8.0.0 - Docker & Docker Compose - Neon account (https://neon.tech) - for PostgreSQL database ### Installation ```bash # Install dependencies pnpm install # Start all services (development) pnpm dev # Start specific service pnpm --filter @goodgo/auth-service dev # Build all pnpm build # Run tests pnpm test # Run linter pnpm lint ``` ### Local Development ```bash # Setup Neon database (first time only) ./scripts/db/setup-neon.sh # Or manually: Create .env.local with Neon DATABASE_URL # Start infrastructure (Redis, Traefik - no PostgreSQL needed) cd deployments/local docker-compose up -d # Run migrations ./scripts/db/migrate.sh auth-service dev # Start services pnpm dev ``` **Note**: This project uses Neon PostgreSQL. No local PostgreSQL setup needed! ## ๐Ÿ› ๏ธ Tech Stack **Frontend:** - Web: Next.js 14+ (App Router) - Admin & Client portals - Mobile: Flutter 3.x - Admin & Client apps - TypeScript / Dart - Tailwind CSS - Zustand / Provider **Backend:** - Node.js + TypeScript - Express/NestJS - Prisma ORM - PostgreSQL (Neon - serverless) - Redis **Infrastructure:** - Traefik (API Gateway) - Docker & Docker Compose - Kubernetes (production) - Prometheus + Grafana + Loki - OpenTelemetry **DevOps:** - GitHub Actions - PNPM Workspaces - Turborepo ## ๐Ÿ“š Documentation - [Architecture Overview](docs/architecture/system-design.md) - [API Documentation](docs/api/openapi/) - [Development Guide](docs/guides/development.md) - [Deployment Guide](docs/guides/deployment.md) - [Contributing Guide](CONTRIBUTING.md) ## ๐Ÿ” Environment Variables ### Database (Neon) All environments use Neon PostgreSQL: - **Dev**: Set `DATABASE_URL` in `deployments/local/.env.local` - **Staging/Prod**: Set in Kubernetes secrets or GitHub Secrets See `infra/databases/neon/README.md` for setup instructions. ### Other Variables Copy `.env.example` files in each service/app and configure accordingly. **Important**: Never commit `.env` files. Use `.env.example` as templates. ## ๐Ÿงช Testing ```bash # Run all tests pnpm test # Run tests for specific package pnpm --filter @goodgo/auth-service test # Run with coverage pnpm --filter @goodgo/auth-service test:coverage ``` ## ๐Ÿ“ฆ Building ```bash # Build all packages and services pnpm build # Build specific service pnpm --filter @goodgo/auth-service build ``` ## ๐Ÿšข Deployment See [Deployment Guide](docs/guides/deployment.md) for detailed instructions. ### Quick Deploy ```bash # Local cd deployments/local && docker-compose up -d # Staging (Kubernetes) cd deployments/staging && kubectl apply -f kubernetes/ # Production cd deployments/production && kubectl apply -f kubernetes/ ``` ## ๐Ÿค Contributing Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests. ## ๐Ÿ“„ License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ## ๐Ÿ‘ฅ Team Built with โค๏ธ by the GoodGo team