Simplistic quote saving web app, built with Nuxt and Prisma

Related tags

Nuxt quotes nuxt
Overview

QuoteDB

Started for use in a friend group, this project is both a very minimal quote DB and a nice PoC for Nuxt3 + Prisma with an API and JWT authentication.

ToDo

  • API
    • Database schema
    • Quote CRUD
    • Users
      • Login
      • Invite & register
  • User interface
    • List quotes
    • Log in & register
    • Profile
    • Invite
    • Edit quotes
  • Complete README
  • Docker configuration
  • Unbodge
    • Use native store instead of bodged cookie store for state persistence
    • Make a proper API client

Use

The database does not contain any data out of the box. You also don't need an invite token to create the first user account.

API

The API is used internally, but may also be used by 3rd party applications.

Endpoints

Method Endpoint Auth Description
GET /quotes πŸ” Lists all quotes if authenticated; only public quotes otherwise
GET /quotes/:id πŸ” Returns quote referenced by :id (if public or authenticated)
POST /quotes πŸ”’ Creates a new quote
POST /quotes/:id πŸ”’ Updates the quote referenced by :id
DELETE /quotes/:id πŸ” Deletes the quote referenced by :id
GET /user πŸ”’ Returns the profile of the authenticated user
POST /user/login ❌ Verifies the received credentials and returns a JWT token if successful
POST /user/register ❌ Creates an account using an invite token; returns a JWT token if successful
GET /user/invite πŸ”’ Creates an invite token (up to 5 per user)

Auth

The API uses Bearer authentication with JWT tokens. The table below explains the authentication/authorization indications in the endpoints table.

Icon Authorization
πŸ”’ Only authenticated access
πŸ” Only author can perform action
πŸ” Partial unauthenticated access
❌ Only unauthenticated access

Wanna help?

First of all, check out the Nuxt 3 documentation. Keep in mind this version of the framework is in beta.

Setup

  1. Install dependencies

    yarn install
  2. Copy example.env -> .env and make changes where necessary.

  3. To create/update the database schema, run Prisma migrate:

    npx prisma migrate dev

    In order for this to work, the configured database user needs permission to connect and to query and alter tables.

Development

Start the development server on http://localhost:3000

yarn dev

Test build

Build the application for production:

yarn build

You can also test migrations in production mode using:

npx prisma migrate deploy

Again, the configured database user needs to have permission to alter the DB schema in order for Prisma to work.

Deployment on Docker

The docker configuration in this repository is made for the following environment:

  • An nginx-proxy (with acme-companion) container handles incoming HTTP traffic and certificates, and is reachable via a docker network named web.
  • A Postgres database is reachable via a docker network named postgres; its URL and credentials for it are set in the DATABASE_URL variable in .env.
    The specified database user needs to be able to connect and to alter the database schema.
  • The JWT_SECRET is set in .env.

Of course you can deviate from this if you want to run this project yourself.

On startup, the container runs migrations and then starts the server.

Owner
Reinier van der Leer
I like to build stuff. :)
Reinier van der Leer
nuxt-fullpage is a nuxt module for creating fullscreen page scroll fast and simple.

Nuxt fullpage Nuxt module for creating fullscreen page scroll fast and simple. Demo online Table of contents Installation Usage Options Contributing I

Open Source Afghanistan 14 Dec 17, 2021
A convenient replacement for component when using nuxt-i18n

nuxt-i18n-link A convenient replacement for <nuxt-link> component when using nuxt-i18n. It is simply a replacement for this exact code: <nuxt-link :to

iBlueDust 1 May 25, 2021
A webpack loader i18n solution for Vue (Nuxt) with auto generated keysA webpack loader i18n solution for Vue (Nuxt) with auto generated keys

vue-i18n-loader - another webpack loader i18n solution for Vue (Nuxt) with auto generated keys. Currently under development, pull requests and suggest

BitApp 0 Aug 5, 2021
A simple nuxt renderless component wrapper around nuxt fetch capabilities

Nuxt Fetch Component A simple nuxt renderless component wrapper around nuxt fetc

