Coder Social home page Coder Social logo

contact-app's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.