Stargate - sign up with GitHub login for FREE on DataStax Stargate and get a NoSQL DB up in minutes with approximately 30 million reads, 5 million writes, and 40GB of storage per month for free
(Docker container also available)
An API to manage our community data
- Commits follow the standard Conventional Commit
- Branches should be named as
issue-<issue no>
(e.g. NestJs issue number is 12)
- docker
- node
- npm
$ npm install
For connecting to Datastax Astra or a local stargate docker container the nestjs-astra
-package is required. Its hosted in the Github-Package-Repository. For this reason you need to add the following sample to your local .npmrc
.
//npm.pkg.github.com/:_authToken=<Your personal Token>
The Token can be generated in Github and needs the permission package - read
. After this step you can run npm install
as usual.
# database
$ docker-compose up
OR manually with docker docker pull stargateio/stargate-3_11:v1.0.25
Note: if you do not have Docker locally, you can run it against your FREE cloud on AstraDB, by signing up for FREE! You will need to comment out the stargate
environment variables in .env
and add your Astra credentials
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
- start the app
npm start
- visit
http://localhost:3000/swagger
Official docs at https://docs.nestjs.com/openapi/introduction
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Logging can be turned on by settings an environmentvariable DEBUG=true
If this variables is not true or undefiend no Logs will be made.
When set to true
the App will Log every incoming request.
Authentication is handled via an environment-variable called APPROVED_TOKENS
.
The approved tokens which are validated by the API are put there.
In case there should be multiple tokens, for multiple clients, they need to be comma-seperated.
To use Authentication the token needs to be passed in the token
-header of the client-request.
docker build -t eddiehub-api .
docker run -p 3000:3000 -d eddiehub-api
- Visit
http://localhost:3000/
docker run -p 3000:3000 -d ghcr.io/eddiehubcommunity/api:latest
- Visit
http://localhost:3000/