Scout AI is a full-featured adventure travel and expedition-planning frontend built with Next.js 16, React 19, TypeScript, Redux Toolkit / RTK Query, Tailwind CSS 4, and Stripe.
The application combines public adventure content, membership subscriptions, trip-planning workflows, interactive travel maps, user and partner dashboards, article/resource management, and an administrative back office in a single Next.js App Router project.
Project status: The application contains a mixture of production-style integrations and in-progress modules. In particular, the Scout AI trip-planning step is currently marked as under construction and does not yet connect to an AI provider.
- Features
- Tech Stack
- Application Architecture
- Project Structure
- Main Routes
- Prerequisites
- Getting Started
- Environment Variables
- Backend API
- Authentication and Roles
- TripTrax Trip Planning
- Explore Map
- Stripe Membership Payments
- State Management
- Content and Article Management
- Feature Generator Scripts
- Available Scripts
- Deployment
- Security Notes
- Development Notes
- Troubleshooting
- Adventure-focused landing page
- About page
- Contact page
- Membership/pricing page
- Articles and individual article pages
- Privacy policy
- Terms and conditions
- Refund policy
- Responsive navigation and footer
- Dark/light theme support
- Smooth scrolling and animated UI elements
- User registration
- Email OTP verification
- Sign in
- Forgot-password workflow
- Reset-password verification flow
- JWT-based client authentication
- User profile retrieval and updates
- Logout support
- User overview
- Profile management
- Membership information
- Notifications
- Travel trip listing
- Individual trip report pages
- Multi-step trip creation workflow
- Monthly usage UI
The TripTrax module provides an expedition-planning workflow with steps for:
- Adventure mode
- Trip basics
- Group details
- Goals and preferences
- Risk tolerance
- Water requirements
- Scout AI
- Trip review
Trip reports include UI sections for:
- Intel briefing
- Route and navigation
- Weather intelligence
- Expedition lodging
- Gear optimization
- Sustainment
- Safety protocols
- Files/assets
- Mission overview metrics
The Scout AI step currently renders an under-construction state. AI-provider integration still needs to be implemented.
- Mapbox-powered interactive map
- Location search
- Nearby-place discovery
- OpenTripMap integration
- Place-detail retrieval
- Category filters
- Map markers and navigation controls
- Location sidebar/cards
- Route-search UI
- Partnership landing page
- Partner application wizard
- Partnership agreement flow
- Partner account area
- Partner dashboard
- Referral center
- Partner earnings
- Partner content area
- Partner performance UI
- Partnership resource management
Administrative modules include:
- Overview dashboard
- User management
- Trip package management
- Subscription management
- Payment management
- Article management
- Partnership management
- Partner detail views
- Partnership resource management
- Metrics and chart components
- Article listing
- Article details
- Add/edit article UI
- Rich text editing with Tiptap
- Image support
- Article advertisements/affiliations
- Resource management
- CSV export utility
- PDF export utility
- Multiple membership tiers
- Standard and annual billing options
- Stripe Elements checkout
- Server-side Stripe subscription creation
- Payment success page
- Subscription/payment administration UI
| Area | Technology |
|---|---|
| Framework | Next.js 16.2 |
| UI Library | React 19 |
| Language | TypeScript |
| Styling | Tailwind CSS 4, SCSS |
| Component Primitives | Radix UI / shadcn-style components |
| Global State | Redux Toolkit |
| API State | RTK Query |
| Persistence | redux-persist |
| Forms | React Hook Form |
| Validation | Zod |
| Rich Text Editor | Tiptap 3 |
| Maps | Mapbox GL, react-map-gl |
| Travel Places | OpenTripMap API |
| Payments | Stripe, Stripe Elements |
| Tables | TanStack Table |
| Data Fetching | RTK Query, TanStack Query |
| Animation | Framer Motion, Lenis |
| Dates | date-fns, Day.js |
| Icons | Lucide React, React Icons |
| PDF Export | jsPDF, html2canvas-pro |
| CSV Parsing | Papa Parse |
| Notifications | Sonner |
flowchart LR
U[Browser] --> N[Next.js App Router]
N --> UI[React UI / Feature Modules]
UI --> R[Redux Toolkit + RTK Query]
R --> B[External Backend API]
N --> S[Next.js Server Routes]
S --> STRIPE[Stripe API]
S --> OTM[OpenTripMap API]
UI --> MAP[Mapbox]
R --> AUTH[JWT Auth State]
The application uses two main API patterns:
- External application backend — feature modules use RTK Query with
NEXT_PUBLIC_API_URLas the base URL. - Next.js server routes — selected integrations such as Stripe subscription creation and OpenTripMap proxying are handled inside
src/app/api.
.
├── public/ # Static images, logos and icons
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── (admin)/ # Admin route group
│ │ ├── (auth)/ # Authentication routes
│ │ ├── (frontend)/ # Public website routes
│ │ ├── (partnerShip)/ # Partner routes
│ │ ├── (payment)/ # Checkout/payment routes
│ │ ├── (userDashboard)/ # User dashboard routes
│ │ ├── api/ # Next.js API routes
│ │ ├── articles/ # Public articles
│ │ └── explore/ # Explore map
│ │
│ ├── assets/ # Application assets
│ ├── components/ # Shared UI components
│ ├── constants/ # Shared constants/menu configuration
│ ├── features/ # Feature-first modules
│ │ ├── admin/
│ │ ├── affiliation/
│ │ ├── articles/
│ │ ├── auth/
│ │ ├── explore-map/
│ │ ├── member/
│ │ ├── metricksandcharts/
│ │ ├── notification/
│ │ ├── partnership/
│ │ ├── payment/
│ │ ├── resource/
│ │ ├── scoutai/
│ │ ├── triptrax/
│ │ └── user/
│ │
│ ├── hooks/ # Shared React hooks
│ ├── lib/ # Shared libraries/helpers
│ ├── providers/ # Redux, theme and app providers
│ ├── redux/ # Redux store and base RTK Query API
│ ├── styles/ # Shared SCSS
│ ├── types/ # Shared TypeScript types
│ └── utils/ # General utilities
│
├── create-feature.sh # Feature scaffolding helper
├── delete-feature.sh # Feature removal helper
├── eslint.config.mjs
├── next.config.ts
├── package.json
├── postcss.config.mjs
└── tsconfig.json
The feature folders generally follow this pattern:
src/features/example/
├── components/
├── hooks/
├── store/
│ └── example.slice.ts
├── example.api.ts
├── example.constants.ts
├── example.interface.ts
└── example.schema.ts
| Route | Purpose |
|---|---|
/ |
Landing page |
/about |
About Scout AI |
/contact |
Contact page |
/memberships |
Membership plans |
/articles |
Article listing |
/articles/[id] |
Article details |
/explore |
Interactive explore map |
/privacy |
Privacy policy |
/terms |
Terms and conditions |
/refund |
Refund policy |
| Route | Purpose |
|---|---|
/signin |
User sign in |
/register |
Registration |
/verify-email |
Email verification |
/forgot-password |
Forgot password |
/verify-reset-code |
Verify reset code |
/reset-password |
Reset password |
| Route | Purpose |
|---|---|
/user-overview |
Dashboard overview |
/profile |
User profile |
/membership |
User membership |
/notification |
Notifications |
/travel-trips |
Trips |
/travel-trips/[id] |
Trip report/details |
/create-trip-plan |
New trip wizard |
| Route | Purpose |
|---|---|
/partnership |
Partnership landing page |
/partnerShip-apply |
Partner application |
/partnerShip-agreement |
Partnership agreement |
/partners-account |
Partner account |
/partner-dashboard |
Partner dashboard |
/partner-referral |
Referral center |
/partner-earning |
Earnings |
/partner-content |
Partner content |
| Route | Purpose |
|---|---|
/admin-overview |
Admin overview |
/admin/users |
User management |
/admin/users/[id] |
User details |
/admin/trip-packages |
Trip packages |
/admin/trip-packages/[id] |
Trip package details |
/admin/subscriptions |
Subscription management |
/admin/subscriptions/[id] |
Subscription details |
/admin/payments |
Payment management |
/admin/payments/[id] |
Payment details |
/admin/article |
Article management |
/admin/article/add |
Add article |
/admin/article/[id] |
Edit/view article |
/admin/partnerships |
Partnership management |
/admin/partnerships/aii-partners |
All partners |
/admin/partnerships/aii-partners/[id] |
Partner details |
/admin/partnerships/resources |
Partnership resources |
/admin/partnerships/resources/add |
Add resource |
| Route | Purpose |
|---|---|
/checkout |
Stripe checkout |
/checkout/success |
Successful checkout |
Install the following before starting:
- Node.js 20.9.0 or newer
- npm
- Access to the project backend API
- Mapbox access token for map functionality
- OpenTripMap API key for travel-place discovery
- Stripe account and API keys for payment functionality
Node.js >=20.9.0 is required by the installed Next.js version.
git clone <repository-url>
cd <repository-directory>For a reproducible install using the lockfile:
npm ciOr:
npm installCreate a local environment file:
cp .env.example .env.localIf an .env.example file is not present, create .env.local manually using the variables documented below.
npm run devThe project is configured to run on:
http://localhost:3053
The current codebase references the following environment variables.
Create .env.local:
NEXT_PUBLIC_APP_NAME="Scout AI"
NEXT_PUBLIC_APP_URL="http://localhost:3053"
NEXT_PUBLIC_API_URL="https://your-backend-api.example.com"
NEXT_PUBLIC_MAPBOX_TOKEN="your_mapbox_public_token"
NEXT_PUBLIC_OPENTRIPMAP_API_KEY="your_opentripmap_key"
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
NEXT_PUBLIC_STRIPE_SECRET_KEY="sk_test_..."The archive also contains these names, although they are not currently referenced by application code:
NEXT_PUBLIC_ENV="development"
NEXT_PUBLIC_PAYMENT_INTENT_ENDPOINT=""| Variable | Required | Purpose |
|---|---|---|
NEXT_PUBLIC_APP_NAME |
Recommended | Application name used in branding/SEO |
NEXT_PUBLIC_APP_URL |
Recommended | Canonical application URL |
NEXT_PUBLIC_API_URL |
Yes for backend features | Base URL for RTK Query requests |
NEXT_PUBLIC_MAPBOX_TOKEN |
Yes for maps | Mapbox browser token |
NEXT_PUBLIC_OPENTRIPMAP_API_KEY |
Yes for travel places | OpenTripMap access |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY |
Yes for checkout | Stripe.js public key |
NEXT_PUBLIC_STRIPE_SECRET_KEY |
Yes with current code | Stripe server API key |
NEXT_PUBLIC_ENV |
No/currently unused | Environment label |
NEXT_PUBLIC_PAYMENT_INTENT_ENDPOINT |
No/currently unused | Legacy/config placeholder |
Important:
NEXT_PUBLIC_STRIPE_SECRET_KEYshould be renamed to a server-only variable such asSTRIPE_SECRET_KEY. See Security Notes.
Most feature APIs are implemented using RTK Query and send requests to:
process.env.NEXT_PUBLIC_API_URLThe shared API configuration is located at:
src/redux/api/baseApi.ts
Requests use:
credentials: "include"When a token exists in Redux auth state, it is added to the request headers as Authorization.
The frontend expects backend routes such as:
/auth/login
/auth/logout
/otp/send
/otp/verify
/otp/verifyAndIssueToken
/users
/users/register
/users/profile
/articles
/partnership
/payment
/resource
/triptrax
/scoutai
/notification
/member
/admindashboard
/metricksandcharts
/explore-map
/affiliation
Several feature modules use standard CRUD patterns:
GET /resource
GET /resource/:id
POST /resource
PUT /resource/:id
DELETE /resource/:id
The same pattern is scaffolded for multiple feature areas.
The application defines three roles:
ADMIN
USER
PARTNERRole definitions are located in:
src/features/user/user.interface.ts
Role-specific sidebar configuration is located in:
src/constants/sidebarMenu.ts
JWT helper functionality exists in:
src/utils/tokenHandler.ts
It supports:
- Decoding JWT tokens
- Checking token expiration
- Storing tokens in local storage
- Storing tokens in cookies
- Removing stored authentication data
RTK Query reads the current Redux auth token and sends it through the Authorization header.
TripTrax is the main expedition-planning feature.
The trip-creation route is:
/create-trip-plan
Its wizard is implemented under:
src/features/triptrax/components/createNewTrip/
The wizard currently contains eight stages and is driven by a local reducer using the state and reducer definitions from the TripTrax slice.
Trip-report components live under:
src/features/triptrax/components/tripReport/
The Scout AI step is included in the wizard but currently displays:
Under Construction
The previous conversational UI is present as commented code, but there is no active OpenAI, Anthropic, Gemini, or other AI-provider call in the Scout AI implementation included in this codebase.
The explore experience combines Mapbox with OpenTripMap.
Mapbox is used client-side for:
- Interactive maps
- Map navigation
- Location display
- Markers
- Category filtering
- Search-related map behavior
Required variable:
NEXT_PUBLIC_MAPBOX_TOKEN="..."OpenTripMap requests are proxied through Next.js API routes.
Nearby locations:
GET /api/travel-places?lat=<latitude>&lng=<longitude>Place details:
GET /api/travel-places/<xid>The nearby-place route currently searches within a radius of approximately 30 km and limits results before returning named places to the frontend.
Stripe checkout is implemented using:
@stripe/stripe-js@stripe/react-stripe-js- Stripe server SDK
- Stripe Elements
The codebase defines these plan identifiers:
- Core
- Plus
- Prime
- Elite
Each plan supports:
- Standard billing
- Annual billing
Plan configuration is located at:
src/features/payment/components/pricing/data/pricing.ts
The frontend calls:
POST /api/payments/create-intentDespite the route name, the server route currently creates a Stripe subscription with payment_behavior: "default_incomplete" and returns a client secret for Stripe Elements confirmation.
The route is implemented at:
src/app/api/payments/create-intent/route.ts
The current server implementation creates a new temporary Stripe customer during checkout.
For production, retrieve the logged-in user and reuse the user's saved:
stripeCustomerId
This prevents creating a new Stripe customer for every checkout attempt.
Redux is configured in:
src/redux/store.ts
Feature reducers include:
- Auth
- Users
- Notifications
- Scout AI
- TripTrax
- Resources
- Admin dashboard
- Members
- Metrics/charts
- Partnership
- Payments
- Explore map
- Affiliations
- Articles
RTK Query uses a shared baseApi instance.
redux-persist is configured with local web storage on the client and a no-op storage adapter during server rendering.
The current persistence whitelist is empty:
whitelist: []Therefore feature state is not currently persisted through the whitelist, even though the persisted reducer/store infrastructure is enabled.
The article module provides CRUD-style frontend API hooks and rich content editing.
Article routes include:
/articles
/articles/[id]
/admin/article
/admin/article/add
/admin/article/[id]
Tiptap extensions support functionality such as:
- Headings
- Lists
- Blockquotes
- Code blocks
- Images
- Image upload UI
- Highlights
- Text alignment
- Subscript/superscript
- Typography
- Horizontal rules
Additional utility support includes:
src/lib/handlePdfExport.ts
src/utils/exportToCsv.ts
The repository includes Bash scripts for scaffolding feature modules.
./create-feature.sh bookingFor a kebab-case feature:
./create-feature.sh trip-historyThe script creates:
src/features/<feature>/
├── components/
├── hooks/
├── store/
├── <feature>.api.ts
├── <feature>.constants.ts
├── <feature>.interface.ts
└── <feature>.schema.ts
It also attempts to:
- Add the feature reducer to
src/redux/store.ts - Add the feature tag to
src/redux/api/baseApi.ts
Delete an entire feature:
./delete-feature.sh bookingDelete only one generated part:
./delete-feature.sh booking schema
./delete-feature.sh booking interface
./delete-feature.sh booking slice
./delete-feature.sh booking api
./delete-feature.sh booking hooks
./delete-feature.sh booking components
./delete-feature.sh booking constantsThese scripts use Unix shell tools such as
bash,sed,grep, andrm. On Windows, run them through Git Bash or WSL.
npm run devRuns Next.js development mode on port 3053.
npm run buildCreates an optimized production build.
npm run startStarts the production server on port 3053.
npm run lintThe current package.json maps this command to:
next lint
If linting fails because of CLI compatibility with the installed Next.js version, run ESLint directly and update the package script, for example:
npx eslint .The project can be deployed to platforms that support Next.js 16 and Node.js 20+, including Vercel or a Node.js server/container.
Before deployment:
- Configure the production backend URL.
- Configure the production application URL.
- Add the Mapbox token.
- Add the OpenTripMap key.
- Configure Stripe publishable and secret keys.
- Replace any placeholder Stripe Price IDs with real recurring Stripe Price IDs.
- Verify backend CORS and credential settings.
- Verify role-based route protection.
- Confirm all environment secrets are stored only in the hosting platform's secret manager/environment configuration.
- Build the app locally before deployment.
Build with:
npm run buildStart with:
npm run startThe production server listens on port:
3053
The current server route reads:
NEXT_PUBLIC_STRIPE_SECRET_KEYVariables beginning with NEXT_PUBLIC_ are intended for browser-exposed configuration in Next.js.
A Stripe secret key should never be treated as public configuration.
Recommended change:
STRIPE_SECRET_KEY="sk_..."Then update the server route to use:
process.env.STRIPE_SECRET_KEYThe OpenTripMap key is already consumed through server routes, so it can also be renamed from:
NEXT_PUBLIC_OPENTRIPMAP_API_KEYto:
OPENTRIPMAP_API_KEYunless it is intentionally needed in browser code later.
This supplied code archive contains .env and .env.local files.
Do not commit real keys or credentials to source control.
The current .gitignore ignores .env*.local, but it does not broadly ignore .env.
A safer setup is:
.env
.env.*
!.env.exampleKeep only placeholder values inside .env.example.
next.config.ts currently permits remote images from wildcard HTTP and HTTPS hosts.
For production, restrict remotePatterns to the specific domains that the application actually needs.
Client-side role menus are useful for navigation but should not be treated as authorization.
Admin and partner permissions must also be validated on the backend/server side.
The project uses:
@/* → ./src/*
Example:
import { Button } from "@/components/ui/button";The root layout uses Google fonts through next/font:
- Space Grotesk
- Work Sans
Theme support is provided through next-themes and a custom ThemeProvider.
Reusable primitives live mainly in:
src/components/ui/
The codebase uses Radix UI primitives along with Tailwind utility classes.
Both RTK Query and TanStack Query are installed. The primary feature API pattern in the current source is RTK Query.
No automated test script or dedicated test suite is currently configured in package.json.
For long-term maintenance, consider adding unit/component and end-to-end tests for authentication, checkout, trip creation, and role-based access.
This project does not use the default Next.js port 3000.
Open:
http://localhost:3053
Verify:
NEXT_PUBLIC_API_URL="..."Also confirm that the backend accepts the frontend origin and supports credentialed requests if cookies are required.
Verify:
NEXT_PUBLIC_MAPBOX_TOKEN="..."Restart the development server after changing environment variables.
Verify the OpenTripMap key and test:
/api/travel-places?lat=23.8103&lng=90.4125
A missing key causes the server route to return an error.
Verify:
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_..."For the current implementation, the server also requires the Stripe secret environment variable used by src/app/api/payments/create-intent/route.ts.
Check:
src/features/payment/components/pricing/data/pricing.ts
Each active membership/billing option must contain a valid recurring Stripe price_... ID.
This is expected in the current codebase. The active Scout AI wizard step is intentionally marked under construction and has no AI backend/provider connected yet.
For production readiness, the most important follow-up tasks are:
- Move Stripe and OpenTripMap secrets to server-only environment variables.
- Remove real environment files from source control history if they have ever been committed.
- Complete the Scout AI server/provider integration.
- Connect any remaining mock/admin UI sections to live backend endpoints.
- Add server-enforced role authorization.
- Reuse existing Stripe customers instead of creating a new customer for every checkout.
- Add automated testing for critical user flows.
- Restrict wildcard remote-image domains.
No license file is included in the supplied codebase. Add an appropriate license before distributing the project publicly.
Built for Scout AI.