https://github.com/marcjulian/aba
angular better-auth
https://github.com/marcjulian/aba
angular angular-ssr better-auth nitrojs nx spartan-ui trpc
Last synced: 5 days ago
JSON representation
angular better-auth
- Host: GitHub
- URL: https://github.com/marcjulian/aba
- Owner: marcjulian
- License: mit
- Created: 2026-05-04T15:26:35.000Z (30 days ago)
- Default Branch: main
- Last Pushed: 2026-05-11T10:49:24.000Z (23 days ago)
- Last Synced: 2026-05-11T12:42:35.057Z (23 days ago)
- Topics: angular, angular-ssr, better-auth, nitrojs, nx, spartan-ui, trpc
- Language: TypeScript
- Homepage:
- Size: 578 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aba - Angular + Better Auth
1. [Angular](https://angular.io/) the frontend framework for building web applications
2. [Better Auth](https://www.better-auth.com/) the authentication framework
3. [spartan/ui](https://spartan.ng/) accessible, customizable components for Angular applications
4. [tRPC](https://trpc.io/) end-to-end typesafe APIs
5. [Prisma](https://www.prisma.io/) database migration and ORM
6. [NX](https://nx.dev/) monorepo tool for managing multiple applications and libraries in a single repository
## Quick Start
Install dependencies
```bash
pnpm install
```
Copy the `.env.dev` file and fill in the `BETTER_AUTH_SECRET` and `BETTER_AUTH_URL` values.
```bash
cp .env.dev .env
```
Start postgres database with docker compose
```bash
docker compose up -d
```
Run the prisma migration to create the database and tables:
```bash
pnpm prisma migrate dev
```
Serve the analog app
```bash
pnpm start
```
Visit [localhost:5173](http://localhost:5173) to see the app running.
Sign up a new user and than you can seed the database with dummy data
```bash
pnpm prisma db seed
```
### Better Auth
Run the following command to update prisma schema base on the Better Auth configuration:
```bash
# generate schema
pnpm dlx auth@latest generate --config apps/api/server/utils/auth.ts
```
### Prisma
Run the following command to create the database and run the migrations:
```bash
pnpm prisma migrate dev
```
Generate the Prisma client:
```bash
pnpm prisma generate
```
## App SSR
Build app and run app locally allowing access from localhost
```bash
pnpm build
NG_ALLOWED_HOSTS=localhost,127.0.0.1 node dist/apps/app/server/server.mjs
```
## Apps in Docker
To run the application in Docker, update the `.env` file to point to the docker container names instead of `localhost` (database, redis, rustfs, better-auth).
The dockerfiles for the apps require the apps to be built first before starting the container.
```bash
pnpm build
```
Start the containers in detached mode:
```bash
docker compose -f compose.prod.yml up -d
```
When you rebuild the app use this command to rebuild the docker images:
```bash
docker compose -f compose.prod.yml up -d --build
```