Skip to content

Commit f70084a

Browse files
authored
feat: add advanced features (#135)
* Setup tools for local development * Remove unused config * feat(services): add redis as php extensions * feat(docker-compose): Use env files from folders instead of root env file * feat(services): implement container role * feat(api): update default env * feat(api): update dev command * feat(api): implement snowflake ids and roles/permissions * feat(api): guard pulse * feat(api): gate telescope * feat(api): disable telescope on default * feat(api): update env to default options * feat(api): implement is admin flag and migrate permission to this because we only use this for internal tools like telescope and pulse we don't need to expose this flag * feat(api): implement spatie permission teams as organizations because this is in a feature branch we do not create a new migration and ignore the breaking change against this feature branch * feat(vscode): add new extensions for development * feat(docs): move dev docker compose docs to develop * fix(chore): remove old zip version of project * feat(vscode): add laravel artisan extension * feat(api): add is default and is owner to roles table * feat(api): remove roles and permission seeder * feat(api): implement permissions enum * feat(api): add first version of organization classes * feat(api): migrate route function to app controller * feat(api): implement own models for roles and permissions * fix(api): add missing table to migration * feat(api): implement roles for organizations * feat(api): add a first basic debug route for testing * docs(api): add docs to disable organization feature * feat(api): disable fortify views * feat(apps): first auth version with basic registration and csrf token support * feat(apps): implement basic api call logic * feat(apps): disable direct register call * feat(apps): set semi to true * feat(apps): refactor api logic * feat(api): lint code * style: run lint and format * feat(apps): add dev components and add basic layout * feat(api): add Laravel Auditing * feat(api): add support for multiple languages * fix(apps): ssr error on watch * feat(apps): refactor api logic * feat(apps): refactor api and basic register implementation * fix(docker): fix wrong user * feat(api): setup basic password rules * feat(apps): refactor api logic to better support ssr * feat(apps): refactor api code to make it cleaner * fix(blog): use correct app name * feat(apps): improve form validation ux on errors * feat(api): implement health service * feat(api): move health to own database * chore: add iconify extension * feat(apps): refactor auth layouts and implement logout * fix(api): remove unneeded provider registration * feat(apps): improve logout and prepare resend email verification * featt(api): basic overwrite of emails for fortify * feat(apps): implement email resend of email verification * feat(apps): implement email verification * feat(api): change default session cookie * fix(apps): alert container shows margin even if slot is empty * feat(api): update dependencies * feat(apps): update dependencies * feat(api): prohibit destructive commands * feat(apps): improve submit handling * feat(apps): improve form ux/ui * feat(apps): improve form ui/ux * feat(apps): implement password forgot * featt(api): publish notification view * feat(api): allow pulse view on local * feat(apps): migrate auth pages to base package and put them behind a feature flag * feat(apps): improve code * feat(apps): remove unused code * feat(apps): implement password reset * feat(api): add app urls * feat(api): implement laravel horizion * fix(apps): remove dev comment * feat(app): start implementation of dashboard * feat(apps): implement remeber me logic * fix(apps): checkbox and toggle style * feat(scripts): update naming * feat(apps): placeholder logic for a basic dashboard * fix(api): add missing drop table * feat(api): add first_name and last_name * feat(api): add user organization * feat(api): improve organizations me logic by migration endpoint to me endpoint * fix(apps): toggle track style * feat(apps): add exmple code * feat(apps): improve dashboard ui * fix(app): type error on search groups * feat(apps): improve dashboard setup logic (better use of ssr and csr) * feat(apps): migrate texts to local file * feat(apps): extend default settings pages * feat(apps): improve sidebar * feat(apps): improve settings * feat(apps): implement account update and password confirm * chore: update all dependencies * chore: lint code * chore: format code * feat(github): add php extensions * feat(github): add php extensions * fix(apps): adjust placeholder test to pass * fix(services): add missing php extension
1 parent 2cb3eff commit f70084a

File tree

204 files changed

+17344
-2879
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+17344
-2879
lines changed

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
APP_NUXT_UI_PRO_LICENSE="<your-license-key>"
2-
APP_FORMKIT_PRO_KEY="<your-formkit-key>"
1+
# Docker
2+
COMPOSE_PROJECT_NAME="saas-template"

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ module.exports = {
77
parserOptions: {
88
project: true,
99
},
10-
}
10+
};

.github/workflows/ci-cd.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ jobs:
148148
with:
149149
working_dir: "services/api"
150150
php_version: '8.3'
151+
php_extensions: bcmath pcntl
151152

