Skip to content

Commit

Permalink
feat: add setup files
Browse files Browse the repository at this point in the history
  • Loading branch information
risv1 committed Oct 24, 2024
1 parent b8bb580 commit f3d35fb
Show file tree
Hide file tree
Showing 14 changed files with 126 additions and 8,498 deletions.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM oven/bun:1.0-slim as builder

WORKDIR /app

COPY package.json bun.lockb ./

RUN bun install --frozen-lockfile

COPY . .

RUN bun run build

FROM oven/bun:1.0-slim

WORKDIR /app

COPY --from=builder /app/.output /app/.output
COPY --from=builder /app/.nuxt /app/.nuxt
COPY --from=builder /app/package.json /app/package.json

EXPOSE 3000

ENV NODE_ENV=production

CMD ["bun", "run", ".output/server/index.mjs"]


16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
run:
@bun run dev

build-client:
@bun run generate
@bunx serve .output/public

build:
@bun run build
@bun .output/server/index.mjs

format:
@bunx biome format --write

lint:
@bunx biome lint --write ./app ./server
26 changes: 11 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
# Nuxt-Shadcn-Drizzle Starter
# Nuxt 3 Starter Template

This is a starter project for bootstrapping a Nuxt app with Shadcn-vue and Drizzle ORM, with Pinia for state
management.
A modern Nuxt 3 starter template with Drizzle ORM, Biome, Pinia, Docker, and Bun. This template provides a robust foundation for building full-stack applications with best practices and powerful tools.

## Stack
## 🚀 Stack

Built using <img src="public/icon-green.png" alt="Nuxt Logo" width="30" height="30"> [Nuxt](https://nuxt.com/), <img src="public/icon-shadcn.png" alt="Shadcn Logo" width="30" height="30"> [Shadcn-vue](https://www.shadcn-vue.com/), <img src="public/icon-drizzle.png" alt="Drizzle Logo" width="30" height="30"> [Drizzle ORM](https://orm.drizzle.team/), <img src="public/icon-tailwind.png" alt="TailwindCSS Logo" width="30" height="30"> [TailwindCSS](https://tailwindcss.com/)
- **[Nuxt 3](https://nuxt.com/)** - The Intuitive Vue Framework
- **[Bun](https://bun.sh/)** - Fast JavaScript runtime & package manager
- **[Drizzle ORM](https://orm.drizzle.team/)** - TypeScript ORM with powerful migrations
- **[Biome](https://biomejs.dev/)** - Fast linter and formatter
- **[Pinia](https://pinia.vuejs.org/)** - Intuitive state management
- **[Docker](https://www.docker.com/)** - Containerization support

## Setup
## 📄 License

1. Run `pnpm install` to install all dependencies.
2. Create a .env file, and add `DB_URL`, `JWT_SECRET` respectively.
3. Setup your preferred SQL database in `database/`, this example uses Postgres
4. Run `docker compose up -d` if an instance is preferred.
5. Run `pnpm dev` to start the application

## License

Nuxt-Shadcn-Drizzle Starter is licensed under the [MIT License](https://github.com/risv1/nuxt-shadcn-drizzle-starter/blob/main/LICENSE).
MIT License - feel free to use this template for any project!
30 changes: 30 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": []
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
}
}
Binary file added bun.lockb
Binary file not shown.
16 changes: 0 additions & 16 deletions components.json

This file was deleted.

13 changes: 11 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
version: '3.5'

services:

nuxt-app:
container_name: nuxt_app
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
- /app/node_modules
ports:
- "3000:3000"

postgres:
container_name: postgres_nuxt
image: postgres
Expand Down
10 changes: 0 additions & 10 deletions drizzle.config.ts

This file was deleted.

48 changes: 23 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,38 @@
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"db:generate": "drizzle-kit generate:pg",
"db:push": "drizzle-kit push:pg"
"db:generate": "drizzle-kit generate",
"db:push": "drizzle-kit push"
},
"dependencies": {
"@pinia-plugin-persistedstate/nuxt": "^1.2.0",
"@pinia/nuxt": "^0.5.1",
"@nuxt/icon": "^1.5.6",
"@pinia-plugin-persistedstate/nuxt": "^1.2.1",
"@pinia/nuxt": "^0.5.5",
"@types/bcrypt": "^5.0.2",
"@types/jsonwebtoken": "^9.0.6",
"@types/uuid": "^9.0.8",
"@vee-validate/zod": "^4.12.8",
"@vueuse/core": "^10.10.0",
"@types/jsonwebtoken": "^9.0.7",
"@types/uuid": "^10.0.0",
"@unocss/nuxt": "^0.63.6",
"@vueuse/core": "^11.1.0",
"@vueuse/nuxt": "^11.1.0",
"bcrypt": "^5.1.1",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"drizzle-kit": "^0.21.4",
"drizzle-orm": "^0.30.10",
"drizzle-kit": "^0.26.2",
"drizzle-orm": "^0.35.3",
"jsonwebtoken": "^9.0.2",
"lucide-vue-next": "^0.372.0",
"nuxt": "^3.11.2",
"pinia": "^2.1.7",
"lucide-vue-next": "^0.453.0",
"nuxt": "^3.13.2",
"pinia": "^2.2.4",
"postgres": "^3.4.4",
"radix-vue": "^1.8.2",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"uuid": "^9.0.1",
"vue": "^3.4.27",
"vue-router": "^4.3.2",
"unocss": "^0.63.6",
"uuid": "^10.0.0",
"vue": "^3.5.12",
"vue-router": "^4.4.5",
"zod": "^3.23.8"
},
"devDependencies": {
"@nuxtjs/tailwindcss": "^6.12.0",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"shadcn-nuxt": "^0.10.4",
"tailwindcss": "^3.4.3"
"@biomejs/biome": "1.9.4",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.14"
}
}
Loading

0 comments on commit f3d35fb

Please sign in to comment.