Giter Site home page Giter Site logo

zeeshanalam39 / spartan Goto Github PK

View Code? Open in Web Editor NEW

This project forked from goetzrobin/spartan

0.0 1.0 0.0 662 KB

Example application running on Supabase, Prisma, Analog, tRPC, Tailwind, Angular, and Nx.

JavaScript 4.11% TypeScript 92.24% CSS 0.38% HTML 3.27%

spartan's Introduction

SPARTAN

The tip of a spear with the Angular A inside

Example application running on Supabase, Prisma, Analog, tRPC, Tailwind, Angular, and Nx.

Prerequisites

  • You will need yarn (or a different package manager) installed.
  • You will need to set up a Supabase account (it's free)
  • You will need NodeJs installed. The version I have working is v16.16.0.

Install Dependencies

Run yarn or yarn install to install the dependencies of this project

Set up DB

Your dependencies include Prisma, which is a great tool to manage your application's database. We need two things to connect our application to our Supabase postgres instance:

  • Add a .env file at the root of your Nx workspace and add the following code snippet
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema

# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings

DATABASE_URL="postgresql://postgres:[YOUR-PASSWORD]@db.[YOUR-SUPABASE-REFERENCE-ID].supabase.co:5432/postgres?schema=public"

  • Alternatively, you can also run a postgres instance locally and pass the URL the same way!
  • We can push the schema defined in our schema.prisma file to our DB running yarn prisma db push.
  • Finally, we create our prisma client by running yarn prisma generate.

Now our DB should be all set up and ready to go!

Building the tRPC and analog integration

Run yarn nx build trpc to create the @spartan/trpc integration.

Note: This should happen automatically since the analog-trpc app depends on the trpc lib, but it does not currently.

Development server

Run yarn nx serve analog-trpc for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Understand this workspace

Run yarn nx graph to see a diagram of the dependencies of the projects.

Further help

Reach out to me on Twitter or GitHub if you run into any issues.

spartan's People

Contributors

goetzrobin avatar

Watchers

James Cloos 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.