A repository for the development of an API to support the public facing ePermit system to connect to the related Forest Service database, the Special Use Data System (SUDS) located in the National Resource Management System.
This repository is being developed under a task order of the Agile Blanket Purchase Agreement.
- Clone or download this repository.
- Run
npm install
to install application and all dependencies. - Run
npm start
to start Node.js server.
-
Environment variables:
- PORT | Default: 8000
- DATABASE_URL | Format: postgres://user:password@host:port/database
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION
- AWS_BUCKET_NAME
- SUDS_API_URL
- To use the moxai dependency and point at the mock API, update this to be
http://localhost:${PORT}/mocks
.
- To use the moxai dependency and point at the mock API, update this to be
-
API user account:
- To create an API user account, run
node cmd/createUser.js -u <username> -p <password> -r <userrole>
. The user role is either 'user' or 'admin'. The ‘admin’ role has permission to access all routes, but the ‘user’ role does not currently have permission to access any routes.
- To create an API user account, run
-
Dotenv:
- Dotenv is used which can load environment variables from a .env file into process.env
- Example: PORT=8080
- Scripts
- Use
npm test
to run Mocha unit tests. - Use
npm run coverage
for Istanbul code coverage. Results in /coverage folder. - Use
npm run lint
for ESLint static code analysis. Results in /lint folder. - Use
npm run fix
for ESLint code fix. - Use
npm run dba
to run Sequelize migration and seeder. - Use
npm run doc
to run JSDoc code documentation. Results in/docs/code
folder and accessed via<application-URL>/docs/code
.
- Use
- Data
- Files: Test files are stored in test/data directory
Refer to application package and dependency trackers for additional dependency information:
- Infrastructure:
- Runtime: Node.js >= 6.9.x
- Engine: NPM >= 3.10.x
- Database: PostgreSQL >= 9.4.x
- Storage: AWS S3
- Application package:
- Dependency trackers:
The Moxai package is a dependency for testing and was built specifically for this project. Moxai was published as an independent package that can be used with any Express application. This application uses the moxai package as a placeholder mock API. The /mocks/basic.json file maintains the API endpoint schema.
It is known that the api.json file is not strictly valid per the OpenAPI Specification. If this is checked against a validator it will report that it is invalid. We are allowing this to stay invalid because we felt it would be more valuable for developers to have an example data model for permits, rather than have every part of the specification be valid.
You can report issues and submit questions by opening a new Issue in GitHub. You can Watch this repo to receive notifications from GitHub when a new issue is posted, when an existing issue’s status is updated, and when a pull request is created.
See CONTRIBUTING for additional information.
This project is in the worldwide public domain. As stated in CONTRIBUTING:
This project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the CC0 1.0 Universal public domain dedication.
All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.