Skip to content

WeHaveJoy/openPayment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create vite app

 npm create vite@latest

Build an API using PosgreSQL and pg-promise

Get going

The run an npm install.

Server side:

Database setup

Connect to the database using the postgresql user.

On macOS use this command:

psql -U postgres;

created a database & user:

create database database_name;
create role user login password 'your_password';
grant all privileges on database database_name to user;

Added the following entry to the .env file in the root of your project.

DATABASE_URL=postgres://user:your_password@localhost:5432/database_name

Create the tables

created sql folder and table.sql file to keep the data for my tables.

Connected to the database using this command:

psql -U user -d database_name

created api.js file for my api end points. created index.js file for connecting to the database and setting the port number and declaring dependencies. created a test file for testing my api functions created a travis file for runing my tests

Client side

created main.js file created app.js file for calling the APIs in the front-end created index.html for the structure of the web app, for the sigup and login form.

How it works

Sign-up or login as a user Once you're logged in, you can view the device data by clicking the link for viewing data.

What's working

  • User can be registered and logged in, their details are stored in the database
  • Device data is stored into the database

what's not working

  • Device data is not showing when the user is logged in.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published