### Quick Start with Docker Compose Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Essential commands for quickly starting, viewing logs, and stopping the entire application stack using Docker Compose. This is recommended for new users to get the environment running. ```bash # Start the entire stack (recommended for new users) npm run docker:up # View logs npm run docker:logs # Stop everything npm run docker:down ``` -------------------------------- ### Vercel Deployment with External Database Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Guide for deploying the application to Vercel and integrating with an external managed PostgreSQL database. It covers local Vercel CLI setup and environment variable configuration. ```bash npm i -g vercel vercel # Push schema to your managed database npm run db:push ``` -------------------------------- ### Starting PostgreSQL with Docker (Bash) Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Starts the PostgreSQL database service within a Docker container. This is the recommended method for setting up the database, providing a consistent environment. ```bash npm run db:up ``` -------------------------------- ### Environment Variables Setup (Bash) Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Copies the example environment file to a new file named `.env`. This file will store sensitive configuration settings and should not be committed to version control. The default values are set to work with the Docker setup. ```bash cp .env.example .env ``` -------------------------------- ### Starting Production Server (Bash) Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Starts the production-ready server after the application has been built. This command is used for deploying and running the application in a live environment. ```bash npm start ``` -------------------------------- ### Local Development Setup and Database Operations Source: https://github.com/amaryourbae/aviba-app/blob/main/documentation/technical_specification_document.md This bash script outlines the essential commands for setting up the Aviba application locally. It includes installing dependencies, copying environment variables, and performing database operations such as generation, migration, and seeding. Finally, it starts the development server. ```bash # Setup npm install cp .env.example .env.local # Database npm run db:generate npm run db:migrate npm run db:seed # Development npm run dev ``` -------------------------------- ### Starting Development Server (npm, yarn, pnpm) Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Starts the development server using Turbopack. This command is used during development to see changes live. It will typically run on http://localhost:3000. ```bash npm run dev ``` ```bash yarn dev ``` ```bash pnpm dev ``` -------------------------------- ### Start a Specific Task with task-manager Source: https://github.com/amaryourbae/aviba-app/blob/main/CLAUDE.md This command marks a specific task as started, indicating that work has begun on it. It is mandatory to run this before implementing any task. ```bash task-manager start-task ``` -------------------------------- ### Installing Dependencies (npm, yarn, pnpm) Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Installs project dependencies using common package managers. This step is crucial after cloning the repository to ensure all necessary libraries are available. ```bash npm install ``` ```bash yarn install ``` ```bash pnpm install ``` -------------------------------- ### Production Deployment with Docker Compose Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Steps for deploying the application using Docker Compose on a VPS or server. This includes cloning the repository, configuring environment variables, and starting the stack. ```bash git clone cd codeguide-starter-fullstack cp .env.example .env # Edit .env with production values DATABASE_URL=postgresql://postgres:your_secure_password@postgres:5432/postgres POSTGRES_DB=postgres POSTGRES_USER=postgres POSTGRES_PASSWORD=your_secure_password BETTER_AUTH_SECRET=your-very-secure-secret-key BETTER_AUTH_URL=https://yourdomain.com NEXT_PUBLIC_BETTER_AUTH_URL=https://yourdomain.com npm run docker:up ``` -------------------------------- ### Discover Available Tasks with task-manager Source: https://github.com/amaryourbae/aviba-app/blob/main/CLAUDE.md This command lists all available tasks in the system. It is the mandatory first step before starting any task to understand the scope of work. ```bash task-manager list-tasks ``` -------------------------------- ### Docker Profile for Development Database Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Shows how to use Docker Compose profiles to start the development database on a specific port, or alternatively, use the provided npm script for the same purpose. ```bash # Start development database on port 5433 docker-compose --profile dev up postgres-dev -d # Or use the npm script npm run db:dev ``` -------------------------------- ### Package Lockfile Example Source: https://github.com/amaryourbae/aviba-app/blob/main/documentation/security_guideline_document.md Committing lockfiles like `package-lock.json` or `pnpm-lock.yaml` ensures deterministic dependency installations across different environments, preventing unexpected version conflicts and potential security issues from subtly different dependency trees. ```json // Example content of package-lock.json { "name": "aviba-app", "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "aviba-app", "version": "0.1.0", "license": "MIT", "dependencies": { "react": "^18.2.0" } }, "node_modules/react": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react/-/react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X0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0gX0 ``` -------------------------------- ### Production Deployment Configuration (Bash) Source: https://context7.com/amaryourbae/aviba-app/llms.txt Provides environment variable examples and command-line instructions for deploying the application to Vercel, VPS, or containerized cloud platforms using Docker. It includes steps for setting up environment variables and building/running Docker images. ```bash # .env.example - Environment variables template # Development Environment Variables DATABASE_URL=postgresql://postgres:postgres@localhost:5433/postgres POSTGRES_DB=postgres POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres # Authentication BETTER_AUTH_SECRET=your_secret_key_here BETTER_AUTH_URL=http://localhost:3000 NEXT_PUBLIC_BETTER_AUTH_URL=http://localhost:3000 # Production deployment steps for Vercel # 1. Install Vercel CLI npm i -g vercel # 2. Deploy to Vercel vercel # 3. Set environment variables in Vercel dashboard: # - DATABASE_URL: postgresql://user:pass@host:5433/db # - BETTER_AUTH_SECRET: generate-secure-32-char-key # - BETTER_AUTH_URL: https://your-app.vercel.app # - NEXT_PUBLIC_BETTER_AUTH_URL: https://your-app.vercel.app # 4. Push database schema to production npm run db:push # Docker production deployment # 1. Build Docker image docker build -t codeguide-starter-fullstack . # 2. Start full stack with Docker Compose docker compose up -d # 3. View logs docker compose logs -f ``` -------------------------------- ### Docker Application Stack Management Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Offers npm scripts for building and managing the application's Docker image and services. This includes starting, stopping, viewing logs, and cleaning up Docker resources. ```bash npm run docker:build # Build application Docker image npm run docker:up # Start full application stack (app + database) npm run docker:down # Stop all containers npm run docker:logs # View container logs npm run docker:clean # Stop containers and clean up volumes ``` -------------------------------- ### Database Management Commands Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Provides npm scripts for managing the PostgreSQL database, including starting, stopping, and updating the schema. These commands facilitate local development and schema synchronization. ```bash npm run db:up # Start PostgreSQL in Docker npm run db:down # Stop PostgreSQL container npm run db:dev # Start development PostgreSQL (port 5433) npm run db:dev-down # Stop development PostgreSQL npm run db:push # Push schema changes to database npm run db:generate # Generate Drizzle migration files npm run db:studio # Open Drizzle Studio (database GUI) npm run db:reset # Reset database (drop all tables and recreate) ``` -------------------------------- ### Complete a Task with task-manager Source: https://github.com/amaryourbae/aviba-app/blob/main/CLAUDE.md This command marks a task as completed after implementation. A brief description of the work done is required. This is a mandatory step. ```bash task-manager complete-task "Brief description of what was implemented" ``` -------------------------------- ### Content Security Policy Example Source: https://github.com/amaryourbae/aviba-app/blob/main/documentation/security_guideline_document.md Defines trusted sources for content like scripts, styles, and images to mitigate cross-site scripting (XSS) attacks. This example policy allows resources from the same origin and a specific CDN for scripts, and the same origin plus inline styles. ```plaintext Content-Security-Policy: default-src 'self'; script-src 'self' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline'; ``` -------------------------------- ### Manage Dockerized PostgreSQL Databases with npm Scripts Source: https://context7.com/amaryourbae/aviba-app/llms.txt A set of npm scripts to manage Dockerized PostgreSQL instances, including starting/stopping production and development databases, starting the full stack application with databases, viewing container logs, and cleaning up Docker resources. These scripts simplify local development and deployment workflows. ```bash # Start production database npm run db:up # Equivalent to: docker compose up postgres -d # Start development database (port 5433) npm run db:dev # Equivalent to: docker compose --profile dev up postgres-dev -d # Stop databases npm run db:down npm run db:dev-down # Start full stack (app + database) npm run docker:up # Equivalent to: docker compose up -d # View container logs npm run docker:logs # Clean up containers and volumes npm run docker:clean ``` -------------------------------- ### Docker Health Check Configuration Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Example of how to add a HEALTHCHECK instruction to the Dockerfile to define a health check for the application container, ensuring it's running correctly. ```dockerfile # In Dockerfile, add health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD curl -f http://localhost:3000/api/health || exit 1 ``` -------------------------------- ### Docker Compose PostgreSQL Configuration Source: https://github.com/amaryourbae/aviba-app/blob/main/documentation/security_guideline_document.md Example configuration for running PostgreSQL within Docker, emphasizing security best practices like running as a non-root user and exposing only necessary ports during development. ```yaml services: db: image: postgres user: "postgres:postgres" environment: POSTGRES_PASSWORD: your_strong_password ports: - "5432:5432" ``` -------------------------------- ### Pushing Database Schema (Bash) Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Applies the database schema defined in the project to the connected PostgreSQL database. This command is used after setting up the database, either via Docker or local setup. ```bash npm run db:push ``` -------------------------------- ### Default Environment Variables (.env) Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Example environment variables for the project, including database and authentication settings. The default values are configured for Docker. The `BETTER_AUTH_SECRET` should be replaced with a strong, unique key. ```env # Database Configuration (defaults work with Docker) DATABASE_URL=postgresql://postgres:postgres@localhost:5433/postgres POSTGRES_DB=postgres POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres # Authentication BETTER_AUTH_SECRET=your_secret_key_here BETTER_AUTH_URL=http://localhost:3000 NEXT_PUBLIC_BETTER_AUTH_URL=http://localhost:3000 ``` -------------------------------- ### Configure Drizzle Kit for PostgreSQL Migrations (TypeScript) Source: https://context7.com/amaryourbae/aviba-app/llms.txt Configuration file for Drizzle Kit, specifying the output directory for migrations, the location of schema files, the database dialect (postgresql), and database credentials loaded from environment variables. This setup is used for managing database schema changes. ```typescript // drizzle.config.ts - Drizzle Kit configuration import 'dotenv/config'; import { defineConfig } from 'drizzle-kit'; export default defineConfig({ out: './drizzle', schema: './db/schema/*', dialect: 'postgresql', dbCredentials: { url: process.env.DATABASE_URL!, }, }); ``` -------------------------------- ### Environment Configuration for Aviba App Source: https://github.com/amaryourbae/aviba-app/blob/main/documentation/technical_specification_document.md This snippet shows example environment variables required for the Aviba application. It covers database connection, application URL, authentication secrets, AI integration keys, and AWS S3 credentials. These variables are crucial for setting up the application's backend services and integrations. ```bash # Database DATABASE_URL=postgresql://... NEXT_PUBLIC_APP_URL=https://your-domain.com # Authentication BETTER_AUTH_SECRET=your-secret-key BETTER_AUTH_URL=https://your-domain.com # AI Integration GEMINI_API_KEY=your-gemini-api-key # File Storage AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... AWS_REGION=... AWS_S3_BUCKET=... ``` -------------------------------- ### Next.js API Route for Better Auth (TypeScript) Source: https://context7.com/amaryourbae/aviba-app/llms.txt Sets up the Next.js API route handler for Better Auth, enabling authentication endpoints. This file integrates the server-side Better Auth configuration with Next.js's routing system, handling both GET and POST requests for authentication. ```typescript // app/api/auth/[...all]/route.ts - API route handler import { auth } from "@/lib/auth"; import { toNextJsHandler } from "better-auth/next-js"; export const { POST, GET } = toNextJsHandler(auth); ``` -------------------------------- ### Building and Pushing Docker Image Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Instructions for building a Docker image of the application and pushing it to a container registry, preparing it for deployment on cloud platforms. ```bash # Build the image docker build -t your-registry/codeguide-starter-fullstack:latest . # Push to registry docker push your-registry/codeguide-starter-fullstack:latest ``` -------------------------------- ### shadcn/ui Component Integration Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Demonstrates how to add new components to the project using the shadcn/ui CLI. This enables quick integration of pre-styled and customizable UI elements. ```bash npx shadcn@latest add [component-name] ``` -------------------------------- ### Cloning the Repository (Bash) Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Clones the project repository using Git and navigates into the project directory. No specific inputs are required other than the repository URL. ```bash git clone cd codeguide-starter-fullstack ``` -------------------------------- ### Development Workflow Options Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Presents two primary development workflow options: running the database locally with the app in Docker, or running the entire stack (app and database) within Docker. This caters to different development preferences. ```bash # Option 1: Database only (develop app locally) npm run db:up # Start PostgreSQL npm run dev # Start Next.js development server # Option 2: Full Docker stack npm run docker:up # Start both app and database ``` -------------------------------- ### Cancel a Task with task-manager Source: https://github.com/amaryourbae/aviba-app/blob/main/CLAUDE.md This command cancels a task if it cannot be completed or is no longer needed. A reason for cancellation must be provided. This is a mandatory alternative to completing a task. ```bash task-manager cancel-task "Reason for cancellation" ``` -------------------------------- ### Building for Production (Bash) Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Builds the application for production using Turbopack. This command optimizes the application for deployment, creating static assets and server bundles. ```bash npm run build ``` -------------------------------- ### Production Environment Variables Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Lists essential and optional environment variables required for a production deployment, including database credentials, authentication secrets, and optimization settings. ```env # Required for production DATABASE_URL=postgresql://user:password@host:port/database BETTER_AUTH_SECRET=generate-a-very-secure-32-character-key BETTER_AUTH_URL=https://yourdomain.com # Optional optimizations NODE_ENV=production ``` -------------------------------- ### Local Database Configuration (.env) Source: https://github.com/amaryourbae/aviba-app/blob/main/README.md Configuration for connecting to a local PostgreSQL database. These variables should be set in the `.env` file. Ensure your local PostgreSQL instance is running and accessible. ```env DATABASE_URL=postgresql://username:password@localhost:5432/database_name POSTGRES_DB=your_database_name POSTGRES_USER=your_username POSTGRES_PASSWORD=your_password ```