Skip to content

Latest commit

 

History

History
245 lines (115 loc) · 6.28 KB

File metadata and controls

245 lines (115 loc) · 6.28 KB

🌐 Language & Framework Recommendations (per hub / service)

Because your students know Java/Spring Boot, Node.js, Django, Flask, FastAPI, and Go, we can assign services based on strengths of each stack. This also creates a realistic polyglot microservices environment.


1. Snapp (core ride-hailing hub)

Handles users, drivers, trips, dispatching, roles, payments integration. Needs high reliability, strong typing, and scalability.

  • Recommended: Java + Spring Boot

  • Why:

    • Mature ecosystem for enterprise-scale apps.

    • Excellent support for complex domain logic (DDD, CQRS).

    • Rich libraries for authentication, messaging, and REST.

    • Strong static typing = fewer runtime surprises.

  • Alternative: Go for trip-matching & dispatch (lightweight, fast concurrency).


2. Map Service (routing, ETA, energy consumption)

Handles geospatial algorithms, pathfinding, traffic modeling. Needs high-performance computation.

  • Recommended: Go

  • Why:

    • Concurrency (goroutines) for handling many routing requests.

    • Compiles to small, fast binaries (great for CPU-heavy workloads).

    • Strong libraries for graph algorithms and math.

  • Alternative: Python (FastAPI) for prototyping if performance is not critical.


3. Food / Marketplace Hub

Dynamic product categories (food, grocery, bread, medicine), location-based queries. Needs flexible APIs and fast iteration.

  • Recommended: Python + FastAPI

  • Why:

    • Very fast to develop APIs.

    • Async support for handling many requests (search, store updates).

    • Pydantic makes schema validation simple.

    • Easy extensibility for categories.

  • Alternative: Node.js (Express/NestJS) for teams comfortable with JS/TS.


4. Bank Service

Core requirements: accounts, transactions, payment links, deposits. Needs security, ACID guarantees, strict validation.

  • Recommended: Java + Spring Boot

  • Why:

    • Excellent database transaction support.

    • Security frameworks (Spring Security).

    • Battle-tested for banking-style apps.

  • Alternative: Django (Python) if team prefers ORM-driven approach.


5. Email Service

Lightweight service to send/receive messages. Doesn’t need enterprise features.

  • Recommended: Node.js (Express or NestJS)

  • Why:

    • Lightweight, simple for async I/O.

    • Nodemailer makes SMTP/email sending easy.

    • Scales well for handling thousands of small requests.

  • Alternative: Flask for minimal Python-based solution.


6. Support Chat / Messaging (between driver & passenger, and with support)

  • Recommended: Node.js + WebSockets (Socket.IO)

  • Why:

    • JS event-driven model is perfect for real-time messaging.

    • Simple integration into web/mobile clients.


🛠️ Development Tools & Methods

To keep students productive and aligned, recommend these practices:


1. Version Control & Collaboration

  • Use GitHub / GitLab with:

    • Branching model: main (stable), dev, feature branches (feature/trip-matching).

    • Pull Requests with mandatory reviews.

    • Issue tracking & Kanban board (GitHub Projects / Jira).

  • Code ownership: assign a primary team for each microservice, but allow cross-reviews.


2. API Contracts & Documentation

  • Every service must provide OpenAPI/Swagger spec (or .proto for gRPC).

  • Maintain a shared API repo (contracts/) that all teams pull from.

  • Prevents integration headaches.


3. Local Development

  • Provide a top-level docker-compose.yml to spin up all services with mock dependencies.

  • Use hot reload (Spring DevTools, Nodemon, FastAPI’s auto-reload) for speed.

  • Use Postman or Insomnia collections for testing APIs.


4. Databases

  • Standardize on PostgreSQL for relational data.

  • Use Redis for caching and driver/passenger location tracking.

  • Each service owns its database schema (no shared DB).


5. Communication Between Services

  • Prefer REST + JSON for simplicity.

  • Use gRPC for high-performance services (map, dispatch).

  • Use message broker (RabbitMQ or Kafka) for events like trip_requested, payment_completed.


6. Testing Strategy

  • Unit tests in the service’s native framework (JUnit, pytest, Jest, Go test).

  • Integration tests with testcontainers or local docker-compose.

  • Contract tests (Pact) to validate service interfaces.

  • CI runs tests automatically on pull requests.


7. CI/CD

  • GitHub Actions or GitLab CI:

    • Lint → Test → Build → Push Docker image → Deploy (staging).
  • Deploy staging automatically; deploy to production requires approval.


8. Collaboration Methods

  • Weekly standups (short status calls).

  • Each hub (snapp, map, food, bank, email) has its own Slack/Discord channel.

  • Shared Notion/Confluence page for architecture diagrams & design docs.

  • Use ADR (Architecture Decision Records) — short markdown files recording big decisions.


9. Development Aids

  • Linters & formatters: ESLint/Prettier, Black/Flake8, Golangci-lint, Checkstyle.

  • Pre-commit hooks with Husky or pre-commit.

  • Container debugging: use Tilt or Skaffold for live k8s dev (optional).


10. Division of Labor

  • Core Snapp hub: Java/Spring Boot team.

  • Map service: Go team.

  • Food hub: Python/FastAPI team.

  • Bank: Java/Spring Boot team (or Django if needed).

  • Email & messaging: Node.js team.

  • Support/Monitoring/CI: Cross-team effort.