Giter Site home page Giter Site logo

xmlking / spectacular Goto Github PK

View Code? Open in Web Editor NEW
30.0 2.0 3.0 18.35 MB

Sweet & Powerful SvelteKit Project Template https://spectacular-console.vercel.app/ https://spectacular-docs.vercel.app/

Home Page: https://xmlking.github.io/spectacular/

License: MIT License

JavaScript 1.71% HTML 0.49% Svelte 52.04% TypeScript 39.50% CSS 0.60% Dockerfile 0.44% Nix 0.04% Shell 0.07% PLpgSQL 0.69% MDX 0.97% Astro 3.35% Makefile 0.09%
flowbite graphql hasura houdini pnpm postgresql superforms sveltekit turborepo mswjs

spectacular's Introduction

Spectacular

Spectacular is a full-stack Turborepo template project with SvelteKit meta-framework all working in harmony and sharing packages.

Tech Stack

Features

Experementing

Setup

cd ~/Developer/Work/SPA
git clone https://github.com/xmlking/spectacular.git
cd spectacular && pnpm i
# (optional) playwright is required for end-to-end testing
bunx playwright install
# (optional) add git-commit-hooks
cog install-hook --all

Environment Variables

By default, the dev server (dev command) runs in development mode and the build command run in production mode.
This means when running turbo build, it will load the env variables from .env.production if there is one:
Use .env.local to override environment variables in .env (secrets like API keys) for local development.

Developing

Once you've cloned the project and installed dependencies with pnpm i, start a development server:

Start local Hasura

# stat all services in background and show logs
make up # for first time use `make boot` then `make up`
# this will start all services with default profile + services with `all` profile.
make up PROFILES=all 
# verify status/health of services
make ps
# shotdown all services
make down
# DANGER: run this if you want to reset database and other persistent volumes
make teardown
# verify if docker `compose` getting correctly resolved application config from .env and .secrests files
make check
make check PROFILES=all,optional
# ssch to a container to debug
#make exec-<target>
make exec-hasura
make exec-auth

Start apps/console

turbo dev --filter=console

# or start the server and open the app in a new browser tab
turbo dev --filter=console -- --open

# run in debug mode
turbo dev:debug --filter=console

# run with a custom inline config
# inline environment variables has higher precedence than ones loaded from .env and .env.local files
PUBLIC_GRAPHQL_ENDPOINT=api.mycompany.com:443 turbo dev

Maintenance

Update

To update the packages to their latest versions in package.json

pnpm up --latest -r
pnpm audit --fix

Format

Format and lint code

turbo format
turbo lint

Testing

Unit/Component Tests

turbo test

turbo test:ui
#Then, you can visit the Vitest UI at http://localhost:51204/__vitest__/.

# test coverage
turbo test:coverage

# updating Snapshots
bunx vitest -u

# test specific folder
bunx vitest apps/web/src/lib/utils
(or)
./node_modules/.bin/vitest run apps/web/src/lib/utils

E2E Tests

turbo test:e2e

Building

To create a production version of your app:

turbo build
# run build
turbo build  --filter=playground...
turbo build  --filter=playground... --dry
turbo build --filter=playground... --graph

Run from the local build directory:

NODE_ENV=production \
PUBLIC_GRAPHQL_ENDPOINT=api.mycompany.com:443 \
node build

# (optional) pass ORIGIN when using `adapter-node` build
HOST=127.0.0.1 \
PORT=4000 \
ORIGIN=https://my.site \
node build

You can preview the production build with turbo preview --filter=playground....

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

Release

after checking-in all your changes, bump the VERSION and build the docker image.

# dry-run
cog bump --auto --dry-run
# this will bump version in package.json and create git tag and commit.
cog bump --auto

Libs

To build and publish libs

turbo build --filter=lib...
cd package
pnpm publish

spectacular's People

Contributors

dependabot[bot] avatar xmlking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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