/simple-backend-app

This is my first attempt at a backend app. It is simple and has no function

Primary LanguageJavaScriptMIT LicenseMIT

made with

Repo size lines of code

language count most language used repo stars pull requests Contributors

license environments

nodeserver-logo

Simple-nodejs-app

This is a RESTFUL API for a blog build using nodejs. It is a test and has no specific functions

Tools used

  • CORS - for preventing Cross-Origin Resourse sharing
  • Moestif - for tracking API usage
  • express - - for developing the API
  • Swagger - for documenting and testing the API
  • DBDocs - for documenting the Database
  • Heroku - for hosting the app
  • Git and GitHub - for tracking, storage and version control

How I worked on this Project

Why I built the Project this way

  • I chose MySQL for the Database because it would help me practice my SQL queries. I chose to provision the ClearDB MySQL addon from Heroku for this project

  • UI libraries are a great place to find ready-made components that help speed up the dev process. They can also be handy if one only needs a few cusom components. For these reasons, I used Bootstrap 4 and Material UI to style and build the contact form on this website.

  • My plan is to become a FullStack Engineer eventually which is why I chose to work on this project. I built this API using the expressJS framework in NodeJS.

  • I chose to document my RESTful API Server and the database used for ease of access to information about the API and its database.

How to setup the app

Option 1

  • The app has been setup and deployed on Heroku

Option 2

Alternatively, you can do the following to setup the app locally. Run the commands below in your terminal or CMD:

1 Clone the repo using this command

git clone https://github.com/Dewalade1/simple-backend-app.git
  1. Change directory to the repo folder
cd <path-to-repository>/simple-backend-app
  1. Install the dependencies using npm
npm i
  1. See Option 2 in the How to start the app section below to start the app

How to start the app

Option 1

  • The easiest way to start up the app is to click here
  • If you connected successfully, You should see Welcome to the first API homepage! written in your browser window.

Option 2

You can start the app locally or run it on a development environment using the following commands:

  • Start app locally
npm start
  • Run on a local dev environment
npm run dev

Available Scripts

  • npm start

Starts the app Open http://localhost:8080 in your browser to view it. The page will refresh if you make edits to the code. You will also see any compile and lint errors in the console.

  • npm run dev

Starts the app using a dev environment Open http://localhost:8080 in your browser to view it. The page will refresh if you make edits to the code. You will also see any compile and lint errors in the console.

Useful Links

Notes

  • The API docs allow users test the API by clicking the 'Try it out' button.

Further Improvements

  • validate data using express-validator
  • Hash the Passwords using BScript

swaggerfornodejs