Welcome to your Basic Node API Repository. Use this to start your own Greenfield Project using nodejs, express and common industry standards.
This repository assumes a handful of industry practices and standards. We strive to keep you on the bleeding edge of the industry and as a result, we have made some opinions for you so that you don't have to; you're welcome.
Read more at https://docs.labs.lambdaschool.com/labs-api-strarter/
https://drive.google.com/file/d/1g6YoAzRyRmPL2EdwqNuUfp_BlxlPC7jS/view?usp=sharing
https://story-squad-c-api.herokuapp.com/
| Michael Barnes | John Daly | Scott Fuston | Dawson Hamm | Jesse Marek | Johan Mazorra | Jack Ross | Jacob Tharp |
|---|---|---|---|---|---|---|---|
| Web | Web | Web | Web | Web | DS | DS | TPL |
| |
|
|
|
|
|
|
|
Labs teams must follow all Labs Engineering Standards.
All routes can be viewed in the /api/README.md file
PORT- API port (optional, but helpful with FE running as well)- The following ports are whitelisted for use with okta
- 3000
- 8000
- 8080
- The following ports are whitelisted for use with okta
DS_API_URL- URL to a data science api. (eg. https://ds-bw-test.herokuapp.com/)DATABASE_URL- connection string for postgres databaseTEST_DATABASE_URL- the URL of the postgres database to run tests onOKTA_URL_ISSUER- The complete issuer URL for verifying okta access tokens.https://example.okta.com/oauth2/defaultOKTA_CLIENT_ID- the okta client ID.CC_TEST_REPORTER_ID- id for code climate testingJWTSECRET- secret for jwtACCESSKEY- access key for AWS S3 bucketSECRETKEY- secret Key for AWS s3 bucket
See .env.sample for example values
There are 3 options to get postgresql installed locally [Choose one]:
- Use docker. Install for your platform
- run:
docker-compose up -dto start up the postgresql database and pgadmin. - Open a browser to pgadmin and you should see the Dev server already defined.
- If you need to start over you will need to delete the folder
$ rm -rf ./data/pgas this is where all of the server data is stored.- if the database
api-devwas not created then start over.
- if the database
When using Docker, you will need to manually create your test database, called
api-test - run:
- Download and install postgresql directly from the main site
- make note of the port, username and password you use to setup the database.
- Connect your client to the server manually using the values previously mentioned
- You will need to create a database manually using a client.
- Make sure to update the DATABASE_URL connection string with the values for username/password, databasename and server port (if not 5432).
Make sure you create
api-devto run any queries in Postman or through the swagger documentation, as well as a database calledapi-testto run the Jest tests - Setup a free account at ElephantSQL
- Sign up for a free
Tiney Turtleplan - copy the URL to the DATABASE_URL .env variable
- make sure to add
?ssl=trueto the end of this url
you'll need separate databases for Jest testing (
api-test) and Postman/Swagger endpoint testing (api-dev) - Sign up for a free
- create your project repo by forking or using this as a template.
- run:
npm installto download all dependencies. - run:
cp .env.sample .envand update the enviornment variables to match your local setup. - run:
npm run knex migrate:latestto create the starting schema. - run:
npm run knex seed:runto populate your db with some data. - run:
npm run teststo confirm all is setup and tests pass. - run:
npm run watch:devto start nodemon in local dev enviornment.
Make sure to update the details of the app name, description and version in the
package.jsonandconfig/jsdoc.jsfiles.
See the contributing doc for more info.