Mathieu Marteau 5 Dec 30, 2021
Nuxt basic - Simple Nuxt.js project

nuxt_basic Build Setup # install dependencies $ npm install # serve with hot reload at localhost:3000 $ npm run dev # build for production and launc

null 0 Jan 4, 2022
Responsive ecommerce template built with Vue.js and Nuxt.js

Vuemmerce - Ecommerce Template Responsive ecommerce template built with Vue.js and Nuxt.js Installing # clone repository git clone https://github.com/

null 0 Nov 14, 2021
My personal website/portfolio built with Nuxt and Storyblok CMS.

My Portfolio Multilingual JAMstack site built with Nuxt.js, styled with SCSS (BEM methodology) and deployed on Netlify. I used Storyblok CMS and its i

Claudia Benito 40 Jan 24, 2022
SkimpleComponents is my personal components library built on Bootstrap and designed to be used with Nuxt.

SkimpleComponents SkimpleComponents is my personal components library built on Bootstrap and designed to be used with Nuxt. Why this library ? Bootstr

Hugo Delaunay 0 Dec 28, 2021
Nefa - Free landing page template built using nuxt and tailwindcss

NEFA Landing Page Free landing page template built using Nuxt 2 and Tailwindcss

Rafli Surya P 4 Jan 23, 2022
Build a mult-user blogging app with Supabase and Nuxt.js

Building a Multi-User Blogging App with Nuxt and Supabase This project goes along with the blog post featured on CSS Tricks. Running the project To ge

Nader Dabit 47 Jan 14, 2022
News App With Nuxt Js. SSR and SPA.

client Build Setup # install dependencies $ yarn install # serve with hot reload at localhost:3000 $ yarn dev # build for production and launch serv

Rido Ananda 0 Dec 25, 2021
Nuxt.js powered personal website also used for web development practice ⚑️

nuxtio Build Setup # install dependencies $ npm install # serve with hot reload at localhost:3000 $ npm run dev # build for production and launch se

Maximilian Niquet 0 Jan 20, 2022
Check trending anime based on anitrendz.net site. Built using nuxt

animetrend Demo: here Build Setup # install dependencies $ npm install # serve with hot reload at localhost:3000 $ npm run dev # build for productio

Ricko Veriyanto 1 Dec 12, 2021
A basic crud built with nuxt.

nuxt-app Build Setup # install dependencies $ yarn install # serve with hot reload at localhost:3000 $ yarn dev # build for production and launch se

Humayon Zafar 0 Jan 20, 2022
Strapi & Nuxt.js e-commerce app using Snipcart

Strapi & Nuxt.js e-commerce app using Snipcart Follow this step-by-step tutorial to learn how to use Nuxt.js & Snipcart to build an e-commerce PWA in

Snipcart 11 Jan 13, 2022
Movies Store App (Vue + Nuxt.js + Vuex + Appbase)

Build an end-to-end e-commerce App with Vue, Nuxt, and appbase.io (for building search). Uses Auth0 for authentication, Stripe for checkout, and Heroku / Vercel for deployment.

null 8 Dec 27, 2021
A demo deployment of Nuxt.js app to Layer0

Deploy Nuxt.js example to Layer0 A demo deployment of Nuxt.js app to Layer0. Demo https://layer0-docs-layer0-nuxt-example-default.layer0.link/ Try It

null 0 Dec 31, 2021
Discuss with Atinux Demo of using Nuxt 3 with GitHub authentication and creating issues with real-time updates.

Discuss with Atinux Demo of using Nuxt 3 with GitHub authentication and creating issues with real-time updates. See it live on https://discuss.atinux.

SΓ©bastien Chopin 63 Jan 12, 2022
πŸ• Vitesse experience for Nuxt 2 and Vue 2

Vitesse Nuxt Bridge Vitesse experience for Nuxt 2 and Vue 2. ?? Experimental Nuxt 3 version Features ?? Nuxt Bridge - Experience Nuxt 3 features on ex

Anthony Fu 138 Dec 30, 2021