Skip to main content

Crypto Shop Backend

Build secure e-commerce applications with cryptocurrency payments. Production-ready backend with TRX integration, JWT authentication, and real-time order tracking via Socket.io.

npminstall</div><divclassName="mt2textwhite/60"> npm install</div> <div className="mt-2 text-white/60"> npm run dev
🚀 Server running on port 3000

Quick start

Get your crypto e-commerce backend running in minutes

1

Install dependencies

Clone the repository and install the required packages:
git clone https://github.com/peLuis123/crypto-shop-backend.git
cd crypto-shop-backend
npm install
2

Configure environment

Create a .env file with your configuration:
MONGODB_URI=mongodb://localhost:27017/crypto-shop
NODE_ENV=development
PORT=3000
TRON_NETWORK=https://nile.trongrid.io
ACCESS_TOKEN_SECRET=your_access_token_secret_here
REFRESH_TOKEN_SECRET=your_refresh_token_secret_here
CLIENT_URL=http://localhost:3000
Generate secure random strings for JWT secrets using a tool like openssl rand -base64 32
3

Start the server

Launch the development server:
npm run dev
Your API will be available at http://localhost:3000 with Swagger documentation at /api/docs.
4

Make your first API call

Test the health endpoint:
cURL
curl http://localhost:3000/api/health
{
  "status": "OK"
}

Core features

Everything you need to build a cryptocurrency-powered e-commerce platform

TRX payments

Accept TRX cryptocurrency payments with automatic blockchain confirmation and transaction tracking

JWT authentication

Secure authentication with HttpOnly cookies, refresh tokens, and role-based access control

Real-time notifications

Instant order updates via Socket.io when payments are confirmed on the blockchain

Admin dashboard

Comprehensive analytics with sales metrics, customer insights, and order management

Transaction listener

Automated blockchain monitoring to verify payments and update order status

Security first

Rate limiting, Helmet protection, HPP prevention, and two-factor authentication support

Explore by topic

Dive deeper into specific areas of the platform

Authentication

User registration, login, logout, and profile management

Products

Product catalog management with inventory tracking

Orders

Order creation, payment processing, and status updates

Admin operations

Dashboard statistics, customer management, and refunds

TRON integration

Blockchain setup and network configuration

Deployment

Production deployment guide and best practices

Ready to build?

Follow our quickstart guide to set up your crypto e-commerce backend and start accepting TRX payments in minutes.

View Quickstart Guide