Giter VIP home page Giter VIP logo

ai4cheap's Introduction

Static SvekteKit frontend for PocketBase backend

Setup

npx pnpm install # install dependencies
npm run build # compile frontend

The above produces build output directory which is then used by PocketBase to serve the frontend of your app.

Live Development

# start the backend, if not already running ...
npm run dev:backend
# and then start the frontend ...
npm run dev

Now visit http://localhost:5173 (sk) or http://localhost:8090 (pb)

Generated Types

The file generated-types.ts contains TypeScript definitions of Record types mirroring the fields in your database collections. But it needs to be regenerated every time you modify the schema. This can be done by simply running the typegen script in the frontend's package.json. So remember to run npm run typegen after every schema change.

Building

To create a production version of your app (static HTML/JS app):

NOTE: The build below will fail unless the backend has at least 1 post created. So please create a "posts" record using the app UI or the admin UI before running build below.

# compile frontend
npm run build
# and then serve it with pocketbase
npm run backend

The above generates output in the build folder. Now you can serve production compiled version of the frontend using the backend (with --publicDir ../frontend/build), any static file web server, or npm preview.

ai4cheap's People

Contributors

sabbaticaldev 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.