Build and Run Guide
A. Running Locally without Docker
Clone and Setup:
git clone https://github.com/PSMRI/ubi-strapi-provider.git cd ubi-strapi-provider/strapi nvm use 18 # Ensure correct Node version npm install # Using npm as specified in project setup
Configure Environment:
cp .env.example .env
Update .env with required configuration:
# Strapi DB DATABASE_CLIENT=postgres DATABASE_HOST=127.0.0.1 DATABASE_PORT=5432 DATABASE_NAME=uba_provider DATABASE_USERNAME=strapi_db_user DATABASE_PASSWORD=strapi_db_pass # Strapi Secrets (Generate using: openssl rand -base64 32) JWT_SECRET= APP_KEYS= API_TOKEN_SALT= ADMIN_JWT_SECRET= TRANSFER_TOKEN_SALT=
Start PostgreSQL Database:
docker-compose up postgres -d
Start Development Server:
cd strapi npm run develop # Using npm as specified in project setup
B. Running with Docker
Configure Environment:
cp .env.example .env
Additional Docker-specific variables:
# PGAdmin (if needed) PGADMIN_DEFAULT_EMAIL= PGADMIN_DEFAULT_PASSWORD= # Set to production for Docker deployment NODE_ENV=production
Start Database Services:
# Start PostgreSQL and PgAdmin docker-compose up postgres pgadmin -d
Build and Start Strapi:
# Build fresh image docker-compose build --no-cache strapi # Start Strapi service docker-compose up strapi -d
Monitor and Manage:
# View logs docker-compose logs -f strapi # Stop all services docker-compose down
Access Points
Admin Panel: http://localhost:1337/admin
API Documentation: http://localhost:1337/documentation
API Endpoints: http://localhost:1337/api/
Use
?populate=*
to get all component details
Project Structure
Key files for deployment:
Dockerfile
- Strapi container configurationdocker-compose.yml
- Service orchestrationdeploy.sh
- Deployment script
Reference Documentation
Important Notes
The project uses npm for package management.
TypeScript is enabled by default
PostgreSQL SSL is disabled by default
Custom collections can be created via Strapi admin UI
Node.js version 18.x is required
Last updated