Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Headless CMS with ExpressJS API FREE

version GitHub issues open GitHub issues closed

Product Image

Headless CMS with ExpressJS API Free is a backend built with the most popular Node.js framework.

Download

Download the .zip file from the Creative Tim site and extract it. what is the link?

Node API Setup

Introduction

Express is a minimal and flexible framework Node.js web application. Express offers core features for creating an API:

  • allows setting up a middleware for responding to HTTP requests
  • helps with routing for different HTTP methods
  • dynamically rendering HTML pages

Click here to go to the Express docs

For the data management was used MongoDB, a non-relational database that provides support for JSON-like storage.

Click here to go to the MongoDB docs

Prerequisites

For your local development you need to have Node.js and npm version 16 or above installed:

Project Installation

To install the project you need to have version 16 of Node.js and npm version 8. The first step is to run npm install command. Next you need to copy the .env.example file and name it .env. There are the variables for the database and the URLs:

  • DB_LINK="mongodb-link-to-connect"

  • JWT_SECRET="token"

  • APP_URL_CLIENT= with the default value of http://localhost:3000

  • APP_URL_API= with the default value of http://localhost:8080

  • add your mailtrap credentials in the MAILTRAP_USER and MAILTRAP_PASSWORD

Usage

For a token-based authentication passport and passport-jwt modules were used. Also for managing the database, mongoose helped. Two scripts seeding and clearing the collections and documents are found in the /src/mongo. The FREE version has a single table of users with a default user admin@jsonapi.com with the password secret.

To migrate and seed the tables the commands are:

  • npm run seed
  • npm run clear

To start the API you need to run the command npm run start:dev. For example, your React project can use it by adding in your package.json "proxy": "http://localhost:8080/" if in your local development. Check your .env variables to match your URLs.

It offers endpoint for login with the default users or it can register a new one. In the case of forgetting the password, the user can request a reset passsword and reset it. For getting and updating the user's profile it uses a Profile API.

Node API offers endpoints for common CRUD functionalities:

  • Authentication API: login, logout, forget passwors and reset password
  • Profile API: get profile, update profile

Table of Contents

Versions

Documentation

The documentation for the Node API is hosted at our here.

Resources

Dashboards built with Node API

Material Dashboard 2 React
Material Dashboard 2 React Node JS

Reporting Issues

We use GitHub Issues as the official bug tracker for the Node API PRO. Here are some advices for our users that want to report an issue:

  1. Make sure that you are using the latest version of the Node API PRO. Check the CHANGELOG from your dashboard on our website.
  2. Providing us reproducible steps for the issue will shorten the time it takes for it to be fixed.
  3. Some issues may be browser specific, so specifying in what browser you encountered the issue might help.

Licensing

Useful Links

Social Media

Creative Tim:

Twitter: https://twitter.com/CreativeTim?ref=hceja-readme

Facebook: https://www.facebook.com/CreativeTim?ref=hceja-readme

Dribbble: https://dribbble.com/creativetim?ref=hceja-readme

Instagram: https://www.instagram.com/CreativeTimOfficial?ref=hceja-readme

Updivision:

Twitter: https://twitter.com/updivision?ref=hceja-readme

Facebook: https://www.facebook.com/updivision?ref=hceja-readme

Linkedin: https://www.linkedin.com/company/updivision?ref=hceja-readme

Updivision Blog: https://updivision.com/blog/?ref=hceja-readme

Credits