A full-stack application with React Native Expo frontend and Go backend using duh-RPC and MongoDB.
- Frontend: React Native with Expo, TypeScript, NativeWind (Tailwind CSS)
- Backend: Go with duh-RPC, layered architecture (transport/service/store)
- Database: MongoDB with Docker
- Authentication: Simple username-only authentication with session tokens
template-web/
├── frontend/ # Expo React Native + Web app
├── backend/ # Go backend with layered architecture
│ ├── cmd/template-web/ # Application entry point
│ ├── transport/ # RPC definitions, HTTP handlers
│ ├── store/ # MongoDB repository pattern
│ ├── service.go # Business logic methods
│ └── client.go # Go client for duh-RPC endpoints
├── docker-compose.yml # MongoDB + backend services
└── README.md # This file
- Node.js 18+ and npm
- Go 1.21+
- Docker and Docker Compose
- Start MongoDB and backend services:
docker-compose up -d- Or run backend locally:
cd backend
go mod tidy
go run cmd/backend/main.go- Install dependencies:
cd frontend
npm install- Start development server:
# For web
npm run web
# For iOS (requires macOS and Xcode)
npm run ios
# For Android (requires Android Studio)
npm run androidThe backend uses duh-RPC with the following endpoints:
POST /v1/users.create- Create a new user accountPOST /v1/users.login- Login with usernamePOST /v1/users.get- Get user information
MONGO_URI- MongoDB connection string (default: mongodb://localhost:27017)DB_NAME- Database name (default: template-web)SERVER_ADDR- Server address (default: :8080)
- The backend follows a layered architecture pattern inspired by querator
- Transport layer handles HTTP/RPC
- Service layer contains business logic
- Store layer handles database operations
- Uses Expo Router for navigation
- NativeWind for styling (Tailwind CSS for React Native)
- TypeScript for type safety
- Mobile-first design with web support