-
Install Dependencies
npm install
-
Set Up Environment Variables
Copy
.env.exampleto.envand fill in your values:# On Windows (PowerShell) Copy-Item .env.example .env # On Linux/Mac cp .env.example .env
Then edit
.envand replace the placeholder values with your actual credentials. -
Set Up PostgreSQL Database
If using Docker Compose, the database will be automatically initialized:
docker-compose -f docker-compose.dev.yml up
For manual setup:
- Install PostgreSQL 17
- Create a database:
createdb token_meme - The database schema will be automatically migrated on first app startup
Note: Database migrations run automatically on startup using versioned migration files with MD5 checksum verification. No manual SQL execution needed!
The migration system will:
- Read migration files from
migrations/directory in version order - Track applied migrations in
schema_migrationstable - Only apply new or changed migrations (detected via MD5 checksum)
- Create all required tables automatically
-
Add Admin Wallet (Optional)
You can add additional admin wallets via PostgreSQL:
INSERT INTO admin_wallets (wallet_address) VALUES ('your_wallet_address_here');
-
Run Development Server
npm run dev
-
Build for Production
npm run build npm start
# Build the image
docker build -t token-meme .
# Run locally
docker run -p 3000:3000 --env-file .env token-meme-
Enable required APIs
gcloud services enable cloudbuild.googleapis.com gcloud services enable run.googleapis.com
-
Build and push to Google Container Registry
export PROJECT_ID=your-project-id docker build -t gcr.io/$PROJECT_ID/token-meme . docker push gcr.io/$PROJECT_ID/token-meme
-
Deploy to Cloud Run
gcloud run deploy token-meme \ --image gcr.io/$PROJECT_ID/token-meme \ --platform managed \ --region us-central1 \ --allow-unauthenticated \ --set-env-vars="DATABASE_URL=postgresql://user:password@host:5432/dbname,NEXT_PUBLIC_SOLANA_NETWORK=devnet,ADMIN_WALLET_ADDRESS=..."
Or use the Google Cloud Console to set environment variables through the UI.
- The app uses
devnetby default. ChangeNEXT_PUBLIC_SOLANA_NETWORKtomainnet-betafor production. - Admin access is granted to wallets specified in
ADMIN_WALLET_ADDRESSenv var or in theadmin_walletstable. - The database schema is automatically initialized when using Docker Compose.