8000 GitHub - hzoppetti/contact-app
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

hzoppetti/contact-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contact App Description

This is a sample API project that allows the user to create a simple contact list.

Prerequisites

This app needs:

Quick Setup

To get started, clone or fork this project. Then run npm install.

Install PostgreSQL

Use Homebrew. If you don't have it, install it from the terminal with the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then use brew to install PostgreSQL:

brew install postgresql

Start the postgresql service:

brew services start postgresql

Setup the PostgreSQL User

Enter PostgreSQL to create the user for the application:

psql postgres

The prompt changes to postgres=> indicating that you have entered the default database, postgres as the default user, <yourusername>.

Create a New Role

You will create a new role for the contact application with a password with the command below.

But first, add your new user and password into the .env file replacing the values me and password in the fields API_PG_USER and API_PG_PASSWORD respectively.

Both default values are used here for illustration purposes:

CREATE ROLE me WITH LOGIN PASSWORD 'password';
ALTER ROLE me CREATEDB;
\q

Now you're set, the Makefile will continue with the PostSQL setup.

Load the dev db with the make script:

make load_dev_db

Running the Application

In the project directory, run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.

The page will reload when you make changes.
You may also see any lint errors in the console.

API Docs

Swagger documentation is generated on dev: npm start Once the local server is running, check them out at http://localhost:3000/docs.

TO DO

This project is still a work in progress. Like many, if not all things in life, its status will probably always be: complete but not finished.

Next up:

  • Tests - yes, I know this should have been done all along.
  • Better error handling.
  • Authentication.
  • Convert to Typescript.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0