Previous.js Project Structure
This page provides an overview of the file and folder structure of a Previous.js project. It covers top-level files and folders, configuration files, and routing conventions within the app
and pages
directories.
Top-level folders
app/ | App Router |
components/ | App Components |
data/ | App Data |
previous/ | Previous.js Core |
public/ | Static assets to be served |
Top-level files
start | .bat .sh | Start the web server |
build | .bat .sh | Build into static files |
Routing Conventions
Page Routes
app/page.js | .js .html | Main Page |
app/*/page.js | .js .html | Page |
Layout Routes
app/layout.js | .js .html | Root Layout |
app/*/layout.js | .js .html | Layout |
API Routes
app/route.js | .js | API endpoint |
app/*/route.js | .js | API endpoint |
Advanced Routes
app/*/[param]/* | .js .html | Dynamic route segment |
app/_folder/* | .js | Ignored route paths |
Error Routes
app/404.js | .js | 404 Custom Not Found Page |
app/500.js | .js | 500 Custom Error Page |
Public Files Conventions
public/favicon | .ico .png | Favicon file |
public/icon | .ico .jpg .jpeg .png .svg | App Icon file |
public/apple-icon | .jpg .jpeg .png | Apple App Icon file |
public/img/* | .ico .jpg .jpeg .png .svg | Image files |
public/js/* | .js | JavaScript files |
public/css/* | .css | Stylesheet files |
public/vendor/library/* | .* | Vendor Library files |