:sparkles: Recently upgraded to Nuxt 3 :sparkles:
What is this?
TL;DR: This is the source code of [my personal website][], a JAMstack website made with Nuxt 3, TypeScript, TailwindCSS and a lot of coffee. :coffee:
For starting the dev server, you have multiple options:
1. Using an online development environment (most easy option)
You can use an online development environment to start developing right away. The benefits of using an online development environment is that you don't need to install anything locally on your machine. Just start hacking right away. Some of the online development environments I recommend are:
2. Using a local, containerized development environment (my preferred option)
If you're a more serious developer, you can use a local, containerized development environment.
The benefits of using a local, containerized development environment is that you don't need to install the right versions of Node.js, Yarn, Git, etc as it's all included, configured and ready to use in the container.
There are various ways to use a local, containerized development environment with this starter kit:
a) Using VSCode Remote Containers / Dev Containers
You can use VSCode with the Remote Containers / Dev Containers extension to start developing right away. With the right extensions installed, just open the project in VSCode and it will ask you if you want to open it in a container.
b) Using Docker Compose
You can use Docker Compose to start developing right away:
docker-compose -f docker-compose.dev.yml up
c) Using Docker (Method 1, building the image) You can use Docker to start developing right away:
docker build --no-cache -t ricardobalk/website:latest --target development -f Dockerfile .
docker run --rm -it -p 3000:3000 -v "$(pwd):/home/node/app:cached" ricardobalk/website:latest
d) Using Docker (Method 2, without building the image)
You can even use Docker without building the image from the Dockerfile. Just run the following command:
docker run -it --rm -v "$(pwd):/app" -p 3000:3000 -w /app node:18.15.0-alpine3.16 yarn && yarn dev
Tip: Take a look at the
Dockerfile
anddocker-compose.*.yml
to see how the containers are set up. The dockerfile has a multi-stage build, to keep the final image as small as possible.
3. Using a local Node.js installation (when your machine has Node.js)
You can also use a local Node.js installation.
yarn install
to install the dependenciesyarn dev
to start the development server on http://localhost:3000yarn build
to build the application for productionyarn start
to start the production serveryarn generate
to generate the application for static hostingSee the official Nuxt 3 deployment documentation for more details.