-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
72a2780
commit bc43129
Showing
2 changed files
with
45 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,69 @@ | ||
# Nuxt Minimal Starter | ||
## MyNote | ||
|
||
Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. | ||
![App demo](assets/demo.png) | ||
|
||
## Setup | ||
A MySQL + Drizzle ORM + Nuxt 3 fullstack modern note site. | ||
|
||
Make sure to install dependencies: | ||
## Features | ||
|
||
```bash | ||
# npm | ||
npm install | ||
- Nuxt 3 Universal Rendering mode, support both SSR and CSR | ||
- TypeScript + Drizzle ORM + Zod for Safety | ||
- Tailwind + Shadcn Vue for fast UI iteration | ||
- JWT based Auth | ||
- RWD UI for mobile and desktop | ||
|
||
# pnpm | ||
pnpm install | ||
## How to Start | ||
|
||
# yarn | ||
yarn install | ||
### Install Dependence | ||
|
||
# bun | ||
bun install | ||
```bash | ||
pnpm install | ||
``` | ||
|
||
## Development Server | ||
|
||
Start the development server on `http://localhost:3000`: | ||
### Setup `.env` | ||
|
||
```bash | ||
# npm | ||
npm run dev | ||
|
||
# pnpm | ||
pnpm dev | ||
DATABASE_URL=mysql://user:password@localhost:3306/your_database | ||
JWT_SECRET=*** | ||
``` | ||
|
||
# yarn | ||
yarn dev | ||
Search for online JWT secret generator or generate by using node script. | ||
|
||
# bun | ||
bun run dev | ||
``` bash | ||
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" | ||
``` | ||
|
||
## Production | ||
### Database Migrations | ||
|
||
Build the application for production: | ||
For more, you can refer to [drizzle migrations document](https://orm.drizzle.team/docs/migrations) | ||
|
||
```bash | ||
# npm | ||
npm run build | ||
|
||
# pnpm | ||
pnpm build | ||
|
||
# yarn | ||
yarn build | ||
|
||
# bun | ||
bun run build | ||
npx drizzle-kit generate | ||
npx drizzle-kit push | ||
``` | ||
|
||
Locally preview production build: | ||
### Start the dev server! | ||
|
||
```bash | ||
# npm | ||
npm run preview | ||
|
||
# pnpm | ||
pnpm preview | ||
|
||
# yarn | ||
yarn preview | ||
|
||
# bun | ||
bun run preview | ||
pnpm dev | ||
``` | ||
|
||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. | ||
## Database Schema | ||
|
||
```mermaid | ||
erDiagram | ||
USERS { | ||
int id PK "Auto-increment primary key" | ||
varchar email "Unique and not null" | ||
varchar password "Not null" | ||
} | ||
NOTES { | ||
int id PK "Serial primary key" | ||
int user_id FK "Foreign key references USERS.id" | ||
text text "Optional text content" | ||
timestamp created_at "Default to current date, not null" | ||
timestamp updated_at "Default to current date, updates automatically" | ||
} | ||
USERS ||--o{ NOTES : "has many" | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.