Know Before You Go is a web application that helps users prepare for traveling to different countries. It provides comprehensive destination information including cultural norms, daily life tips, health advice, language guides, payment methods, transportation options, and safety information. Users can match with and compare destinations and find the most important information about the country. International Offices of Universities can mantain and update the information for each country based on feedback of students in a Content Management System (CMS).
Demo available under: Know Before You Go
- Next.js (v16) - React framework with App Router
- React (v19) - UI library
- Tailwind CSS (v4) - Utility-first CSS framework
- Radix UI / shadcn/ui - Accessible, unstyled UI primitives
- Recharts - Charting library
- PayloadCMS (v3) - Headless Content Management System
- tRPC (v11) - End-to-end typesafe APIs
- TanStack Query - Data fetching & caching
- Zod - TypeScript-first schema validation
- PostgreSQL - Primary database
- ESLint (v9) - JavaScript/TypeScript linting
- eslint-config-next - Next.js specific ESLint rules
- eslint-plugin-tailwindcss - Tailwind CSS class linting
- Prettier - Code formatter
- prettier-plugin-tailwindcss - Automatic Tailwind class sorting
- Husky - Git hooks management
- lint-staged - Run linters on staged files
- Commitlint - Enforce conventional commit messages
KnowBeforeYouGo/
├── public/ # Static assets
│ └── images/ # Image assets
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── (app)/ # Main application routes
│ │ │ ├── _components/ # Page-specific components
│ │ │ ├── compare/ # Destination comparison page
│ │ │ ├── destination/ # Destination detail pages
│ │ │ │ └── [slug]/ # Dynamic destination routes
│ │ │ ├── match-finder/ # Match finder feature
│ │ │ └── data-privacy/ # Legal pages
│ │ ├── (payload)/ # PayloadCMS admin routes
│ │ │ ├── admin/ # CMS admin dashboard
│ │ │ └── api/ # CMS API routes
│ │ └── api/ # general API routes handled by tRPC
│ │ └── trpc/
│ ├── collections/ # PayloadCMS collection definitions
│ │ ├── categories/ # Category collections
│ │ └── custom-fields/ # Custom field definitions
│ ├── components/ # Reusable UI components
│ │ ├── ui/ # Base UI components (shadcn/ui)
│ │ └── charts/ # Chart components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utility functions & types
│ └── server/ # Server-side code
│ └── routers/ # tRPC routers
If you don't have docker installed, follow its installation guide.
If you don't have pnpm installed, follow its installation guide.
Example ways to install pnpm:
- (MacOS)
brew install pnpm - Using
npm:npm install -g pnpm
Create postgres migration:
Postgres has to be running for this. See Starting App
- for dev:
pnpm run payload migrate
pnpm run payload migrate:create
- for prod:
NODE_ENV=production pnpm run payload migrate
NODE_ENV=production pnpm run payload migrate:create
- test prod:
NODE_ENV=production pnpm run build
NODE_ENV=production pnpm run start
Define your environment variables in .env as described in .example.env
Use the following commands to generate secrets:
PAYLOAD_SECRET:openssl rand -hex 32DATABASE_AUTH_TOKEN:node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
Run docker compose -f dev.docker-compose.yml up
- Run
pnpm install - Run
pnpm dev
Open http://localhost:3000 with your browser to see the frontend. Open http://localhost:3000/admin to get to the PayloadCMS admin dashboard
- Pre-Commit Hooks with Husky
- ESLint -> Linting
- Prettier -> Formatting
- Commitlint -> Commit Message Validation
Following the Conventional Commits specification, we use the following types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)refactor: A code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding missing tests or correcting existing testsbuild: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)chore: Other changes that don't modify src or test filesrevert: Reverts a previous commit
Following the Conventional Branch specification, we use the following branch names/prefixes:
main: The main development branchfeat/: A new featurefix/: A bug fixhotfix/: A hotfixrelease/: For branches preparing a releasechore/: For non-code tasks like dependency, docs updates
Examples:
feat/new-sidebarfix/broken-linkhotfix/broken-linkrelease/v1.0.0chore/update-deps
This project is licensed under the MIT License.