├── .npmrc ├── src ├── routes │ ├── +layout.js │ ├── task-manager │ │ ├── +layout.svelte │ │ ├── +page.js │ │ └── +page.svelte │ ├── (main) │ │ ├── +layout.js │ │ ├── +layout.svelte │ │ ├── profile │ │ │ └── +page.svelte │ │ ├── +page.svelte │ │ └── [uid] │ │ │ └── glide │ │ │ └── [id] │ │ │ └── +page.svelte │ ├── (guest) │ │ └── auth │ │ │ ├── +layout.svelte │ │ │ ├── login │ │ │ └── +page.svelte │ │ │ └── register │ │ │ └── +page.svelte │ ├── +error.svelte │ ├── +layout.svelte │ └── api │ │ └── trends │ │ └── +server.js ├── components │ ├── utils │ │ ├── DataLoaderIndicator.svelte │ │ ├── CenteredDataLoader.svelte │ │ ├── BackButton.svelte │ │ ├── Loader.svelte │ │ ├── Portal.svelte │ │ ├── Modal.svelte │ │ ├── Popup.svelte │ │ └── Messenger.svelte │ ├── context │ │ ├── UI │ │ │ ├── index.js │ │ │ └── UIContext.svelte │ │ └── auth │ │ │ ├── index.js │ │ │ └── AuthContext.svelte │ ├── forms │ │ ├── FormErrors.svelte │ │ ├── LoginForm.svelte │ │ └── RegisterForm.svelte │ ├── layouts │ │ ├── AuthLayout.svelte │ │ └── MainLayout.svelte │ ├── task-manager │ │ ├── Editable.svelte │ │ ├── TaskItem.svelte │ │ └── TaskList.svelte │ ├── sidebars │ │ ├── TrendsSidebar.svelte │ │ ├── navLinks.js │ │ └── NavSidebar.svelte │ ├── snackbar │ │ ├── SnackbarContainer.svelte │ │ └── SnackbarItem.svelte │ ├── glides │ │ ├── PaginatedGlides.svelte │ │ └── GlidePost.svelte │ └── users │ │ ├── UserItem.svelte │ │ └── UserList.svelte ├── transitions │ └── index.js ├── actions │ └── clickOutside.js ├── app.html ├── stores │ ├── pageStore.js │ ├── createAuthStore.js │ ├── createGlideIdStore.js │ ├── createSubglideStore.js │ ├── createGlideStore.js │ ├── tasks.js │ └── createFormStore.js ├── db │ └── index.js ├── api │ ├── auth.js │ ├── users.js │ └── glides.js └── app.css ├── static └── favicon.png ├── postcss.config.cjs ├── vite.config.js ├── .gitignore ├── .eslintignore ├── .prettierignore ├── .prettierrc ├── .eslintrc.cjs ├── jsconfig.json ├── svelte.config.js ├── tailwind.config.cjs ├── package.json ├── README.md └── pnpm-lock.yaml /.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /src/routes/+layout.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | export const ssr = false; 5 | -------------------------------------------------------------------------------- /static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jerga99/svelte-social-app/HEAD/static/favicon.png -------------------------------------------------------------------------------- /postcss.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /src/components/utils/DataLoaderIndicator.svelte: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /src/routes/task-manager/+layout.svelte: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | -------------------------------------------------------------------------------- /src/transitions/index.js: -------------------------------------------------------------------------------- 1 | import { crossfade } from "svelte/transition"; 2 | 3 | export const [send, receive] = crossfade({duration: 300}); 4 | -------------------------------------------------------------------------------- /src/components/context/UI/index.js: -------------------------------------------------------------------------------- 1 | import { getContext } from "svelte"; 2 | 3 | 4 | export const key = Symbol(); 5 | export const getUIContext = () => getContext(key); 6 | -------------------------------------------------------------------------------- /src/components/context/auth/index.js: -------------------------------------------------------------------------------- 1 | import { getContext } from "svelte"; 2 | 3 | export const key = Symbol(); 4 | export const getAuthContext = () => getContext(key); 5 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { sveltekit } from '@sveltejs/kit/vite'; 2 | import { defineConfig } from 'vite'; 3 | 4 | export default defineConfig({ 5 | plugins: [sveltekit()] 6 | }); 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | vite.config.js.timestamp-* 10 | vite.config.ts.timestamp-* 11 | -------------------------------------------------------------------------------- /src/routes/(main)/+layout.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | export async function load({fetch}){ 6 | const res = await fetch("/api/trends"); 7 | const trends = await res.json(); 8 | 9 | return { 10 | trends 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | 10 | # Ignore files for PNPM, NPM and YARN 11 | pnpm-lock.yaml 12 | package-lock.json 13 | yarn.lock 14 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /build 4 | /.svelte-kit 5 | /package 6 | .env 7 | .env.* 8 | !.env.example 9 | 10 | # Ignore files for PNPM, NPM and YARN 11 | pnpm-lock.yaml 12 | package-lock.json 13 | yarn.lock 14 | -------------------------------------------------------------------------------- /src/components/utils/CenteredDataLoader.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 |
6 | 7 |
8 | -------------------------------------------------------------------------------- /src/routes/task-manager/+page.js: -------------------------------------------------------------------------------- 1 | 2 | export const ssr = false; 3 | 4 | export function load() { 5 | // fetch data from API/Database ... 6 | return { 7 | appName: "Task Manager", 8 | content: "Board" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "useTabs": false, 3 | "singleQuote": false, 4 | "tabWidth": 2, 5 | "trailingComma": "none", 6 | "printWidth": 100, 7 | "plugins": ["prettier-plugin-svelte"], 8 | "pluginSearchDirs": ["."], 9 | "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] 10 | } 11 | -------------------------------------------------------------------------------- /src/components/forms/FormErrors.svelte: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | {#if errors?.length > 0} 7 |
8 | {#each errors as error} 9 |
{error}
10 | {/each} 11 |
12 | {/if} 13 | -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: ['eslint:recommended', 'prettier'], 4 | plugins: ['svelte3'], 5 | overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], 6 | parserOptions: { 7 | sourceType: 'module', 8 | ecmaVersion: 2020 9 | }, 10 | env: { 11 | browser: true, 12 | es2017: true, 13 | node: true 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /src/actions/clickOutside.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | export function clickOutside(node) { 4 | addEventListener("click", handleClick); 5 | 6 | function handleClick(e) { 7 | if (!node.contains(e.target)) { 8 | node.dispatchEvent(new CustomEvent("outclick")); 9 | } 10 | } 11 | 12 | return { 13 | destroy() { 14 | removeEventListener("click", handleClick); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %sveltekit.head% 8 | 9 | 10 |
%sveltekit.body%
11 | 12 | 13 | -------------------------------------------------------------------------------- /src/components/layouts/AuthLayout.svelte: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
Glider - {title}
8 |
9 |
10 | 11 |
12 |
13 |
14 | -------------------------------------------------------------------------------- /src/routes/(guest)/auth/+layout.svelte: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | {#if !$auth.isAuthenticated} 17 | 18 | {/if} 19 | 20 | -------------------------------------------------------------------------------- /src/stores/pageStore.js: -------------------------------------------------------------------------------- 1 | import { writable } from "svelte/store"; 2 | 3 | 4 | function createPageStore() { 5 | const title = writable(""); 6 | const activeGlide = writable(null); 7 | const onGlidePosted = writable(() => console.log("Hello World")); 8 | 9 | return { 10 | title, 11 | activeGlide, 12 | onGlidePosted 13 | } 14 | } 15 | 16 | export const pageStore = createPageStore(); 17 | -------------------------------------------------------------------------------- /src/routes/+error.svelte: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
7 |
8 |
9 | {$page.status} - {$page.error.message} 10 |
11 | Go to home page 12 |
13 |
14 | -------------------------------------------------------------------------------- /src/components/utils/BackButton.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 | 13 | -------------------------------------------------------------------------------- /src/components/utils/Loader.svelte: -------------------------------------------------------------------------------- 1 | 5 | 6 |
7 |
8 |
9 | 10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /src/routes/+layout.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "extends": "./.svelte-kit/tsconfig.json", 4 | "compilerOptions": { 5 | "baseUrl": ".", 6 | "paths": { 7 | "@components/*": ["./src/components/*"], 8 | "@actions/*": ["./src/actions/*"], 9 | "@stores/*": ["./src/stores/*"], 10 | "@db/*": ["./src/db/*"], 11 | "@api/*": ["./src/api/*"], 12 | } 13 | }, 14 | "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"] 15 | } 16 | -------------------------------------------------------------------------------- /svelte.config.js: -------------------------------------------------------------------------------- 1 | import adapter from '@sveltejs/adapter-auto'; 2 | import { vitePreprocess } from '@sveltejs/kit/vite'; 3 | 4 | /** @type {import('@sveltejs/kit').Config} */ 5 | const config = { 6 | kit: { 7 | adapter: adapter(), 8 | alias: { 9 | "@components": "./src/components/*", 10 | "@actions": "./src/actions/*", 11 | "@stores": "./src/stores/*", 12 | "@db": "./src/db/*", 13 | "@api": "./src/api/*" 14 | } 15 | }, 16 | preprocess: vitePreprocess() 17 | }; 18 | 19 | export default config; 20 | -------------------------------------------------------------------------------- /src/routes/(main)/+layout.svelte: -------------------------------------------------------------------------------- 1 | 17 | 18 | {#if $auth.isAuthenticated} 19 | 20 | 21 | 22 | {/if} 23 | -------------------------------------------------------------------------------- /src/routes/(guest)/auth/login/+page.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /src/routes/(guest)/auth/register/+page.svelte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /src/components/utils/Portal.svelte: -------------------------------------------------------------------------------- 1 | 19 | 20 |
21 |
22 | 23 |
24 |
25 | 26 | 29 | -------------------------------------------------------------------------------- /src/db/index.js: -------------------------------------------------------------------------------- 1 | 2 | import { initializeApp } from "firebase/app"; 3 | import { getFirestore } from "firebase/firestore"; 4 | import { getAuth } from "firebase/auth"; 5 | 6 | const firebaseConfig = { 7 | apiKey: "AIzaSyD9MIvlUMT-_hk56HKF4D3e7Bbs6Ueo9Lg", 8 | authDomain: "svelte-social.firebaseapp.com", 9 | projectId: "svelte-social", 10 | storageBucket: "svelte-social.appspot.com", 11 | messagingSenderId: "209764616304", 12 | appId: "1:209764616304:web:1de523cd320dc27b6b4cb5" 13 | }; 14 | 15 | export const app = initializeApp(firebaseConfig); 16 | export const db = getFirestore(app); 17 | export const firebaseAuth = getAuth(app); 18 | 19 | -------------------------------------------------------------------------------- /src/components/task-manager/Editable.svelte: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | {#if isEditing} 13 |
14 |