├── src ├── lib │ ├── InputField.svelte │ ├── HoverDropdown.svelte │ ├── Button.svelte │ ├── Tag.svelte │ ├── MediumDropdown.svelte │ ├── Comment.svelte │ ├── pocketbase.ts │ ├── UserFollow.svelte │ ├── CircleIcon.svelte │ ├── DropdownOption.svelte │ ├── SmallDropdown.svelte │ ├── Icon.svelte │ ├── Dropdown.svelte │ ├── BigToggle.svelte │ ├── SmallPost.svelte │ ├── EditModal.svelte │ └── Post.svelte ├── app.css ├── app.html └── routes │ ├── +layout.svelte │ ├── user │ └── [userid] │ │ └── +page.svelte │ └── +page.svelte ├── .env.example ├── static ├── favicon.png ├── heart-full.svg ├── heart.svg ├── close.svg ├── chevron-right.svg ├── chevron.svg ├── edit.svg ├── comment.svg ├── spinner.svg ├── bell.svg ├── dots.svg ├── trash-can.svg ├── show.svg ├── trash-can-red.svg ├── followed.svg ├── send.svg ├── hide.svg ├── follow.svg ├── gear.svg ├── message.svg ├── friends.svg ├── friends-color.svg ├── sign-out.svg ├── report.svg ├── globe.svg ├── globe-color.svg ├── profile.svg ├── verified.svg ├── help.svg ├── confetti.svg └── placeholder-logo.svg ├── postcss.config.cjs ├── Dockerfile ├── vite.config.ts ├── .gitignore ├── tailwind.config.cjs ├── .prettierignore ├── .prettierrc ├── svelte.config.js ├── tsconfig.json ├── package.json ├── compose.yml ├── README.md └── pb_schema.json /src/lib/InputField.svelte: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | DOMAIN="localhost" 2 | PUBLIC_API="http://localhost:8090" -------------------------------------------------------------------------------- /static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vtempest/spock-dev-stack/HEAD/static/favicon.png -------------------------------------------------------------------------------- /postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /src/app.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | body{ 6 | background-color: #222222; 7 | } -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM oven/bun:alpine AS runtime 2 | WORKDIR /app 3 | # COPY package.json ./ 4 | COPY . . 5 | RUN bun i 6 | EXPOSE 5173 7 | CMD bunx --bun vite dev --host 0.0.0.0 -------------------------------------------------------------------------------- /src/lib/HoverDropdown.svelte: -------------------------------------------------------------------------------- 1 |
3 |
4 | Full-stack all-in-one in 3 containers
5 | * SvelteKit real-world demo of OAuth, posts, comments, profiles, likes, followers
6 | * Pocketbase SQL, admin dashboard
7 | * Caddy https router
8 |
9 | ## Spock Dev Stack Docs
10 |
11 | - [Svelte](https://svelte.dev/examples/hello-world) structure for reactive interface components
12 | - [Pocketbase](https://pocketbase.io/docs/js-overview/) sqlite db toolkit, admin panel, auth, api docs, ORM rules, migrations, files, js extensions
13 | - [OAuth2](https://developers.google.com/identity/protocols/oauth2) Google Signin user authentication
14 | - [Caddy](https://caddyserver.com/docs/) https server routing to containers with [caddy-docker-proxy](https://github.com/lucaslorentz/caddy-docker-proxy) in one file
15 | - [Svelte Kit](https://kit.svelte.dev) api server with server-side render
16 | - [docker compose](https://docs.docker.com/compose/gettingstarted/) manage containers in one file
17 | - [ESLint](https://github.com/dustinspecker/awesome-eslint)/[Prettier](https://prettier.io) code style
18 | - [Vite](https://vitejs.dev) bundle compiler
19 |
20 |
21 | #### Backend Alternatives
22 |
23 | - [PostgreSQL Supabase](https://supabase.com/docs/guides/getting-started/quickstarts/sveltekit)
24 | - [Drizzle ORM](https://orm.drizzle.team/docs/overview)
25 | - [Lucia OAuth](https://github.com/lucia-auth/examples/tree/main/sveltekit/github-oauth)
26 | - [Ava Unit Testing](https://github.com/avajs/ava)
27 | - [Redoc OpenAPI Internal Docs](https://github.com/Redocly/redoc?tab=readme-ov-file)
28 | - [Docusaurus Public Docs](https://docusaurus.io/docs)
29 |
30 | #### Interface Alternatives
31 |
32 | - [List of Svelte Libraries](https://github.com/TheComputerM/awesome-svelte#ui-libraries)
33 | - [Svelte Material UI](https://sveltematerialui.com/INSTALL.md)
34 | - [SkeletonUI](https://www.skeleton.dev/components/app-rail)
35 | - [Flowbite](https://flowbite-svelte.com/docs/pages/introduction)
36 | - [shadcdn-svelte](https://shadcn-svelte.com/docs)
37 | - [Icon sets](https://www.svgrepo.com/collections)
38 |
39 |
40 | ## Install
41 |
42 | 1. Install docker `curl -fsSL https://get.docker.com -o get-docker.sh; sh get-docker.sh`
43 | 2. Clone to localhost or server `git clone https://github.com/vtempest/spock-dev-stack`
44 | 3. `mv .env.example .env` and set the domain in `.env`
45 | 4. Setup and run `docker network create caddy`; `docker-compose up -d`
46 | 5. Go to `localhost:8090/_` or with caddy `api.localhost/_` or on server `api.domain.com/_` and setup admin login
47 | 6. Import Collections, load `pb_schema.json` for seed migration
48 | 7. Auth providers, get id/secret from [Google](https://console.cloud.google.com/apis/credentials)
49 | 8. Set OAuth origin `http://localhost` and `http://localhost:5173` on local or `https://domain.com` on server
50 | 9. Set redirect `http://localhost:8090/api/oauth2-redirect` or `https://api.domain.com/api/oauth2-redirect`
51 | 10. Develop app running on `app.domain.com` or `localhost:5173`
52 |
53 |
54 |
55 | > \\\\// Build fast and scale \\\\//
56 |
--------------------------------------------------------------------------------
/src/lib/SmallPost.svelte:
--------------------------------------------------------------------------------
1 |
42 |
43 | 87 | {content} 88 |
89 | 90 |(showLikesDropdown = true)} 94 | on:pointerleave={() => (showLikesDropdown = false)} 95 | > 96 | {likes?.length} likes 97 |
98 | {#if showLikesDropdown} 99 |38 | Profile Picture (Max {maxFileSize / 1000000}Mb) 39 |
40 |Preview:
50 |maxFileSize / 1000000 52 | ? 'text-red-400 font-semibold text-sm' 53 | : 'text-neutral-400 text-sm'} 54 | > 55 | {fileSize}Mb 56 |
57 |Name
79 |Bio
90 | 96 | 101 |{$currentUser?.alerts}
99 |Nothing to see here...
106 | {/if} 107 |105 | {content} 106 |
107 | 108 |(showLikesDropdown = true)} 112 | on:pointerleave={() => (showLikesDropdown = false)} 113 | > 114 | {likes?.length} likes 115 |
116 |{comments?.length} comments
117 | {#if showLikesDropdown} 118 |{$currentUser?.bio || 'Nothing to see here yet'}
228 | {:else} 229 |{viewedUser?.bio || 'Nothing to see here yet'}
230 | {/if} 231 |Nothing to see here yet
258 | {/if} 259 |People you may know
221 |See All
222 |Nothing to see here yet
262 | {/if} 263 |