DIRECTORY LAYOUT.
How your project should be organized for deployment on Boottify. Every app needs a Dockerfile and environment configuration.
PROJECT STRUCTURE
A Boottify project follows standard conventions for containerized web applications. The platform builds your app from a Dockerfile and injects environment variables at runtime.
my-app/
├── Dockerfile # Required - container build instructions
├── docker-compose.yml # Optional - local development setup
├── .env # Environment variables (never committed)
├── .env.example # Template for required env vars
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── next.config.ts # Framework configuration (Next.js)
├── prisma/
│ └── schema.prisma # Database schema
├── public/ # Static assets (images, fonts)
└── src/
├── app/ # Pages and API routes
├── components/ # Reusable UI components
├── hooks/ # Custom React hooks
├── lib/ # Server utilities and services
├── types/ # TypeScript type definitions
└── proxy.ts # Request middleware (Next.js 16)DOCKERFILE
Every Boottify app requires a Dockerfile in the project root. The platform uses it to build a container image that runs in a Kubernetes cluster. A multi-stage build keeps the final image small and secure.
# Build stage
FROM node:22-alpine AS builder
RUN apk add --no-cache openssl openssl-dev
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npx prisma generate
RUN npm run build
# Production stage
FROM node:22-alpine AS runner
RUN apk add --no-cache openssl
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 appuser
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
RUN chown -R appuser:nodejs /app
USER appuser
EXPOSE 3000
CMD ["node", "server.js"]CONFIGURATION FILES
package.json
Defines dependencies, scripts, and project metadata. Must include build and start scripts.
.env / .env.example
Environment variables for your app. The .env file is never committed. Include a .env.example with placeholder values as a template for other developers.
docker-compose.yml
Optional. Defines multi-container setups for local development (app + database + Redis). Not used during Boottify deployment.
prisma/
Database schema and migrations. The schema.prisma file defines your data models, and the Prisma client is generated during the Docker build.
docker-compose.yml Example
version: "3.8"
services:
app:
build: .
ports:
- "3000:3000"
env_file:
- .env
depends_on:
- db
- redis
db:
image: mysql:8
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: myapp
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
db_data:SOURCE DIRECTORY
The src/ directory contains all application code. Boottify apps use the Next.js App Router pattern with route groups for organization.
src/app/
Pages and API routes using the App Router. Route groups like (auth) and (control-center) organize protected and public areas.
src/components/
Reusable React components organized by feature: ui/ for primitives, landing/ for marketing, control/ for dashboard.
src/lib/
Server-side utilities, service modules, and business logic. Includes auth, billing, deployment, email, and infrastructure services.
src/hooks/
Custom React hooks for shared client-side logic like data fetching, debouncing, pagination, and media queries.
src/types/
Shared TypeScript type definitions and interfaces used across the application.
public/
Static files served at the root URL. Images, fonts, favicons, and other assets that do not require processing.
ENVIRONMENT VARIABLES
Environment variables are configured through the Boottify dashboard after deployment. During local development, use a .env file in the project root.
Never commit .env files to version control. Add .env and .env.local to your .gitignore.
.env.example
# Database
DATABASE_URL="mysql://user:password@localhost:3306/myapp"
# Authentication
AUTH_SECRET="your-auth-secret"
# Redis
REDIS_URL="redis://localhost:6379"
# External Services
STRIPE_SECRET_KEY="sk_test_..."
GITHUB_CLIENT_ID="..."
GITHUB_CLIENT_SECRET="..."