Your complete FastAPI + Expo React Native system is ready! Follow these 3 simple steps:
-
Find your computer's IP address:
ipconfig # WindowsLook for IPv4 Address (e.g.,
192.168.1.100) -
Update
Expo/grosence/api/config.js:const API_BASE = "http://192.168.1.100:8000"; // Use YOUR IP
cd backend
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000β Backend running at: http://localhost:8000 π API Docs at: http://localhost:8000/docs
cd Expo/grosence
npx expo startThen:
- Press
afor Android - Press
ifor iOS - Scan QR code with Expo Go app
β Complete REST API with:
- JWT authentication (login/signup)
- Products CRUD with auto-generated barcodes
- Sales transactions with automatic stock updates
- Push notifications support
- AI-ready database schema
- Full API documentation at
/docs
β Beautiful Mobile App with:
- π Dashboard - Real-time stats, alerts, quick actions
- π¦ Products - Add/edit/delete products, search, barcode system
- π° Sales - Shopping cart, multi-item transactions, stock validation
- π¨ Modern UI - Styled with NativeWind (Tailwind CSS)
- π Secure Auth - JWT token management, auto-login
- User registration with shop name
- Secure login with JWT tokens
- Auto-login on app restart
- Password validation
- Email validation
- Total products count
- Low stock alerts
- Today's sales count
- Today's revenue
- Quick action buttons
- Pull to refresh
- Add products with details
- Auto-generate unique barcodes (UUID)
- Edit product information
- Delete products
- Search products by name/category
- View stock levels
- Low stock indicators
- Category management
- Create multi-item sales
- Barcode-based product lookup
- Shopping cart functionality
- Quantity & discount support
- Payment method selection (Cash/Card/UPI)
- Automatic stock deduction
- Stock validation before sale
- Transaction history
- Revenue tracking
βββββββββββββββββββββββββββββββββββββββββββ
β Expo React Native Frontend β
β (iOS, Android, Web) β
β - NativeWind (Tailwind CSS) β
β - Expo Router Navigation β
β - JWT Authentication β
ββββββββββββββββ¬βββββββββββββββββββββββββββ
β REST API
β (axios + JWT tokens)
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β FastAPI Backend β
β - SQLAlchemy ORM β
β - SQLite Database β
β - JWT Security β
β - Auto Stock Updates β
βββββββββββββββββββββββββββββββββββββββββββ
grosence/
βββ π COMPLETE_SETUP_GUIDE.md β Start here!
βββ π§ͺ test_integration.bat/sh β Test scripts
β
βββ backend/ β FastAPI Backend
β βββ app/
β β βββ main.py β FastAPI app
β β βββ models.py β 9 database models
β β βββ schemas.py β Pydantic schemas
β β βββ deps.py β Auth dependencies
β β βββ routers/
β β β βββ auth.py β Login/Register
β β β βββ product.py β Products CRUD
β β β βββ sales.py β Sales transactions
β β β βββ notifications.py β Push notifications
β β βββ core/
β β β βββ config.py β Environment config
β β β βββ db.py β Database setup
β β βββ utils/
β β β βββ security.py β JWT & password hashing
β β β βββ barcode.py β Barcode generation
β β β βββ notifications.py β Expo push
β β βββ services/
β β βββ ai_stub.py β AI hooks (future)
β βββ .env β Configuration
β βββ requirements.txt β Python packages
β βββ grosense.db β SQLite database
β
βββ Expo/grosence/ β React Native Frontend
βββ app/
β βββ _layout.jsx β Root + AuthProvider
β βββ index.jsx β Auto-navigation
β βββ onboarding.jsx β Welcome screen
β βββ (auth)/
β β βββ login.jsx β Login screen
β β βββ signup.jsx β Registration
β βββ (tabs)/
β βββ _layout.jsx β Bottom tabs
β βββ home.jsx β Dashboard
β βββ products.jsx β Product management
β βββ sales.jsx β Sales system
βββ api/
β βββ config.js β β οΈ UPDATE THIS!
β βββ api.js β Axios client
β βββ auth.js β Auth APIs
β βββ products.js β Product/Sales APIs
βββ components/
β βββ UI.jsx β Reusable components
β βββ ProductCard.jsx β Cards
βββ contexts/
β βββ AuthContext.jsx β Global auth state
βββ hooks/
β βββ useProducts.js β Products hook
β βββ useSales.js β Sales hook
βββ package.json β Dependencies
test_integration.bat-
Test Backend:
curl http://localhost:8000/health # Should return: {"status":"ok"} -
Test API Docs: Open: http://localhost:8000/docs
-
Test Registration:
- Open app β Sign Up
- Fill in details
- Should redirect to Dashboard
-
Test Products:
- Add a product
- View in Products tab
- Edit/Delete product
-
Test Sales:
- Create new sale
- Enter product barcode
- Complete transaction
- Check stock decreased
- Primary: Blue
#3B82F6 - Success: Green
#10B981 - Warning: Red
#EF4444 - Info: Yellow
#F59E0B
- Onboarding β Feature showcase
- Login/Signup β Authentication
- Dashboard β Stats & quick actions
- Products β Grid view with search
- Sales β Cart-based system
β Password hashing with bcrypt β JWT token authentication β Secure token storage (AsyncStorage) β Request/response interceptors β Auto-logout on 401 β Input validation (frontend + backend) β SQL injection protection (SQLAlchemy ORM)
9 Complete Models:
Shopkeeper- User accountsSupplier- Product suppliersProduct- Inventory itemsSalesTransaction- Sale headersSalesRecord- Sale line itemsStockEvent- Inventory audit logAIPrediction- ML predictions (future)AIInsight- AI recommendations (future)ExpoPushToken- Push notifications
- Switch to PostgreSQL
- Deploy to: Railway, Heroku, DigitalOcean
- Use environment variables
- Enable HTTPS
- Build with:
eas build - Submit to App Store / Play Store
- Update API_BASE to production URL
- β Backend running on
0.0.0.0:8000 - β Updated
api/config.jswith correct IP - β Same WiFi network
- β Firewall allows port 8000
- β Check backend terminal for errors
- β Register account first
- β Check email/password
- β Token is valid (try re-login)
- β Check backend
/products/endpoint - β Check React Native Debugger
- Setup Guide:
COMPLETE_SETUP_GUIDE.md - Backend Details:
backend/IMPLEMENTATION_SUMMARY.md - Frontend Details:
Expo/grosence/FRONTEND_GUIDE.md - API Docs: http://localhost:8000/docs
- Camera barcode scanner (
expo-barcode-scanner) - Push notifications integration
- Offline mode with local database
- Sales charts & analytics
- Export reports (PDF/CSV)
- Dark mode
- Multi-language support
- AI predictions implementation
- Development: Use
http://YOUR_IP:8000(not localhost) - Testing: Use Expo Go app on real device
- Debugging: Enable Remote JS Debugging in Expo
- Backend Logs: Watch terminal for API errors
- Frontend Logs: Check React Native Debugger console
Before you start:
- Python 3.8+ installed
- Node.js 14+ installed
- Expo Go app on your phone
- Both devices on same WiFi
- Port 8000 not in use
Setup:
- Updated
api/config.jswith your IP - Started backend server
- Started Expo app
- Scanned QR code
Testing:
- Registered new account
- Logged in successfully
- Added a product
- Created a sale
- Verified stock updated
Your Grosense AI-Powered Shopkeeper Management System is ready to use!
Need help? Check the detailed guides or open an issue.
Happy selling! π
Built with β€οΈ by Likhith M N FastAPI + Expo + SQLAlchemy + NativeWind + JWT