A full-stack TypeScript tourist booking platform with debit card (Stripe) and cryptocurrency (Solana) payments, admin analytics, customer dashboard, communication hub, and AI support.
- Tour browsing, booking, and payment (Stripe card + Solana wallet)
- Jupiter DEX integration for Solana token swaps (frontend)
- JWT authentication with MFA (TOTP), sessions, and OAuth URL helpers
- Customer dashboard (account, invoices, analytics, feedback)
- Admin panel (users, billing, analytics, audit logs, system health)
- Communication (chat, forums, broadcasts, AI chatbot, calls)
- AI support assistant with FAQ suggestions
- Docker Compose deployment for production-like stacks
| Layer | Technology |
|---|---|
| Frontend | Next.js 14, React 18, TypeScript, Tailwind CSS |
| Backend | Fastify 4, TypeScript, SQLite (better-sqlite3) |
| Auth | JWT, bcrypt, OTPAuth (MFA) |
| Payments | Stripe API, Solana Web3.js, Jupiter DEX API |
| Tooling | tsx, concurrently, ESLint |
crypto-card-integration-dapp/
├── frontend/ # Next.js TypeScript app
│ ├── app/ # App Router pages
│ ├── components/ # React components
│ ├── contexts/ # Auth context
│ └── lib/ # API clients, Solana helpers
├── backend/ # Fastify TypeScript API
│ └── src/
│ ├── db/ # SQLite schema & seed
│ ├── middleware/ # JWT auth
│ ├── routes/ # API route handlers
│ └── services/ # Business logic
├── aws/ # Docker Compose deployment
└── package.json # Root monorepo scripts
- Node.js 20+ and npm
- Optional: Stripe account (card payments), Solana wallet (crypto payments)
npm run install-allFrontend uses
.npmrcwithignore-scripts=trueto avoid optional native postinstall failures on Windows.
Backend — copy and edit:
cp backend/env.example backend/.envFrontend — copy and edit:
cp frontend/env.example frontend/.env.localnpm run db:seedThis creates sample tours, forum categories, FAQs, and a welcome broadcast.
Both frontend and backend together:
npm run devOr separately:
npm run dev:backend # http://localhost:8000
npm run dev:frontend # http://localhost:3000| Variable | Description | Default |
|---|---|---|
PORT |
API port | 8000 |
DATABASE_PATH |
SQLite file path | ./data/tourist.db |
JWT_SECRET_KEY |
JWT signing secret | (change in production) |
STRIPE_SECRET_KEY |
Stripe secret key | (empty = mock payments) |
FRONTEND_URL |
CORS allowed origin | http://localhost:3000 |
SOLANA_RPC_URL |
Solana RPC endpoint | devnet |
GOOGLE_CLIENT_ID |
OAuth Google (optional) | |
GITHUB_CLIENT_ID |
OAuth GitHub (optional) |
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_API_URL |
Backend API base URL | http://localhost:8000 |
NEXT_PUBLIC_SOLANA_NETWORK |
Solana network | devnet |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY |
Stripe publishable key |
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/tours |
GET | List tours |
/auth/register |
POST | Register user |
/auth/login |
POST | Login (MFA-aware) |
/auth/me |
GET | Current user |
/bookings |
GET | List bookings |
/payments/stripe |
POST | Process card payment |
/payments/solana |
POST | Record Solana payment |
/dashboard/* |
* | Customer dashboard |
/admin/* |
* | Admin operations |
/communication/* |
* | Chat, forums, broadcasts |
/support/* |
* | AI support & contact |
Full interactive docs: start the backend and visit the route handlers in backend/src/routes/.
# Type-check everything
npm run typecheck
# Production build (backend + frontend)
npm run build
# Start production servers
npm run startcd aws
docker compose up --buildSee aws/README.md for deployment details.
| Script | Description |
|---|---|
npm run dev |
Run frontend + backend in dev mode |
npm run build |
Build both packages |
npm run typecheck |
TypeScript check (no emit) |
npm run db:seed |
Seed SQLite with sample data |
npm run lint |
ESLint (frontend) |
- User selects a tour and opens the payment modal.
- Frontend calls
POST /payments/stripewithpayment_method_id,amount, andtour_id. - Backend confirms with Stripe (or mock mode without
STRIPE_SECRET_KEY). - Booking and payment records are created in SQLite.
- User connects a Solana wallet via
@solana/wallet-adapter. - Transaction is signed client-side; signature is sent to
POST /payments/solana. - Optional Jupiter DEX swap via
frontend/lib/solana.ts.
Register a user, then promote to admin in the database:
UPDATE users SET role = 'admin' WHERE email = 'your@email.com';Or use SQLite CLI:
cd backend
npx tsx -e "import {getDb} from './src/db/database.js'; getDb().prepare(\"UPDATE users SET role='admin' WHERE email=?\").run('your@email.com');"This project was migrated from a Python FastAPI + PostgreSQL stack to a 100% TypeScript codebase:
- Backend: FastAPI → Fastify with SQLite (zero external DB for local dev)
- Frontend: Already TypeScript; configs moved to
.ts/.mjs - Removed: All
.pyfiles, Alembic,requirements.txt, shell deploy scripts
| Issue | Fix |
|---|---|
npm install fails on frontend (Stellar SDK) |
Use npm install --ignore-scripts or rely on frontend/.npmrc |
| Backend port in use | Change PORT in backend/.env |
| Empty tours list | Run npm run db:seed |
| Stripe payments fail | Set STRIPE_SECRET_KEY or use mock mode (no key) |
| CORS errors | Ensure FRONTEND_URL matches your Next.js origin |
For questions, integration support, or custom development:
Telegram: https://t.me/solzen77
MIT