Skip to main content

File Structure

After successfully running the platform locally, the next step is to understand the structure of the program. This way, you can quickly find the corresponding folders for modification when modifying various functions. The main structure of the program is listed below, with explanations to follow.

OneDayBuild β‘ 
β”œβ”€β”€ app β‘‘
β”‚ β”œβ”€β”€ [locale]
β”‚ β”‚ β”œβ”€β”€ (dashboard) β‘’
β”‚ β”‚ β”‚ β”œβ”€β”€ (route)
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ agentui
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ ai
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ dashboard
β”‚ β”‚ β”‚ β”‚ └── setting
β”‚ β”‚ β”‚ └── layout.js
β”‚ β”‚ └── (site) β‘£
β”‚ β”‚ β”‚ β”œβ”€β”€ (auth)
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ changepassword
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ login
β”‚ β”‚ β”‚ β”‚ └── register
β”‚ β”‚ β”‚ β”œβ”€β”€ privacy-policy
β”‚ β”‚ β”‚ β”œβ”€β”€ theme
β”‚ β”‚ β”‚ β”œβ”€β”€ tos
β”‚ β”‚ β”‚ └── layout.js
β”‚ β”‚ β”œβ”€β”€ layout.js
β”‚ β”‚ └── page.jsx
β”‚ └── api β‘€
β”‚ β”œβ”€β”€ ...
β”‚ └── api
β”œβ”€β”€ components β‘₯
β”‚ β”œβ”€β”€ ...
β”‚ └── components...jsx
β”œβ”€β”€ libs ⑦
β”‚ β”œβ”€β”€ i18n
β”‚ β”‚ └── messages
β”‚ β”‚ β”‚ β”œβ”€β”€ en.json
β”‚ β”‚ β”‚ └── cn.json
β”‚ β”œβ”€β”€ themes
β”‚ β”‚ └── providers.js
β”‚ β”œβ”€β”€ faqs.js
β”‚ β”œβ”€β”€ prismadb.jsx
β”‚ └── seo.js
β”œβ”€β”€ prisma β‘§
β”‚ └── schema.prisma
β”œβ”€β”€ public ⑨
β”‚ └── img
β”œβ”€β”€ .env
β”œβ”€β”€ config.js
β”œβ”€β”€ middleware.js
β”œβ”€β”€ next.config.js
β”œβ”€β”€ package.json
β”œβ”€β”€ README.md
└── tailwind.config.js

β‘  Root Directory​

Since this is a standard Next.JS program, the contents in the root directory are also standard. Some directories include:

  • app: Main location of the program.
  • components: Location of all used components.
  • libs: Location of platform function libraries.
  • public: Location of platform-related resources, such as images accessible directly through URLs.
  • .env and config.js: Described in the Platform Configuration section.

β‘‘ app​

We believe that a SaaS platform typically consists of two parts. The part before the user logs in, we call the frontend program, which is usually a website program for users to browse and obtain information. After logging in, we call it the backend program, where users typically perform operations on the interface. The contents in the app folder include:

  • [locale]: i18n required file structure, if you do not have i18n needs, we will follow up with a source code without i18n functionality, so that there is no such layer of directory
  • (dashboard) in [locale] contains the backend program, while (site) contains the frontend program.
  • The api folder contains API information needed for various third-party services.
  • The page.jsx under [locale] is the homepage of the platform website. If your first step after obtaining the platform is to quickly build a website, you can start by modifying this page.

β‘’ dashboard​

OneDayBuild provides several functions for users to enter the backend, which you can use directly if needed:

  • (dashboard) folder includes pages and programs displayed after successful login, with the folder name in parentheses so it doesn't appear in the URL.
  • UI provides a UI material library, Completed based on shadcn/ui.
  • ai provides an AI assistant chat interface, with the interface implemented using Vercel's Chat module. You can set up the assistant's persona and chat directly. Changing the persona setup allows you to provide services directly.
  • setting is the interface for modifying user profiles. Every login system has a user basic information database behind it, and users can modify their information through the interface after logging in, which is necessary for a SaaS platform. To prevent programmers from wasting time on these tedious but necessary tasks, OneDayBuild provides the interface and source code for the entire function.

β‘£ site​

The contents in the site folder are for the frontend program. Except for the homepage, all other content can be placed here.

  • auth folder provides programs for login, registration, and password recovery. A password recovery function for users who forget their password during the login process is also essential. To prevent programmers from wasting time on these tedious but necessary tasks, OneDayBuild also provides the source code for this part.
  • privacy-policy The site's policy statement page. We not only provide the page's source code but also provide a method for generating the statement content. With the help of ChatGPT and the prompts we provide, you can generate professional statement content.
  • tas The TERMS & SERVICES page of the site. Similar to the policy page, we also provide a method for generating content.
  • theme Contains fonts, interface effects, and animations provided by OneDayBuild for developers. These meet the effects needed in the general website production process and are easy to use and quickly effective.

β‘€ API​

This folder contains all the APIs for third-party service integration.

β‘₯ Components​

The components used by the platform can be found here.

  • Components starting with Front are related to website content.
  • Components starting with Change are related to the password recovery feature's pages.
  • Components starting with Profile are interfaces for modifying personal information.

⑦ libs​

libs folder mainly contains some encapsulated services, platform basic data processing, and some auxiliary functions.

This folder includes the configuration and language packs for i18n, seo, prismaDB, etc. If you have no objections to these services, you don't need to modify existing files.

β‘§ prisma​

The platform provided by OneDayBuild uses Prisma with Next.js to link to the database.

The files in this folder are description files for schema. For specific usage, please refer here.

⑨ public​

This folder contains public files that can be accessed directly through URLs. Generally, files that require absolute addresses can be placed here, such as images and videos.