|
4 | 4 | ---
|
5 | 5 | ## Project Structure
|
6 | 6 |
|
7 |
| -- the `./src` directory is the source code |
8 |
| -- the `./test` directory is the test code |
9 |
| -- the `./bin` directory is the command-line code |
10 |
| - - you can also call the CLI via `./clarity ...` |
11 |
| -- the `./docs` directory is the documentation |
| 7 | +### App Directory |
| 8 | + |
| 9 | +`./app` directory is the source where the business logic resides. |
| 10 | + |
| 11 | +- `./app/Actions` directory is the source of truth for all actions |
| 12 | +- `./app/Commands` directory is the source of truth for all commands |
| 13 | +- `./app/Jobs` directory is the source of truth for all jobs |
| 14 | +- `./app/Listeners` directory is the source of truth for all listeners |
| 15 | +- `./app/Models` directory is the source of truth for all models |
| 16 | +- `./app/Notifications` directory is the source of truth for all notifications |
| 17 | + |
| 18 | +### Cloud Directory |
| 19 | + |
| 20 | +`./cloud` directory is the source where the cloud logic resides. |
| 21 | + |
| 22 | +- `./cloud/recipes` directory is where the cloud recipes reside that can be used when creating a new server. Similar to Laravel Forge recipes |
| 23 | +- `./cloud/deploy-script.ts` is the scripts that is triggered when a deployment in the cloud is made |
| 24 | +- `./cloud/Dockerfile` is the Dockerfile that is used to build the Docker image for the cloud |
| 25 | +- `./cloud/serverless.ts` is where the automated CDK stack is defined. Used to define the serverless services |
| 26 | +- `./cloud/servers.ts` is where the servers are defined that can be used when creating a new server. Define EC2 instances, load balancers, web servers, app servers, worker servers, etc. |
| 27 | + |
| 28 | +### Config Directory |
| 29 | + |
| 30 | +`./config` directory is where the configuration for the project resides. |
| 31 | + |
| 32 | +- `./config/ai.ts` is where the AI configuration is defined |
| 33 | +- `./config/app.ts` is where the application configuration is defined |
| 34 | +- `./config/cache.ts` is where the cache configuration is defined |
| 35 | +- `./config/database.ts` is where the database configuration is defined |
| 36 | +- `./config/dns.ts` is where the DNS configuration is defined |
| 37 | +- `./config/email.ts` is where the email configuration is defined |
| 38 | +- `./config/git.ts` is where the git configuration is defined |
| 39 | +- `./config/hashing.ts` is where the hashing configuration is defined |
| 40 | +- `./config/logging.ts` is where the logging configuration is defined |
| 41 | +- `./config/mail.ts` is where the mail configuration is defined |
| 42 | +- `./config/notification.ts` is where the notification configuration is defined |
| 43 | +- `./config/payment.ts` is where the payment configuration is defined |
| 44 | +- `./config/security.ts` is where the security configuration is defined |
| 45 | +- `./config/services.ts` is where the services configuration is defined |
| 46 | +- `./config/storage.ts` is where the storage configuration is defined |
| 47 | +- `./config/team.ts` is where the team configuration is defined |
| 48 | +- `./config/ui.ts` is where the UI configuration is defined |
| 49 | + |
| 50 | +### Database Directory |
| 51 | + |
| 52 | +`./database` directory is where the database logic resides. |
| 53 | + |
| 54 | +- `./database/migrations` directory is where the migrations are defined which likely are auto generated by the ORM, unless the user adds custom migrations (buddy migrate) |
| 55 | +- `./database/seeder.ts` is where the seeder is defined which is used to seed the database (buddy seed) |
| 56 | + |
| 57 | +### Docs Directory |
| 58 | + |
| 59 | +`./docs` directory is where the VitePress documentation resides. |
| 60 | + |
| 61 | +### Public Directory |
| 62 | + |
| 63 | +`./public` directory is where the public assets reside. |
| 64 | + |
| 65 | +You would place your static assets in this directory. Anything in this directory will be available on the web, exposed behind your domain name, the APP_URL in the .env file. |
| 66 | + |
| 67 | +### Resources Directory |
| 68 | + |
| 69 | +The `./resources` directory is where the resources reside. |
| 70 | + |
| 71 | +- `./resources/assets` _directory where the assets reside_ |
| 72 | +- `./resources/assets/fonts` _directory where the fonts reside_ |
| 73 | +- `./resources/assets/styles` _directory where the CSS resides_ |
| 74 | +- `./resources/assets/styles/docs/` _directory where the Documentation CSS resides_ |
| 75 | +- `./resources/components` _directory where the user components reside. These are auto imported into the frontend_ |
| 76 | +- `./resources/components/Dashboard` _directory where the dashboard User components reside. If they clashed with default components, these will take precedence_ |
| 77 | +- `./resources/components/Docs` _directory where the documentation components reside, which will be auto imported into the documentation_ |
| 78 | +- `./resources/emails` _directory where the emails reside_ |
| 79 | +- `./resources/functions` _directory where the functions/composables reside_ |
| 80 | +- `./resources/lang` _directory where the language files reside_ |
| 81 | +- `./resources/layouts` _directory where the layouts reside_ |
| 82 | +- `./resources/modules` _directory where the modules reside_ |
| 83 | +- `./resources/plugins` _directory where the plugins reside_ |
| 84 | +- `./resources/stores` _directory where the stores reside_ |
| 85 | +- `./resources/types` _directory where the types reside_ |
| 86 | +- `./resources/views` _directory where the views reside_ |
| 87 | + |
| 88 | +## Routes Directory |
| 89 | + |
| 90 | +The `./routes` directory is where the routes reside. |
| 91 | + |
| 92 | +- `./routes/api.ts` _the API routes file_ |
| 93 | +- `./routes/web.ts` _the web routes file_ |
| 94 | +- `./routes/buddy.ts` _the buddy routes file (/buddy/...)_ |
| 95 | +- `./routes/users.ts` _the users routes file (/users/...)_ |
| 96 | + |
| 97 | +## Storage Directory |
| 98 | + |
| 99 | +The `./storage` directory is where the storage resides, and the core logic of the framework. |
| 100 | + |
| 101 | +- `./storage/framework` _the framework storage directory_ |
| 102 | +- `./storage/framework/api` _the API storage directory_ |
| 103 | +- `./storage/framework/actions` _the actions storage directory_ |
| 104 | +- `./storage/framework/browser-auto-imports.json` _the browser auto imports file_ |
| 105 | +- `./storage/framework/server-auto-imports.json` _the server auto imports file_ |
| 106 | +- `./storage/framework/cache` _the cache storage directory_ |
| 107 | +- `./storage/framework/cloud` _the cloud storage directory_ |
| 108 | +- `./storage/framework/config` _the config storage directory_ |
| 109 | +- `./storage/framework/core` _the core storage directory is where the core logic of the framework resides_ |
| 110 | +- `./storage/framework/core/actions` _the core actions package_ |
| 111 | +- `./storage/framework/core/analytics` _the core analytics package_ |
| 112 | +- `./storage/framework/core/alias` _the core alias package_ |
| 113 | +- `./storage/framework/core/api` _the core api package_ |
| 114 | +- `./storage/framework/core/arrays` _the core arrays package_ |
| 115 | +- `./storage/framework/core/auth` _the core auth package_ |
| 116 | +- `./storage/framework/core/browser` _the core browser package_ |
| 117 | +- `./storage/framework/core/build` _the core build package_ |
| 118 | +- `./storage/framework/core/bun-create` _the core bun-create package_ |
| 119 | +- `./storage/framework/core/calendar` _the core calendar package_ |
| 120 | +- `./storage/framework/core/chat` _the core chat package_ |
| 121 | +- `./storage/framework/core/cli` _the core cli package_ |
| 122 | +- `./storage/framework/core/config` _the core config package_ |
| 123 | +- `./storage/framework/core/cron` _the core cron package_ |
| 124 | +- `./storage/framework/core/database` _the core database package_ |
| 125 | +- `./storage/framework/core/datetime` _the core datetime package_ |
| 126 | +- `./storage/framework/core/dns` _the core dns package_ |
| 127 | +- `./storage/framework/core/docs` _the core docs package_ |
| 128 | +- `./storage/framework/core/events` _the core events package_ |
| 129 | +- `./storage/framework/core/faker` _the core faker package_ |
| 130 | +- `./storage/framework/core/git` _the core git package_ |
| 131 | +- `./storage/framework/core/health` _the core health package_ |
| 132 | +- `./storage/framework/core/http` _the core http package_ |
| 133 | +- `./storage/framework/core/lint` _the core lint package_ |
| 134 | +- `./storage/framework/core/logging` _the core logging package_ |
| 135 | +- `./storage/framework/core/mail` _the core mail package_ |
| 136 | +- `./storage/framework/core/notifications` _the core notifications package_ |
| 137 | +- `./storage/framework/core/objects` _the core objects package_ |
| 138 | +- `./storage/framework/core/payments` _the core payments package_ |
| 139 | +- `./storage/framework/core/query-builder` _the core query-builder package_ |
| 140 | +- `./storage/framework/core/real-time` _the core real-time package_ |
| 141 | +- `./storage/framework/core/realtime` _the core realtime package_ |
| 142 | +- `./storage/framework/core/registry` _the core registry package_ |
| 143 | +- `./storage/framework/core/router` _the core router package_ |
| 144 | +- `./storage/framework/core/scheduler` _the core scheduler package_ |
| 145 | +- `./storage/framework/core/security` _the core security package_ |
| 146 | +- `./storage/framework/core/strings` _the core strings package_ |
| 147 | +- `./storage/framework/core/testing` _the core testing package_ |
| 148 | +- `./storage/framework/core/tunnel` _the core tunnel package_ |
| 149 | +- `./storage/framework/core/ui` _the core ui package_ |
| 150 | +- `./storage/framework/core/validation` _the core validation package_ |
| 151 | +- `./storage/framework/core/vite-config` _the core vite-config package_ |
| 152 | +- `./storage/framework/core/vite-plugin` _the core vite-plugin package_ |
| 153 | +- `./storage/framework/core/whois` _the core whois package_ |
| 154 | +- `./storage/framework/core/x-ray` _the core x-ray package_ |
| 155 | +- `./storage/framework/docs` _the docs storage directory_ |
| 156 | +- `./storage/framework/libs` _the libs storage directory_ |
| 157 | +- `./storage/framework/requests` _the requests storage directory_ |
| 158 | +- `./storage/framework/types` _the types storage directory_ |
| 159 | +- `./storage/framework/views` _the views storage directory_ |
| 160 | +- `./storage/keys` _the keys storage directory_ |
| 161 | +- `./storage/private` _the private storage directory—files that get uploaded to the server, but not exposed to the web_ |
| 162 | +- `./storage/public` _the public storage directory—files that get exposed to the web_ |
| 163 | + |
| 164 | +### Tests Directory |
| 165 | + |
| 166 | +The `./tests` directory is where the Bun tests reside. |
| 167 | + |
| 168 | +- `./tests/unit` _directory where the unit tests reside_ |
| 169 | +- `./tests/features` _directory where the features tests reside_ |
| 170 | +- `./tests/setup.ts` _setup script for the tests_ |
0 commit comments