https://github.com/defra/aqie-back-end
Git repository for service aqie-back-end
https://github.com/defra/aqie-back-end
backend cdp node service
Last synced: over 1 year ago
JSON representation
Git repository for service aqie-back-end
- Host: GitHub
- URL: https://github.com/defra/aqie-back-end
- Owner: DEFRA
- License: other
- Created: 2024-02-26T14:51:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-11T17:12:54.000Z (over 1 year ago)
- Last Synced: 2025-02-11T18:26:48.611Z (over 1 year ago)
- Topics: backend, cdp, node, service
- Language: JavaScript
- Size: 301 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# aqie-back-end
Core delivery platform Node.js Backend Template.
- [Requirements](#requirements)
- [Node.js](#nodejs)
- [Local development](#local-development)
- [Setup](#setup)
- [Development](#development)
- [Production](#production)
- [Npm scripts](#npm-scripts)
- [API endpoints](#api-endpoints)
- [Calling API endpoints](#calling-api-endpoints)
- [Postman](#postman)
- [Docker](#docker)
- [Development Image](#development-image)
- [Production Image](#production-image)
- [Licence](#licence)
- [About the licence](#about-the-licence)
## Requirements
### Node.js
Please install [Node.js](http://nodejs.org/) `>= v18` and [npm](https://nodejs.org/) `>= v9`. You will find it
easier to use the Node Version Manager [nvm](https://github.com/creationix/nvm)
To use the correct version of Node.js for this application, via nvm:
```bash
cd aqie-back-end
nvm use
```
## Local development
### Setup
Install application dependencies:
```bash
npm install
```
### Development
To run the application in `development` mode run:
```bash
npm run dev
```
### Production
To mimic the application running in `production` mode locally run:
```bash
npm start
```
### Npm scripts
All available Npm scripts can be seen in [package.json](./package.json)
To view them in your command line run:
```bash
npm run
```
## API endpoints
| Endpoint | Description |
| :----------------------------- | :----------- |
| `GET: /health` | Health |
| `GET: /v1/entities` | Entities |
| `GET: /v1/entities/` | Entity by ID |
## Calling API endpoints
### Postman
A [Postman](https://www.postman.com/) collection and environment are available for making calls to the Teams and
Repositories API. Simply import the collection and environment into Postman.
- [CDP Node Backend Template Postman Collection](postman/aqie-back-end.postman_collection.json)
- [CDP Node Backend Template Postman Environment](postman/aqie-back-end.postman_environment.json)
## Docker
### Development image
Build:
```bash
docker build --target development --no-cache --tag aqie-back-end:development .
```
Run:
```bash
docker run -e GITHUB_API_TOKEN -p 3008:3008 aqie-back-end:development
```
### Production image
Build:
```bash
docker build --no-cache --tag aqie-back-end .
```
Run:
```bash
docker run -e GITHUB_API_TOKEN -p 3001:3001 aqie-back-end
```
## Licence
THIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT LICENCE found at:
The following attribution statement MUST be cited in your products and applications when using this information.
> Contains public sector information licensed under the Open Government license v3
### About the licence
The Open Government Licence (OGL) was developed by the Controller of Her Majesty's Stationery Office (HMSO) to enable
information providers in the public sector to license the use and re-use of their information under a common open
licence.
It is designed to encourage use and re-use of information freely and flexibly, with only a few conditions.