Code Monkey home page Code Monkey logo

cadence's Introduction

Cadence

A full-stack endurance athletics focused Software as a Service (SaaS) web application built with SvelteKit, incorporating various technologies such as Stripe for subscriptions, Lucia for authentication, Prisma ORM for database interactions, Svelte Superforms form handling, Zod for validation, and enhanced with Skeleton UI and Lucide icons.

Table of Contents

Introduction

This SaaS implements modern standards for building web applications with a focus on endurance athleteics. It integrates powerful tools and libraries to handle essential aspects like user authentication, subscription management, form handling, and more.

Features

  • User authentication using Lucia
  • Subscription management with Stripe
  • Stripe Webhook integration and handling
  • Database interactions with Prisma ORM
  • Form handling with Svelte Superforms and Zod
  • UI styling with Skeleton UI
  • Iconography with Lucide

Technologies Used

Getting Started

  1. Clone the repository:

    git clone https://github.com/deancochran/skauth.git
  2. Install dependencies:

    pnpm install

Configuration

Stripe Setup

To enable subscription handling, sign up for a Stripe account and obtain your test API keys. To develop and test locally, you'll need to download and login to stripe through the CLI tool. https://stripe.com/docs/stripe-cli

Creating a Stripe Subscription Product in Test Mode

To set up a subscription product for testing purposes, you can follow these steps on your Stripe dashboard:

  1. Navigate to the "Products" section in the Dashboard.
  2. Click the "Create product" button. Fill in the product details, including a name, description, and pricing information.

NOTICE: It is imperative for the application that your add a TIER tag to the product you configure.

drawing

The different tags that you can specify are found in the prisma/schema.prisma file. So changing these will alter the business logic of the application.

enum UserRole {
  PRO
  BASE
}
  1. Inside the product, click the "Add pricing plan" button. Configure the plan details, such as the billing interval, currency, and amount.
  2. Go to the "Developers" section and find your API keys. Use the test publishable and secret keys for your integration.
  3. Implement Stripe into your application using the Stripe API library. Use the test API keys to update the corresponding values in the .env file:
~/.env

STRIPE_SECRET_KEY=XXXXXX
STRIPE_PUBLIC_KEY=XXXXXX

Lucia Authentication

Configure Lucia authentication by updating the authentication configuration in src/lib/auth.js.

Database (Prisma)

Create a .env file with your database connection URL:

DATABASE_URL="postgresql://user:password@localhost:5432/dbname"

Apply database migrations:

prisma migrate dev

Database (Prisma)

Run the SvelteKit application:

pnpm run dev

In a separate terminal start the webhook listener:

pnpm run stripe-webhook
# or
stripe listen --forward-to localhost:5173/stripe/webhook

cadence's People

Contributors

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