|
1 | | -# vue |
| 1 | +# Nuxt 3 template |
| 2 | +<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> |
| 3 | +[](#contributors-) |
| 4 | +<!-- ALL-CONTRIBUTORS-BADGE:END --> |
2 | 5 |
|
3 | | -This template should help get you started developing with Vue 3 in Vite. |
| 6 | +Nuxt 3 template is a opinionated template for Nuxt 3 project. It includes the following features: |
4 | 7 |
|
5 | | -## Recommended IDE Setup |
| 8 | +- [UnoCSS](https://unocss.com) for utility-first CSS |
| 9 | +- [Vuetify](https://vuetifyjs.com) for component library |
| 10 | +- [Nuxt i18n](https://i18n.nuxtjs.org) for internationalization |
| 11 | +- [Nuxt Auth](https://auth.sidebase.io) for authentication |
| 12 | +- [Drizzle ORM](https://drizzle.dev) for Database communication |
| 13 | +- [CASL](https://casl.js.org) for Access Control |
| 14 | +- [Firebase Notification](https://firebase.google.com) for push notification |
6 | 15 |
|
7 | | -[VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) (and disable Vetur). |
| 16 | +## Getting Started |
8 | 17 |
|
9 | | -## Type Support for `.vue` Imports in TS |
| 18 | +### Prerequisites |
10 | 19 |
|
11 | | -Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. |
| 20 | +- [PNPM](https://pnpm.io) - Fast, disk space efficient package manager |
| 21 | +- [Node.js 20+](https://nodejs.org) - Recommend to be installed via PNPM standalone using `pnpm env use --global` |
12 | 22 |
|
13 | | -However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can run `Volar: Switch TS Plugin on/off` from VS Code command palette. |
| 23 | +### Installation |
14 | 24 |
|
15 | | -## Customize configuration |
| 25 | +1. Clone the repository |
16 | 26 |
|
17 | | -See [Vite Configuration Reference](https://vitejs.dev/config/). |
| 27 | +```bash |
| 28 | +git clone git@github.com:thecodeorigin/nuxt-template.git |
| 29 | +``` |
| 30 | + |
| 31 | +2. Install dependencies |
| 32 | + |
| 33 | +```bash |
| 34 | +pnpm install |
| 35 | +``` |
| 36 | + |
| 37 | +3. Prepare the environment |
| 38 | + |
| 39 | +Copy the `.env.example` file to `.env` and fill in the necessary information |
| 40 | + |
| 41 | +```bash |
| 42 | +cp .env.example .env |
| 43 | +``` |
| 44 | + |
| 45 | +4. Prepare the Database with Docker |
| 46 | + |
| 47 | +You can use a remote database and fill in all the environment variables in the `.env` file. Or you can use the provided docker-compose file to start a local database. |
| 48 | + |
| 49 | +> Please be careful with your configured environment variables, you can accidentally execute the database commands on your production database. |
| 50 | +
|
| 51 | +```bash |
| 52 | +pnpm db:start |
| 53 | + |
| 54 | +pnpm db:migrate |
| 55 | + |
| 56 | +pnpm db:seed |
| 57 | +``` |
| 58 | + |
| 59 | +> Please checkout the `server/db/seeds` folder to review all the seed data, especially the `users.seed.ts` file to get the default user credentials. |
| 60 | +
|
| 61 | +You can stop or reset the database with the following commands: |
| 62 | + |
| 63 | +```bash |
| 64 | +# Stop the database |
| 65 | +pnpm db:stop |
| 66 | +# Reset the database |
| 67 | +pnpm db:reset |
| 68 | +``` |
18 | 69 |
|
19 | | -## Project Setup |
| 70 | +5. Run the project |
20 | 71 |
|
21 | | -```sh |
22 | | -npm install |
| 72 | +```bash |
| 73 | +pnpm dev |
23 | 74 | ``` |
24 | 75 |
|
25 | | -### Compile and Hot-Reload for Development |
| 76 | +### Usage with Doppler |
| 77 | +You can use Doppler to manage your environment variables. To do this, you need to install the Doppler CLI and authenticate with your account. |
26 | 78 |
|
27 | | -```sh |
28 | | -npm run dev |
| 79 | +1. Install the Doppler CLI |
| 80 | + |
| 81 | +Please follow the instructions on the [official Doppler documentation](https://docs.doppler.com/docs/install-cli) to install the Doppler CLI. |
| 82 | + |
| 83 | +2. Authenticate with Doppler |
| 84 | + |
| 85 | +```bash |
| 86 | +doppler login |
| 87 | +``` |
| 88 | + |
| 89 | +3. Select the project from Doppler |
| 90 | + |
| 91 | +```bash |
| 92 | +doppler setup |
29 | 93 | ``` |
30 | 94 |
|
31 | | -### Type-Check, Compile and Minify for Production |
| 95 | +4. Run the project with Doppler |
| 96 | + |
| 97 | +> Please be careful with your configured environment variables, you can accidentally execute the database commands on your production database. |
32 | 98 |
|
33 | | -```sh |
34 | | -npm run build |
| 99 | +```bash |
| 100 | +pnpm with-env dev |
35 | 101 | ``` |
| 102 | + |
| 103 | +## Contribution |
| 104 | + |
| 105 | +Thank you to all the people who already contributed to the Nuxt Template project! |
| 106 | + |
| 107 | +<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> |
| 108 | +<!-- prettier-ignore-start --> |
| 109 | +<!-- markdownlint-disable --> |
| 110 | +<table> |
| 111 | + <tbody> |
| 112 | + <tr> |
| 113 | + <td align="center" valign="top" width="14.28%"><a href="http://nguyenhuunguyeny.com"><img src="https://avatars.githubusercontent.com/u/46400321?v=4?s=100" width="100px;" alt="Rim (Y Nguyen)"/><br /><sub><b>Rim (Y Nguyen)</b></sub></a><br /><a href="#maintenance-imrim12" title="Maintenance">🚧</a></td> |
| 114 | + </tr> |
| 115 | + </tbody> |
| 116 | +</table> |
| 117 | + |
| 118 | +<!-- markdownlint-restore --> |
| 119 | +<!-- prettier-ignore-end --> |
| 120 | + |
| 121 | +<!-- ALL-CONTRIBUTORS-LIST:END --> |
| 122 | + |
| 123 | +## License |
| 124 | + |
| 125 | +[MIT](https://opensource.org/licenses/MIT) |
| 126 | + |
| 127 | +Copyright (c) 2022-present, Nguyen Huu Nguyen Y |
| 128 | + |
| 129 | +## Contributors ✨ |
| 130 | + |
| 131 | +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): |
| 132 | + |
| 133 | +<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> |
| 134 | +<!-- prettier-ignore-start --> |
| 135 | +<!-- markdownlint-disable --> |
| 136 | +<!-- markdownlint-restore --> |
| 137 | +<!-- prettier-ignore-end --> |
| 138 | +<!-- ALL-CONTRIBUTORS-LIST:END --> |
| 139 | + |
| 140 | +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! |
0 commit comments