Skip to content

mobycrypt/siwe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SIWE App

Sign-in-with-Ethereum (SIWE) application. It allows to sign-in to the application using Ethereum wallet and then create and save a profile with username and bio. Profile can be edited. Username and bio can't be empty. Username must be unique.

Architecture

Application consists of client web application, backend service and database.

Client

Client application is built with Quasar Framework. This is a Vue.js 3 based framework for building SPA, SSR, PWA, Mobile (Cordova) apps. It has a rich UI components library, typescript support, linter, platform detection support, and many more.

WalletConnect is used for supporting Ethereum wallet connection on mobile. Pinia is used as a state management library. Axios is a HTTP client library.

Backend

Backend is a Node.js application built with Express.js and Routing Controllers. This popular web framework for Node.js provides a lot of features out of the box, including routing, middleware support. Routing Controllers (with dependencies) add decorators support and object schema validation.

Backend saves data in PostgreSQL. Sequelize is used as ORM.

express-session with connect-session-sequelize is used for persistent session management (session data stored in Postgres).

Local installation

Client

Pre-requisites: Node.js 20.8.0

For Node.js version management you can use nvm. To install and use Node.js 20.8.0 run:

nvm install 20.8.0

Start client:

cd siwe-client
npm install
npm run dev

Application will be available on http://localhost:8080.

quasar.config.js is a configuration file. You can change there a dev server settings, SIWE domain settings, etc.

Backend

Pre-requisites: Docker and docker-compose.

Start backend:

cd siwe-backend
docker-compose -f docker-compose-local.yaml up -d

Backend listens on port 8000 by default. You can change it in docker-compose-local.yaml file. Database Docker volume is mounted under ./volumes/postgres-data directory.

Default session expiration time is 24 hours. You can change this editing SESSION_EXPIRATION_MINUTES env var (in docker-compose-local.yaml file).

About

Sign-in-with-Ethereum Application POC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published