Code Monkey home page Code Monkey logo

sveltekit-todo-demo's Introduction

SvelteKit Todo Demo

A simple todo list webapp. Made using SvelteKit, Tailwind CSS, daisyUI, and SQLite.

Developing

Make sure you have node and npm installed. I recommend pnpm as a space-efficient npm alternative.

Clone this repository to a local folder and change to that folder.

Install the required depnendencies with the command npm install (or pnpm install or yarn).

Then to start a development server run:

npm run dev

Building

The production version is not significantly different to the development version. To build a production version of the app run:

npm run build

And to host a server previewing it, run:

npm run preview

Design

The application is based on the create-svelte project scaffolding. I chose tailwind as I am familiar with vuetify which is based on it. Alongside tailwind, daisyUI reduced the number of design decisions that I had to make, helping me give the UI an simple and elegant look.

The simplicity of the app meant that there wasn't need for much compartmentalization. There is only one component: TodoEntry. It manages the UI and behavior of each todo entry.

SvelteKit provides tools to make separate serverside and clientside code, as well as tools to define API endpoints. As the data that is being sent back and forth is small, it is re-sent in it's entirety on each update. This is obviously inefficient but works well enough for the project and avoids potentially brittle state mirroring logic.

NPM has a SQLite package that made it easy to set up database storage. Every user action immediately triggers a corresponding database update. In a larger project the load on the database could become too high. In that case an in-memory storage could be added as an intermediary which is then periodically flushed to the database.

sveltekit-todo-demo's People

Contributors

arnfaldur avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.