All Projects → dadi → Api

dadi / Api

Licence: other
A high-performance RESTful API layer designed in support of API-first development and COPE. Connects your content to the world

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Api

Tensei
🚀 Content management and distribution with a touch of elegance.
Stars: ✭ 217 (+20.56%)
Mutual labels:  api, cms, headless
Contentjet Ui
Headless API-first content management system
Stars: ✭ 42 (-76.67%)
Mutual labels:  api, cms, headless
Core
🧿 Bolt 4 core
Stars: ✭ 243 (+35%)
Mutual labels:  api, cms, headless
Next
Directus is a real-time API and App dashboard for managing SQL database content. 🐰
Stars: ✭ 111 (-38.33%)
Mutual labels:  api, cms, headless
Directus
Open-Source Data Platform 🐰 — Directus wraps any SQL database with a real-time GraphQL+REST API and an intuitive app for non-technical users.
Stars: ✭ 13,190 (+7227.78%)
Mutual labels:  api, cms, headless
Flextype
Hybrid Content Management System with the freedom of a headless CMS and with the full functionality of a traditional CMS
Stars: ✭ 436 (+142.22%)
Mutual labels:  api, cms, headless
App
Directus Admin Application — An Intuitive WebApp for Managing Database Content
Stars: ✭ 464 (+157.78%)
Mutual labels:  api, cms, headless
Mezzanine Api
RESTful web API for Mezzanine CMS
Stars: ✭ 84 (-53.33%)
Mutual labels:  api, cms
Builder
Drag and drop page building using your code components
Stars: ✭ 1,281 (+611.67%)
Mutual labels:  cms, headless
Strapi
🚀 Open source Node.js Headless CMS to easily build customisable APIs
Stars: ✭ 41,786 (+23114.44%)
Mutual labels:  api, cms
Sdk Js
Directus JS SDK — JavaScript Software Development Kit for Node and Browser
Stars: ✭ 117 (-35%)
Mutual labels:  api, headless
Rageframe2
一个基于Yii2高级框架的快速开发应用引擎
Stars: ✭ 1,553 (+762.78%)
Mutual labels:  api, cms
Awesome Headless Cms
An awesome list of headless / decoupled CMS resources.
Stars: ✭ 118 (-34.44%)
Mutual labels:  cms, headless
Parvula
An extremely simple & flexible CMS generated from flat files with a complete RESTful API —
Stars: ✭ 76 (-57.78%)
Mutual labels:  api, cms
Publish
Publish provides beautiful editorial interfaces for the management of content within API
Stars: ✭ 62 (-65.56%)
Mutual labels:  cms, headless
Docker
Directus Docker — The Official Docker Container for the Directus Suite
Stars: ✭ 93 (-48.33%)
Mutual labels:  cms, headless
Core
Backpulse's core. Backpulse is an API Based CMS. Build you own website without worrying about the content administration system.
Stars: ✭ 61 (-66.11%)
Mutual labels:  api, cms
Nodejs Website Boilerplate
A Node.js website boilerplate that satisfies some common website requirements.
Stars: ✭ 154 (-14.44%)
Mutual labels:  api, cms
Payload
Headless CMS and Application Framework built with Node.js, React and MongoDB
Stars: ✭ 154 (-14.44%)
Mutual labels:  api, cms
Pop
Monorepo of the PoP project, including: a server-side component model in PHP, a GraphQL server, a GraphQL API plugin for WordPress, and a website builder
Stars: ✭ 160 (-11.11%)
Mutual labels:  api, headless
DADI API

npm (scoped) coverage Build Status JavaScript Style Guide

DADI API

Overview

DADI API is built on Node.JS. It is a high performance RESTful API layer designed in support of API-first development and the principle of COPE. It can use virtually any database engine, such as MongoDB, CouchDB, RethinkDB or simply a JSON filestore.

You can consider it as the data layer within a platform (including the data model). It is designed to be plugged into a templating layer (such as DADI Web), a mobile application or to be used with any other data consumer.

