Project Settings & Configuration


Folder Structure

The overall folder structure of the project is as follows.

text
project/
├── .envs    ---> env variables
├── apps     ---> your apps folder
│   ├── auditlogs
│   ├── accounts --> custom inertia views for login.
│   ├── contrib
│   ├── common
│   ├── dashboard. --> everything for the control panel
│   ├── payments --> stripe integration and utils
│   ├── rolepermissions
│   ├── reports
│   ├── tenants --> workspaces/tenants
│   ├── users
│   └── webhooks
├── config ---> config module, includes app settings
│   ├── settings 
│       ├── base.py
│       ├── local.py
│       ├── test.py
│       └── production.py
│   ├── roles.py       --> config for the app roles here. 
│   ├── urls.py        --> url routing
│   ├── api.py  --> api routes
│   ├── asgi.py       --> async & sse
│   ├── wsgi.py       --> sync app callable
├── assets ---> JS frontend components & tailwindcss file
│   └── js.  
│       ├── pages     ---> frontend pages
│       ├── hooks    ---> hooks including api
│       ├── lib     ---> utils
│       ├── layouts   ---> frontend layouts for the dashboard/app
│       ├── components   ---> shadcn components
│       ├── app.jsx  ---> entry point
│       ├── ssr.js  ---> TODO.
│   └── css.        ---> styles
├── requirements  ---> app requirements
└── static        ---> static js andcss files
│    ├── dist     ---> bundled assets
├── templates        ---> app templates

Config Module & Project Settings

This is the Django project root directory. It's where the project settings, root urlconf ( urls.py & api_router.py ) asgi.py , wsgi.py are located.

  • Settings are organized by environment and all inherit from base.py which includes settings that are common across in environments. production.py and test.py include settings for your development and test environments.

  • api.py contains the definition for all the django ninja api routes.

  • roles.py - role definitions for app wide roles and permissions.

The apps module

This is where you can find the project's apps.

It is pre-populated with Vanty's default apps for you to further customize to your needs.

The module starts with the following apps.

  • tenants is where your tenant models and logic is defined.

  • payments is for functionality related to Stripe subscriptions.

  • users is where your user models and views are defined.

  • rolespermissions is roles and permissions app (new in v.0.14)

  • common logic/models and utilities shared across all apps.

  • dashboard admin dashboard for managing the app

  • audit-logs audit logs app

  • webhooks audit logs app

  • reports SQL reports

The assets folder

Source files for your site's front end. Currently includes the tailwindcss styles and javascript.

Here is a quick run down of the frontend layout

  1. js : This is where all your JavaScript files reside. It’s further divided into several subfolders:

    • pages : This folder contains all the page components. In the context of Inertia, each file in this directory corresponds to a single page in your application.

    • hooks : This folder is for hooks, which are reusable pieces of code that contain side effects for your components. If you’re using React with Inertia, this could include custom hooks that interact with your API.

    • lib : This is a place for utility functions and libraries that are used across different parts of your application.

    • layouts : This folder contains layout components. These are higher-order components that wrap around your page components and provide common structure or styling.

    • components : This folder is for shared components, which are smaller reusable pieces of UI that can be used across multiple pages.

    • app.jsx : This is the entry point of your application. It’s where you initialize Inertia and define your root component.

    • ssr.js : This file is for server-side rendering (SSR). Although Inertia doesn’t support SSR out of the box, you might add it in the future.

  2. css : This folder contains all your CSS files. If you’re using a utility-first CSS framework like Tailwind CSS, you might have a main file here where you import Tailwind’s directives and add your custom styles.

The static folder

This folder contains your project's static files, including the compiled output files from the assets folder as well as images.

The templates folder

This folder only contains templates for emails, layouts and the base template.

The dashboard layout template is in templates/layouts

  • Email templates can be found in templates/templated_email

  • Inertia template in layouts/inertia.html

  • base template in the templates folder