An API to manage our #EddieHub 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
Gitpod is a Service, which provides development environments in the cloud. In case no plan is purchased the reguar Opensource License
allows to use the service for 50 hours per month for free.
All that needs to be done, is logging in to their service with a valid GitHub account.
- [OPTIONAL] Install the Browser Extension from Gitpod.
- Chrome
- Firefox - Just hit the Gitpod button in the
README
file. Everything will spin up automatically. - When you're finished with your contribution just close the workspace.
$ npm install
When using gitpod, you can set environment-variables under the following link https://gitpod.io/variables
. You can even scope the variable to a specific project.
For connecting the API against the database you can use docker-compose
# database
$ docker-compose up
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
- The API-Token is a static token, which gets set in the environment-variables as
APPROVED_TOKENS
. - This token is used to authenticate an 'admin-App' against the API. The API-Token is used to generate Bearer-Tokens.
- For generating more than one token they can be passed to the environment-variables as a comma-seperated list.
- 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 environment-variable 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-separated.
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/
Join our Discord community here Subscribe our YouTube channel here