Project Structure
The NextNative project structure follows a consistent organization to help you navigate and build your application effectively.
Root Directory
app/
- Contains the main application code, pages, and components. You'll be working inside of it 99% of your time.assets/
- Static assets like images and fonts. Learn more here (opens in a new tab).db/
- Database-related filesicons/
- Icon components and assets that were generated (opens in a new tab) fromassets/
folder.ios/
andandroid/
- Native platform-specific codelib/
- Utility functions and shared codeprisma/
- Prisma ORM configuration and schemapublic/
- Static files served directlyscripts/
- Utility scriptsservices/
- API services and external integrationsstorage/
- Storage utilities
App Directory
The app/
directory uses Next.js App Router architecture and contains platform-specific code:
(mobile)/
- Contains cross-platform components and pages that will be statically generated with Next.js'soutput: export
. Uses IonicRouter to create native-like animated transitions for mobile navigation.(web)/
- Contains the web landing page to market your app and web-specific components that are server-side rendered and use Next.js routing.api/
- Next.js API routesi18n/
- Internationalization files and configurationglobals.css
- Global CSS styleslayout.tsx
- Root layout component that wraps all pagespage.tsx
- Main entry page of the application. By default, it imports the cross-platform code. If you need to have a landing page in a single codebase, follow this tutorial.not-found.tsx
- Custom 404 error pageopengraph-image.png
- Default Open Graph image for social sharingfavicon.ico
- Website favicon
Configuration Files
capacitor.config.ts
- Capacitor configuration for native appsconfig.ts
- Application configurationnext.config.js
- Next.js configurationtailwind.config.js
- Tailwind CSS configurationtsconfig.json
- TypeScript configuration.env
- Environment variables (use.env.example
as a template)
Getting Started
For more information on how to use this project structure, refer to the GETTING_STARTED.md
file in the root directory.