This is the source code for my personal website, built using Astro.
-
Clone the repository:
git clone <your-repository-url> cd <repository-directory>
-
Install dependencies:
npm install
Note: This project uses Node.js. Make sure you have a compatible version installed.
-
Environment Variables: Copy the example environment file
.env.local.example
to.env.local
:cp .env.local.example .env.local
Then, fill in the required values in
.env.local
. These variables are necessary for features like the contact form and analytics during local development. -
Run the development server:
npm run dev
This command starts the local development server. Open your browser and navigate to
http://localhost:4321
(or the address shown in the terminal) to see the website.
The following scripts are available via npm run <script_name>
:
Command | Action |
---|---|
dev |
Starts the local development server |
build |
Builds the production-ready site to the ./dist/ directory |
preview |
Serves the production build locally for preview |
astro ... |
Executes Astro CLI commands (e.g., astro check ) |
To test the production build on your local machine:
-
Build the site:
npm run build
This command creates an optimized version of your site in the
./dist/
directory. -
Preview the build:
npm run preview
This command starts a local server to serve the files from
./dist/
, allowing you to preview the production site before deployment. Open your browser to the address provided in the terminal.