152153
- name: Cache composer dependencies
153154
uses: actions/cache@v4
@@ -180,6 +181,7 @@ jobs:
180181
uses: shivammathur/setup-php@v2
181182
with:
182183
php-version: '8.3'
184+
extensions: bcmath, pcntl
183185

184186
- name: Install node dependencies
185187
run: pnpm install
@@ -265,6 +267,7 @@ jobs:
265267
uses: shivammathur/setup-php@v2
266268
with:
267269
php-version: '8.3'
270+
extensions: bcmath, pcntl
268271

269272
- name: Restore composer dependencies cache for service "api"
270273
if: needs.files-changed.outputs.service_api == 'true'
@@ -335,6 +338,7 @@ jobs:
335338
uses: shivammathur/setup-php@v2
336339
with:
337340
php-version: '8.3'
341+
extensions: bcmath, pcntl
338342

339343
- name: Restore composer dependencies cache for service "api"
340344
if: needs.files-changed.outputs.service_api == 'true'

.prettierrc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ const config = {
44
// tailwindConfig: './packages/ui/tailwind.config.ts',
55
endOfLine: 'lf',
66
printWidth: 100,
7-
semi: false,
7+
semi: true,
88
singleQuote: true,
99
tabWidth: 2,
1010
trailingComma: 'es5',
1111
useTabs: false,
1212
vueIndentScriptAndStyle: true,
13-
}
13+
};
1414

15-
module.exports = config
15+
module.exports = config;

.vscode/extensions.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
22
"recommendations": [
3+
"antfu.iconify",
34
"dbaeumer.vscode-eslint",
45
"esbenp.prettier-vscode",
5-
"vue.volar",
6+
"jacano.vscode-pnpm",
7+
"ms-azuretools.vscode-docker",
8+
"open-southeners.laravel-pint",
69
"richie5um2.vscode-sort-json",
7-
"open-southeners.laravel-pint"
10+
"ryannaddy.laravel-artisan",
11+
"vue.volar"
812
]
913
}

README.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The saas-template is a template for building SaaS applications. It combines the capabilities of Laravel and Nuxt in a unified repository and accelerates the development of web applications. Seamlessly integrates the back-end reliability of Laravel with the front-end agility of Nuxt. Ideal for rapid prototyping and deployment.
44

5-
## Features
5+
## General
66

77
To manage the repository, it uses the pnpm package manager and turborepo.
88