Calls to a DADI API can contain your business/domain logic (the part of a platform that encodes the real-world business rules that determine how data is created, displayed, stored and changed). It has full support for searching, filtering, limiting, sorting, offsetting, input validation and data aggregation (through support for MongoDB's aggregation pipeline).

It has built-in support for oAuth2, includes full collection-level ACL, can connect to multiple databases out of the box, provides native document versioning at collection level, supports static endpoints, includes automatic indexing, has a caching layer and can be run in a clustered configuration.

DADI API provides a starting point that's further advanced than a framework. It allows you to get a complete data layer up and running in minutes.

It is part of DADI, a suite of components covering the full development stack, built for performance and scale.

Requirements

Your first API project

Install API

The quickest way to get started with API is to use DADI CLI. See Creating an API for full installation details.

Configuration

API starts with some sensible defaults, so it's not necessary to understand all the configuration options available when first running the application.

Configuration is handled using JSON files specific to the application environment. For example in the production environment a file named config.production.json will be used. Configuration files must be placed in a config folder in your application root, for example config/config.production.json. The default start up environment is development, using the configuration file at config/config.development.json.

The bare minimum required for running the API is a server block. With only a server block, default values are used for all other properties.

Sample configuration

{
  "server": {
    "host": "127.0.0.1",
    "port": 3000
  }
}

Start the server

API can be started from the command line simply by issuing the following command:

$ npm start

Test the connection

With the default configuration, our API server is available at http://localhost:3000. If you've modified the configuration file's server block, your API will be available at the address and port you've chosen. Use cURL to check the server is running, if the connection can be made you will receive the following "Unauthorised" message.

$ curl http://localhost:3000
{"statusCode": 401}

Check the response headers

$ curl -I http://localhost:3000
HTTP/1.1 401 Unauthorized
content-type: application/json
content-length: 18
Date: Thu, 20 Apr 2017 23:42:25 GMT
Connection: keep-alive

Authentication

The HTTP 401 response received in the previous step shows that the server is running. To start using the REST endpoints you'll need a user account so you can obtain access tokens for interacting with the API.

User accounts provide an authentication layer for API. Each user account has a clientId and a secret. These are used to obtain access tokens for interacting with the API. See the Authentication section of the API documentation for full details.

Creating the first user

CLI contains an interactive "Client Record Generator" to help you create user accounts. Run the following command in the directory where you installed API:

cd my-new-api
dadi api clients:add

If you need to create user accounts in other environments (for example following a deployment to a live server), add the environment to the following command:

$ NODE_ENV=production npm explore @dadi/api -- npm run create-client

Run API as a service

To run your API application in the background as a service, install Forever and Forever Service:

$ npm install forever forever-service -g

$ sudo forever-service install -s index.js -e "NODE_ENV=production" api --start

You can now interact with the api service using the following commands:

$ [sudo] service api start
$ [sudo] service api stop
$ [sudo] service api status
$ [sudo] service api restart

Note: the environment variable NODE_ENV=production must be set to the required configuration version matching the configuration files available in the config directory.

Tests

To run the tests after cloning the repository, run the following command:

$ npm test

NOTE: API installs version 4.0.1 of Mocha and uses this when calling npm test. If you have Mocha installed globally and want to simply run mocha, if using version 4 or above, add --exit to the command so it becomes mocha --exit

Links

Contributors

DADI API is based on an original idea by Joseph Denne. It is developed and maintained by the engineering team at DADI (https://dadi.cloud)

Licence

DADI is a data centric development and delivery stack, built specifically in support of the principles of API first and COPE.

Copyright notice
(C) 2018 DADI+ Limited [email protected]
All rights reserved

This product is part of DADI.
DADI is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version ("the GPL").

If you wish to use DADI outside the scope of the GPL, please contact us at [email protected] for details of alternative licence arrangements.

This product may be distributed alongside other components available under different licences (which may not be GPL). See those components themselves, or the documentation accompanying them, to determine what licences are applicable.

DADI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

The GNU General Public License (GPL) is available at http://www.gnu.org/licenses/gpl-3.0.en.html.
A copy can be found in the file GPL.md distributed with these files.

This copyright notice MUST APPEAR in all copies of the product!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].