This started out as a project to learn graphql following a Udemy course. Halfway through that course I discovered it was a couple years out of date and so I had to pivot the project I was working on. This is still a project but I would be happy to evolve it into something more. I'
Vite + TypeScript + Vue3 + GraphQl + Prisma + Pinia + WindiCss
This project was created as a demo and I don't have anything set up for contributors at the moment. If someone is feeling adventurous you're welcomed to try and follow the steps below to get up and running yourself.
Right now it has two modes: demo (unauthenticated) and authenticated (using Auth0).
With the authenticated mode you will need both an Auth0 application as well as an Auth0 API, the settings of which are included below. In demo mode you can login with an email for an existing creator (which requires creating an creator with Prisma Studio) and create posts.
The post interactions are fully wired up. You can register a new creator and update creator settings. You can create and delete posts but you cannot edit or share posts.
This is a rough draft giude to setting up Point-Of-Vue on your machine for local development.
-
Install Node Modules
npm install
-
Configure your environment variables by creating a .env file with the following variable:
-
DATABASE_URL="YOUR_POSTGRES_URL"
2a. you can spin up a local postgres database using the docker-compose.yml file included in this project, by running the command:
docker-compose up -d
before spinning up any of the following programs. If you do, this is your DATABASE_URL:postgresql://postgres:postgres@localhost:5438/postgres
-
These are other environment variables that can be configured:
ORIGIN="http://localhost" ORIGIN_PORT=8080 GRAPH_URL="http://localhost" GRAPH_PORT=8100 GRAPH_PATH="graphql" STUDIO_URL="http://localhost:8200" AUTH0_DOMAIN="some-domain.us.auth0.com" AUTH0_CID="YOUR_CLIENT_ID"
3b. The ORIGIN is the vite server or static webserver for the client app. If port 80 is used for any of the PORT variables, it will be omitted from the constructred url. The GRAPH_URL is the graph-ql server and STUDIO_URL is for Prisma Studio.
-
Run the application(s). There are three programs that run this application for local development. There is the server (apollo/graphql-yoga + playground), client (vite powered frontend), studio (prisma studio for editing data tables). The command below will run all three applications simultaneously with live reload. Any changes made to the files in schema will trigger a reload of the server and client applications.
npm run dev
-
If you run the defaults, the following urls are reachable:
- http://localhost:8080 -- [client]
- http://localhost:8100 -- [server]
- http://localhost:8100/graphql -- [playground]
- http://localhost:8200 -- [studio]
Demo: https://point-of-vue-web.onrender.com/
This demo is deployed on Render.com using a postgres db service, a webserver service (for graphql-yoga), another webserver service for the studio (optional), and a static service for the client.
This open source project was made possible by the following platforms and open source projects
The frontend is written in Vue with TypeScript using the composition API and the most modern best practices.
VueUse is like VueJs's version of jQuery providing both computational utilities as well as UI utilities.
WindiCss provides class based styling and easy theming in the lightest set of deliverables for a rich visual experience and rapid development.
Pinia stores the state of the frontend for components to remain up to date with data subscriptions to the backend GraphQL server.