@@ -121,6 +121,22 @@ To develop all apps and packages, run the following command:
121121
pnpm dev
122122
```
123123

124+
### dev.docker-compose.yml
125+
126+
To run all needed services locally, you can use the `dev.docker-compose.yml` file. You can run the following command to start the services:
127+
128+
```Shell
129+
docker-compose -f dev.docker-compose.yml up
130+
```
131+
132+
Below is a list of services you can access via browser.
133+
134+
| Service | URL | Description |
135+
| --- | --- | --- |
136+
| adminer | [http://localhost:8080](http://localhost:8080) | Database management tool. |
137+
| redis-commander | [http://localhost:8081](http://localhost:8081) | Redis management tool. |
138+
| mailpit | [http://localhost:8085](http://localhost:8085) | A simple SMTP server for development. |
139+
124140
## Linting and formatting
125141

126142
To lint and format all apps and packages, run the following command:
@@ -194,3 +210,29 @@ After that you can copy the generated icons to the `@tituskirch/font-awesome-pro
194210
```Shell
195211
pnpm copy
196212
```
213+
214+
After that you can remove the line `icons: ['fa6-solid'],` from `packages/app-base/nuxt.config.ts` and uncomment the lines below it. You can also uninstall the package `@iconify-json/fa6-solid` from `@tituskirch/app-base`. After that you can mass replace the `fa6-solid` with `fal` in the code.
215+
216+
## Features
217+
218+
### Localization
219+
220+
To add a new language to the backend you can run the following command (all available languages can be found [here](https://laravel-lang.com/available-locales-list.html)):
221+
222+
```Shell
223+
cd services/api/
224+
php artisan lang:add {LANGUAGE_CODE}
225+
cd ../..
226+
```
227+
228+
To update the translations you can run the following command:
229+
230+
```Shell
231+
cd services/api/
232+
php artisan lang:update
233+
cd ../..
234+
```
235+
236+
### Organization
237+
238+
To disable the organization feature, you can set `teams` to `false` inside of the `services/api/config/permission.php` file. You also want to remove the migrations with organization in the name and the migration `services/api/database/migrations/2024_05_15_115605_add_is_default_and_is_owner_to_roles_table.php`. After that you should be able to user this template with the remaining Organization features. If you want to remove the organization feature completely, you can search the code for `Organization` and remove the code/files or adjust the code to your needs.

app.docker-compose.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
version: '3.9'
2+
3+
secrets:
4+
NUXT_UI_PRO_LICENSE:
5+
environment: APP_NUXT_UI_PRO_LICENSE
6+
FORMKIT_PRO_KEY:
7+
environment: APP_FORMKIT_PRO_KEY
8+
9+
networks:
10+
app_network:
11+
driver: bridge
12+
13+
services:
14+
blog:
15+
container_name: blog
16+
build:
17+
context: .
18+
dockerfile: ./apps/Dockerfile
19+
args:
20+
- APP_NAME=@tituskirch/blog
21+
- APP_PATH=apps/blog
22+
secrets:
23+
- NUXT_UI_PRO_LICENSE
24+
- FORMKIT_PRO_KEY
25+
env_file:
26+
- ./apps/blog/.env
27+
restart: always
28+
ports:
29+
- 3001:3000
30+
networks:
31+
- app_network
32+
web:
33+
container_name: web
34+
build:
35+
context: .
36+
dockerfile: ./apps/Dockerfile
37+
args:
38+
- APP_NAME=@tituskirch/web
39+
- APP_PATH=apps/web
40+
secrets:
41+
- NUXT_UI_PRO_LICENSE
42+
- FORMKIT_PRO_KEY
43+
env_file:
44+
- ./apps/web/.env
45+
restart: always
46+
ports:
47+
- 3000:3000
48+
networks:
49+
- app_network
50+
api-app:
51+
container_name: api-app
52+
build:
53+
context: .
54+
dockerfile: ./services/Dockerfile
55+
args:
56+
- SERVICE_NAME=@tituskirch/api
57+
- SERVICE_PATH=services/api
58+
env_file:
59+
- ./services/api/.env
60+
environment:
61+
CONTAINER_ROLE: app
62+
PULSE_SERVER_NAME: api-app
63+
ports:
64+
- '8000:8000'
65+
66+
api-scheduler:
67+
container_name: api-scheduler
68+
build:
69+
context: .
70+
dockerfile: ./services/Dockerfile
71+
args:
72+
- SERVICE_NAME=@tituskirch/api
73+
- SERVICE_PATH=services/api
74+
env_file:
75+
- ./services/api/.env
76+
environment:
77+
CONTAINER_ROLE: scheduler
78+
PULSE_SERVER_NAME: api-scheduler
79+
80+
api-queue:
81+
container_name: api-queue
82+
build:
83+
context: .
84+
dockerfile: ./services/Dockerfile
85+
args:
86+
- SERVICE_NAME=@tituskirch/api
87+
- SERVICE_PATH=services/api
88+
env_file:
89+
- ./services/api/.env
90+
environment:
91+
CONTAINER_ROLE: queue
92+
PULSE_SERVER_NAME: api-queue
93+
94+
api-pulse-worker:
95+
container_name: api-pulse-worker
96+
build:
97+
context: .
98+
dockerfile: ./services/Dockerfile
99+
args:
100+
- SERVICE_NAME=@tituskirch/api
101+
- SERVICE_PATH=services/api
102+
env_file:
103+
- ./services/api/.env
104+
environment:
105+
CONTAINER_ROLE: pulse-worker
106+
PULSE_SERVER_NAME: api-pulse-worker

apps/blog/.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
NUXT_UI_PRO_LICENSE="<your-nuxt-ui-license>"
2-
FORMKIT_PRO_KEY="<your-formkit-key>"
2+
FORMKIT_PRO_KEY="<your-formkit-key>"
3+
API_URL="http://localhost:8000"

apps/blog/eslint.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import withNuxt from './.nuxt/eslint.config.mjs'
1+
import withNuxt from './.nuxt/eslint.config.mjs';
22

3-
export default withNuxt()
3+
export default withNuxt();

apps/blog/histoire.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import histoireConfig from '../../packages/app-base/histoire.config'
2-
export default histoireConfig
1+
import histoireConfig from '../../packages/app-base/histoire.config';
2+
export default histoireConfig;

0 commit comments

Comments
 (0)