Skip to content

A quickstart using svelte as a frontend, ExpressJS and Redis for the backend. Complete with Passport for local authentication using email and password.

Notifications You must be signed in to change notification settings

Project-Starters/ExpressRedisSvelte

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExpressRedisSvelte

demo

A quickstart for a webapp built with

  • frontend: SvelteKit
  • backend: ExpressJS, Redis

Features

  • Authentication
  • Redis backend

Setup

  • create a redis database
  • add your redis credentials to server/src/index.ts
const client = redis.createClient({
    url: 'redis://redis-[...].cloud.redislabs.com:1234',
    password: ''
});
  • set a secret for the express-session
app.use(session({
    secret: '',
    ...
})
  • set the passport types in static.d.ts to be accessed on the ExpressRequest and Response object
declare namespace Express {
    export interface Request {
        user: {
            id: string
            email: string
        };
        logout: ()=>any
    }
    export interface Response {
        ...
    }
  }

Deployment

  • cloud run deployment
docker build . -t marc/server
docker tag marc/server gcr.io/[GCP PROJECT ID]/server
docker push gcr.io/[GCP PROJECT ID]/server

# make sure you're using the right gcloud project
gcloud config set project [GCP PROJECT ID]
# you may have to create the cloud run instance
gcloud run deploy server --image gcr.io/[GCP PROJECT ID]/server
# select [1] Cloud Run (fully managed)
# select your desired region

About

A quickstart using svelte as a frontend, ExpressJS and Redis for the backend. Complete with Passport for local authentication using email and password.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published