This boilerplate provides a quick and easy setup for building modern web applications using SvelteKit, Tailwind CSS, and Supabase. It comes preconfigured with essential libraries and tools to help you kickstart your project in no time! β‘
- SvelteKit for building fast and lightweight web applications π
- Tailwind CSS for rapid UI development with utility-first classes π¨
- Supabase integration for seamless backend and database management ποΈ
- Environment variable setup for secure configuration π
- Preconfigured project structure for easy navigation and development π
- Clone the repository:
git clone https://github.com/yourusername/sveltekit-tailwindcss-supabase-boilerplate.git
- Install dependencies
cd sveltekit-tailwindcss-supabase-boilerplate
npm install
- Set up environment variables: Create a .env file in the root directory and add the following variables:
VITE_SUPABASE_URL=your-supabase-url
VITE_SUPABASE_ANON_KEY=your-supabase-anon-key
- Configure Vite: Update the vite.config.js file with the following configuration:
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()],
server: {
host: '0.0.0.0',
port: 4173,
},
});
- Configure Nginx:
server {
listen 80;
server_name db.corp.reviews;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name YOUR_DOMAIN_NAME;
ssl_certificate /your/letsencrypt/fullchain/key/path/fullchain.pem;
ssl_certificate_key /your/letsencrypt/private/key/path/.pem;privkey.pem;
location / {
proxy_pass http://localhost:5173;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket νλ‘μ μ€μ μΆκ°
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
- Set up Supabase client:
Update the src/lib/supabaseClient.js file with the following code:
import { createClient } from '@supabase/supabase-js';
export const supabase = createClient(
import.meta.env.VITE_SUPABASE_URL,
import.meta.env.VITE_SUPABASE_ANON_KEY
);
- Start the development server:
npm run dev
Your application should now be running at http://localhost:5173. If you have an issue to access your application through local address, then try through network address instead.
For more information on setting up and configuring the individual components of this boilerplate, refer to the following documentation:
- SvelteKit: https://tailwindcss.com/docs/guides/sveltekit
- Tailwind CSS: https://tailwindcss.com/docs/guides/sveltekit
- Supabase: https://supabase.com/docs/guides/getting-started/quickstarts/sveltekit
.
βββ README.md
βββ package.json
βββ postcss.config.js
βββ src
β βββ app.css
β βββ app.html
β βββ lib
β β βββ index.js
β β βββ supabaseClient.js
β βββ routes
β βββ +layout.svelte
β βββ +page.server.js
β βββ +page.svelte
βββ static
β βββ favicon.png
β βββ supabase.png
β βββ svelte.png
β βββ tailwindcss.png
βββ svelte.config.js
βββ tailwind.config.js
βββ vite.config.js
Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.
This project is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0) License. See the LICENSE file for more details.
μ΄ λ³΄μΌλ¬νλ μ΄νΈλ SvelteKit, Tailwind CSS λ° Supabaseλ₯Ό μ¬μ©νμ¬ νλμ μΈ μΉ μ ν리μΌμ΄μ μ λΉ λ₯΄κ³ μ½κ² ꡬμΆν μ μλλ‘ μ 곡ν©λλ€. νμ λΌμ΄λΈλ¬λ¦¬μ λκ΅¬κ° μ¬μ ꡬμ±λμ΄ μμ΄ νλ‘μ νΈλ₯Ό λΉ λ₯΄κ² μμν μ μμ΅λλ€! β‘
- SvelteKitμ μ¬μ©νμ¬ λΉ λ₯΄κ³ κ°λ²Όμ΄ μΉ μ ν리μΌμ΄μ κ΅¬μΆ π
- Tailwind CSSλ₯Ό μ¬μ©νμ¬ μ νΈλ¦¬ν° μ°μ ν΄λμ€λ‘ μ μν UI κ°λ° π¨
- Supabase ν΅ν©μΌλ‘ μνν λ°±μλ λ° λ°μ΄ν°λ² μ΄μ€ κ΄λ¦¬ ποΈ
- μμ ν ꡬμ±μ μν νκ²½ λ³μ μ€μ π
- μ¬μ΄ νμ λ° κ°λ°μ μν μ¬μ ꡬμ±λ νλ‘μ νΈ κ΅¬μ‘° π
- μ μ₯μ 볡μ :
git clone https://github.com/yourusername/sveltekit-tailwindcss-supabase-boilerplate.git
- μ’ μμ± μ€μΉ:
cd sveltekit-tailwindcss-supabase-boilerplate
npm install
- νκ²½ λ³μ μ€μ :
λ£¨νΈ λλ ν 리μ .env
νμΌμ μμ±νκ³ λ€μ λ³μλ₯Ό μΆκ°ν©λλ€:
VITE_SUPABASE_URL=your-supabase-url
VITE_SUPABASE_ANON_KEY=your-supabase-anon-key
your-supabase-project-id
μ your-supabase-api-key
λ₯Ό μ€μ Supabase νλ‘μ νΈ IDμ API ν€λ‘ λ체ν©λλ€.
4. Vite ꡬμ±:
vite.config.js
νμΌμ λ€μκ³Ό κ°μ΄ μ
λ°μ΄νΈν©λλ€:
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()],
server: {
host: '0.0.0.0',
port: 4173,
},
});
- Nginx ꡬμ±:
λ€μ λ΄μ©μΌλ‘
/etc/nginx/sites-available/corpreviews-db.conf Nginx
κ΅¬μ± νμΌμ μμ±ν©λλ€:
server {
listen 80;
server_name db.corp.reviews;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name db.corp.reviews;
ssl_certificate /etc/letsencrypt/live/db.corp.reviews/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/db.corp.reviews/privkey.pem;
location / {
proxy_pass http://localhost:5173;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket νλ‘μ μ€μ μΆκ°
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
- Supabase ν΄λΌμ΄μΈνΈ μ€μ : src/lib/supabaseClient.js νμΌμ λ€μκ³Ό κ°μ΄ μ λ°μ΄νΈν©λλ€:
import { createClient } from '@supabase/supabase-js';
export const supabase = createClient(
import.meta.env.VITE_SUPABASE_URL,
import.meta.env.VITE_SUPABASE_ANON_KEY
);
- κ°λ° μλ² μμ:
npm run dev
μ΄μ μ ν리μΌμ΄μ
μ΄ http://localhost:5173
μμ μ€νλμ΄μΌ ν©λλ€.
λ‘컬 μ΄λλ μ€ μ κ·Όμ λ¬Έμ κ° λ°μνλ€λ©΄, λ€νΈμν¬ μ£Όμλ₯Ό μ΄μ©ν΄ μ΄ν리μΌμ΄μ
μ μ κ·Όν΄λ³΄μΈμ.s
μ΄ λ³΄μΌλ¬νλ μ΄νΈμ κ°λ³ κ΅¬μ± μμ μ€μ λ° κ΅¬μ±μ λν μμΈν λ΄μ©μ λ€μ λ¬Έμλ₯Ό μ°Έμ‘°νμΈμ:
- SvelteKit: https://tailwindcss.com/docs/guides/sveltekit
- Tailwind CSS: https://tailwindcss.com/docs/guides/sveltekit
- Supabase: https://supabase.com/docs/guides/getting-started/quickstarts/sveltekit
.
βββ README.md
βββ package.json
βββ postcss.config.js
βββ src
β βββ app.css
β βββ app.html
β βββ lib
β β βββ index.js
β β βββ supabaseClient.js
β βββ routes
β βββ +layout.svelte
β βββ +page.server.js
β βββ +page.svelte
βββ static
β βββ favicon.png
β βββ supabase.png
β βββ svelte.png
β βββ tailwindcss.png
βββ svelte.config.js
βββ tailwind.config.js
βββ vite.config.js
κΈ°μ¬λ₯Ό νμν©λλ€! μ μ, λ²κ·Έ λ³΄κ³ λλ κΈ°λ₯ μμ²μ΄ μλ κ²½μ° μ΄μλ₯Ό μ΄κ±°λ ν 리νμ€νΈλ₯Ό μ μΆν΄ μ£ΌμΈμ.
μ΄ νλ‘μ νΈλ ν¬λ¦¬μμ΄ν°λΈ μ»€λ¨Όμ¦ μ μμνμ 4.0 κ΅μ (CC BY 4.0) λΌμ΄μ μ€μ λ°λΌ λΌμ΄μ μ€κ° λΆμ¬λ©λλ€. μμΈν λ΄μ©μ LICENSE νμΌμ μ°Έμ‘°νμΈμ.