Code Monkey home page Code Monkey logo

explo's Introduction

create-svelte

Everything you need to build a Svelte project, powered by create-svelte.

Creating a project

If you're seeing this, you've probably already done this step. Congrats!

# create a new project in the current directory
npm create svelte@latest

# create a new project in my-app
npm create svelte@latest my-app

Developing

Once you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

Building

To create a production version of your app:

npm run build

You can preview the production build with npm run preview.

To deploy your app, you may need to install an adapter for your target environment.

explo's People

Contributors

mr-m1m3 avatar

Stargazers

Pavel Rusakov avatar  avatar

Watchers

 avatar

explo's Issues

`read()` utility might not need to read all the whole request body.

read() utility function currently reads the whole request body and returns the data wrapped inside Result<T, E>. However, it might not need to do this. We already know what property values we want, so reading the whole request body is not important. Rather, we can create an utility function that takes and returns the property values we want.

For example, in the login page, we only want email and password property of the request to be read. In current implementation, read function will read the whole body. Like, if someone sends a request packed like this:

{
 email: "",
 password: "",
 foo: "",
 bar: ""
}

read() utility will actually read the additional properties foo and bar too.

However, it would be nice, if we could implement it in a way that only takes the request body and an array of properties we want to read. Then, the utility can loop through the array instead of the request body and do the rest. As a result, additional properties won't be read. Which IMO would be better.

data fetched from pocketbase are not type-safe

Pocketbase sdk returns fetched data as RecordAuthResponse<T = Record>. Where we should get our data as T. However, there are some extra keys that pocketbase adds such as id, collectionName, updated, created etc. If they are not included in T, ide won't suggest properties that pb added. To solve this, all data that we fetch from pocketbase should extend :

interface PbSpecificKeys{
   id: string;
   collectionName:string;
   updated:string;
   ....
}

Logging in should not just redirect to /

Imagine, I tried to access an authorized user while I'm unauthorized. As an expected behavior, I'll be redirected to /login. Now, if /login redirects me to / I would be be unhappy. To maximize the user experience, we should redirect he user back to where they came from.

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.