- Node.js 20+ installed
- PostgreSQL 14+ installed and running
- Redis (optional, for caching)
- npm or yarn
cd wallet-backend
# Install dependencies
npm install
# Copy environment file
cp .env.example .env
# Edit .env with your local database credentials
# Update DATABASE_URL with your PostgreSQL connection string
# Generate Prisma client
npm run prisma:generate
# Run database migrations
npm run prisma:migrate
# Start development server
npm run devBackend will run on http://localhost:4000
cd wallet-frontend
# Install dependencies
npm install
# Copy environment file
cp .env.example .env.local
# Edit .env.local - NEXT_PUBLIC_API_URL should be http://localhost:4000
# Start development server
npm run devFrontend will run on http://localhost:3002
# Start PostgreSQL
docker run --name wallet-postgres \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=wallet_db \
-p 5432:5432 \
-d postgres:14
# Start Redis (optional)
docker run --name wallet-redis \
-p 6379:6379 \
-d redis:7-alpine- Create database:
CREATE DATABASE wallet_db;- Update
.envwith your connection string:
DATABASE_URL="postgresql://username:password@localhost:5432/wallet_db?schema=public"
Required:
DATABASE_URL- PostgreSQL connection stringJWT_SECRET- Secret key for JWT tokens (generate random string)ENCRYPTION_KEY- 32 character key for encryption
Optional:
REDIS_URL- Redis connection (for caching)PORT- Server port (default: 4000)CORS_ORIGIN- Frontend URL (default: http://localhost:3002)
Required:
NEXT_PUBLIC_API_URL- Backend API URL (default: http://localhost:4000)
cd wallet-backend
# Create a new migration
npm run prisma:migrate
# Apply migrations
npx prisma migrate deploy
# Open Prisma Studio (database GUI)
npm run prisma:studio-
Backend Health Check:
curl http://localhost:4000/health
Should return:
{"status":"ok","service":"taskforce-wallet-api"} -
Frontend: Open
http://localhost:3002in browser Should show login page -
Register a User:
- Go to
/register - Create an account
- Should redirect to dashboard
- Go to
-
Create a Wallet:
- After login, go to dashboard
- Click "Create Wallet"
- Select a blockchain (Ethereum, Solana, or Bitcoin)
- Verify PostgreSQL is running:
pg_isready - Check DATABASE_URL format in .env
- Ensure database exists:
psql -l | grep wallet_db
- Regenerate Prisma client:
npm run prisma:generate - Reset database (WARNING: deletes all data):
npx prisma migrate reset
- Backend: Change
PORTin.env - Frontend: Change port in
package.jsondev script or use-pflag
- Redis is optional - backend will work without it (caching disabled)
- To disable Redis warnings, remove
REDIS_URLfrom.env
-
Backend changes:
- Edit files in
wallet-backend/src/ - Server auto-reloads with
npm run dev - Run
npm run buildto check for TypeScript errors
- Edit files in
-
Frontend changes:
- Edit files in
wallet-frontend/src/ - Next.js auto-reloads with
npm run dev - Run
npm run type-checkto check for TypeScript errors
- Edit files in
-
Database changes:
- Edit
wallet-backend/prisma/schema.prisma - Run
npm run prisma:migrateto create migration - Migration will be applied automatically in dev mode
- Edit
Once local setup is working:
- Test all features (register, login, create wallet, send crypto, payments)
- Fix any bugs
- Then proceed with Railway deployment