Skip to content

Sebastvin/go-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservice with SaaS

Under Construction Go Version Node.js Version

📋 Project Overview

Project is microservices-based system built with Go and React. The system handles order processing, payment processing via Stripe, inventory management, and provides a modern web interface for order management. Simulates single-payment subscriptions.

🏗️ Architecture

  • Backend: Microservices architecture using Go with gRPC communication
  • Frontend: React + TypeScript + Vite with Tailwind CSS
  • Database: MongoDB for order storage
  • Message Queue: RabbitMQ for service communication
  • Service Discovery: Consul for service registration and discovery
  • Observability: Jaeger for distributed tracing
  • Payment Processing: Stripe integration

🚀 Prerequisites

Before running this project, ensure you have the following:

Required Software

Required Accounts & API Keys

🔑 Stripe Account & API Keys

  1. Create a Stripe account
  2. Get your API keys from the Stripe Dashboard
  3. You'll need:
    • Publishable Key (starts with pk_)
    • Secret Key (starts with sk_)
    • Webhook Secret (for webhook verification)

🤖 OpenAI API Key

  1. Create an OpenAI account
  2. Get your API key from the OpenAI API Keys page
  3. The system uses OpenAI's model for image editing and style application
  4. You'll need:
    • API Key (starts with sk-)

🛠️ Setup Instructions

1. Clone and Setup

git clone <your-repo-url>
cd <project-name>

2. Start Infrastructure Services

docker compose up -d

This will start:

  • MongoDB (port 27017) - Database
  • Mongo Express (port 8082) - Database admin interface
  • RabbitMQ (port 5672) - Message queue
  • RabbitMQ Management (port 15672) - Queue admin interface
  • Consul (port 8500) - Service discovery
  • Jaeger (port 16686) - Distributed tracing

3. Configure Stripe Webhook

# Install Stripe CLI
# macOS: brew install stripe/stripe-cli/stripe
# Windows: scoop install stripe
# Linux: See https://stripe.com/docs/stripe-cli

# Forward webhooks to your local payment service
stripe listen --forward-to localhost:8080/webhook

4. Start Backend Services

Open multiple terminal windows and run each service:

# Gateway Service
cd gateway
air

#  Orders Service  
cd orders
air

# Payments Service
cd payments
air

#  Stock Service
cd stock
air

5. Start Frontend

cd frontend
npm install
npm run dev

🔧 Development

Database Access

Service Discovery

Monitoring

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published