Community powered Deakin SIT resources, students can view and share notes
Find a file
RythonDev 97c26806eb
Merge pull request #28 from dsec-hub/hotfix/mobile-admin
fixed mobile responsiveness, unit is not optional when posting
2026-09-09 17:35:40 +08:00
.github/workflows remove pull request check 2026-09-04 14:22:18 +08:00
.vscode added formatter 2026-08-30 18:50:25 +08:00
src fixed mobile responsiveness, unit is not optional when posting 2026-09-09 17:33:11 +08:00
static changed favicon name 2026-09-05 00:09:28 +08:00
.dockerignore first commit 2026-08-29 20:05:06 +08:00
.env.example added image attachment in posts 2026-09-02 09:29:07 +08:00
.gitignore remove dev dist 2026-09-02 10:23:23 +08:00
.npmrc first commit 2026-08-29 20:05:06 +08:00
.oxfmtrc.json added formatter 2026-08-30 18:50:25 +08:00
CONTRIBUTING.md formatted 2026-09-02 12:56:31 +08:00
docker-compose.yml added image attachment in posts 2026-09-02 09:29:07 +08:00
Dockerfile added image attachment in posts 2026-09-02 09:29:07 +08:00
LICENSE updated README, added contributing md and license 2026-09-02 12:48:49 +08:00
package-lock.json updated codeblocks 2026-09-04 09:50:45 +08:00
package.json updated codeblocks 2026-09-04 09:50:45 +08:00
README.md updated README, added contributing md and license 2026-09-02 12:48:49 +08:00
tsconfig.json first commit 2026-08-29 20:05:06 +08:00
vite.config.ts updated meta theme colour 2026-09-05 12:20:49 +08:00

DSEC Notebook

Svelte TypeScript SQLite TailwindCSS

Live site

A centralised resource hub for Deakin University students studying SIT (IT, computer science, and cybersecurity) and Mathematics units. Students can share study notes, ask questions, and browse content organised by unit and topic.

Written by students, for students. This project is not affiliated with Deakin University.

Features

  • 📚 Notes — post study notes in Markdown, organised by unit and topic.
  • Questions & answers — ask questions, post answers, and mark questions as solved.
  • 💬 Comments — discuss notes directly.
  • 👍 Voting — upvote or downvote notes and questions.
  • 🔍 Search — find notes by title or content.
  • 🎓 Deakin-only accounts — only @deakin.edu.au email addresses can contribute. Create an account with a password after verifying your email, then sign in with email and password.
  • 🛠️ Admin dashboard — manage units, accounts, and notes, plus weekly posting statistics. The first person to open the dashboard verifies their email to become the admin.
  • 🗂️ Units & topics — browse content by Deakin unit code (e.g. SIT102, SIT192) or topic (e.g. Algorithms, Mathematics).
  • 💾 Persistent storage — all data is stored in a local SQLite database.

Tech stack

Requirements

  • Node.js 24 or newer (Node 22+ may work, but the project is developed and containerised against Node 24)
  • npm

Getting started

  1. Clone the repository and install dependencies:

    npm install
    
  2. Configure environment variables:

    cp .env .env.local
    

    DATABASE_PATH defaults to data/dsec.db. To send verification emails, set RESEND_API_KEY (get one at https://resend.com/api-keys). Without it, email verification will fail.

  3. Start the development server:

    npm run dev
    
  4. Open the URL printed in the terminal (usually http://localhost:5173).

Environment variables

Variable Description Default
DATABASE_PATH Path to the SQLite database file data/dsec.db
RESEND_API_KEY Resend API key for verification emails (required)
RESEND_FROM "From" address for verification emails DSEC Notebook <onboarding@resend.dev>
HOST Host the Node server binds to (build) 0.0.0.0
PORT Port the Node server listens on (build) 3000

Scripts

Script Description
npm run dev Start the Vite/SvelteKit development server
npm run build Build a production bundle
npm run preview Preview the production build locally
npm run check Run svelte-check type checking
npm test Run unit and browser tests once
npm run test:unit Run tests in watch mode

Running with Docker

A Dockerfile and docker-compose.yml are included. The app runs on port 3000 inside the container and is mapped to host port 4073.

docker compose up --build

Then open http://localhost:4073.

The SQLite database is persisted in the dsec-data Docker volume. To change the exposed port, edit docker-compose.yml.

Project structure

src/
├── lib/
│   ├── components/     # Reusable UI components (Navbar, FeedRow, VoteStack)
│   ├── server/         # Server-side API and SQLite database logic
│   ├── stores/         # Svelte stores (auth state)
│   ├── api.ts          # Client-side API helper
│   ├── types.ts        # Shared TypeScript types
│   └── time.ts         # Relative time formatting
├── routes/
│   ├── +page.svelte    # Home page
│   ├── +layout.svelte  # App layout and nav
│   ├── notes/          # Notes feed and note detail pages
│   ├── questions/      # Questions feed and question detail pages
│   ├── post/           # Create note / question forms
│   ├── topics/[slug]/  # Topic pages
│   ├── units/[code]/   # Unit pages
│   ├── search/         # Search page
│   ├── auth/login/     # Sign in page
│   ├── admin/          # Admin dashboard
│   └── api/+server.ts  # JSON API endpoint
└── app.html

How it works

  • The frontend calls a single JSON API endpoint (POST /api) with a function name and arguments.
  • The server dispatches those calls to handlers in src/lib/server/api.ts, backed by SQLite.
  • On first run, the database is created automatically and seeded with common Deakin SIT/Math units and CS/maths topics.
  • Authentication is email-verified: to create an account you sign in with a @deakin.edu.au address, a 6-digit code is sent via Resend, and after entering the code you set a password. Once created, you sign in with just your email and password. A "forgot password" flow sends a reset code to your Deakin address so you can set a new password. Passwords are stored as salted scrypt hashes, and sessions are stored as tokens in localStorage.

Data model

The SQLite database contains the following tables:

  • users — Deakin email accounts (each has a role: user or admin)
  • units — Deakin unit codes and names
  • topics — CS and maths topics
  • notes — shared study notes
  • questions — student questions
  • comments — note comments and question answers
  • votes — upvotes/downvotes on notes and questions
  • email_verifications — pending email verification codes

Disclaimer

DSEC Notebook is a community resource for Deakin University students. It is not affiliated with, endorsed by, or officially connected to Deakin University.