• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
hails

hails

cosmoye

Public
Like
cosmoye
Home
Code
4
backend
5
shared
1
ANDROID_INTEGRATION.md
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://hails--a474c996335211f09dff9e149126039e.web.val.run
README.md

E-Commerce API for Android App

This is a RESTful API backend service built on Val Town to support an Android e-commerce application. The API provides endpoints for product browsing, user authentication, cart management, payment processing, and order tracking.

API Endpoints

Authentication

  • POST /api/auth/register - Register a new user
  • POST /api/auth/login - Login and get authentication token

Products

  • GET /api/products - Get all products
  • GET /api/products/:id - Get product details
  • GET /api/products/categories - Get product categories

Cart

  • GET /api/cart - Get user's cart
  • POST /api/cart - Add item to cart
  • PUT /api/cart/:itemId - Update cart item quantity
  • DELETE /api/cart/:itemId - Remove item from cart

Orders

  • POST /api/orders - Create a new order
  • GET /api/orders - Get user's order history
  • GET /api/orders/:id - Get order details

Payment

  • POST /api/payment/process - Process payment
  • GET /api/payment/methods - Get available payment methods

Technology Stack

  • Framework: Hono (TypeScript)
  • Database: SQLite
  • Authentication: JWT
  • Payment Processing: Stripe API integration

Project Structure

├── backend/
│   ├── database/
│   │   ├── migrations.ts    # Schema definitions
│   │   └── queries.ts       # DB query functions
│   ├── routes/              # Route modules
│   │   ├── auth.ts
│   │   ├── products.ts
│   │   ├── cart.ts
│   │   ├── orders.ts
│   │   └── payment.ts
│   ├── middleware/
│   │   └── auth.ts          # Authentication middleware
│   ├── services/
│   │   └── payment.ts       # Payment processing service
│   └── index.ts             # Main entry point
└── shared/
    └── types.ts             # Shared type definitions

Getting Started

To use this API with your Android app:

  1. Set up your Android app to make HTTP requests to the API endpoints
  2. Use the authentication endpoints to manage user sessions
  3. Implement the product browsing, cart management, and checkout flows
  4. Handle payment processing through the payment endpoints

Environment Variables

The following environment variables need to be set in Val Town:

  • JWT_SECRET - Secret key for JWT token generation
  • STRIPE_SECRET_KEY - Stripe API secret key for payment processing
HTTP
  • index.ts
    hails--a4…9e.web.val.run
Code
backendsharedANDROID_INTEGRATION.mdREADME.md
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.