Giter Club home page Giter Club logo

api's Introduction

api

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)

Open in Gitpod

Description

An API to manage our #EddieHub community data. Documentation https://eddiehubcommunity.github.io/api/

Rules

  • Commits follow the standard Conventional Commit
  • Branches should be named as issue-<issue no> (e.g. NestJs issue number is 12)

Requirements

  • docker
  • node
  • npm

Installation

$ npm install

Running the app locally

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 have an environment-variable called GH_TOKEN.

export GH_TOKEN=<Your token>

The Token can be generated in Github and needs the permission package - read. After this step you can run npm install as usual.

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

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

Swagger docs

  1. start the app npm start
  2. visit http://localhost:3000/swagger

Official docs at https://docs.nestjs.com/openapi/introduction

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Logging

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

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 the Docker container

  1. docker build -t eddiehub-api .
  2. docker run -p 3000:3000 -d eddiehub-api
  3. Visit http://localhost:3000/

Running the app via Docker on GitHub Container Registry

  1. docker run -p 3000:3000 -d ghcr.io/eddiehubcommunity/api:latest
  2. Visit http://localhost:3000/

License

MIT licensed.

Socials

Join our Discord community here Subscribe our YouTube channel here

MADE WITH ❤️ BY EDDIEHUBBERS ✨✨

api's People

Contributors

afuu21 avatar cahllagerfeld avatar eddiejaoude avatar fayasnoushad avatar khattakdev avatar luffysama-dev avatar panquesito7 avatar prathamesh-shanbhag avatar rahma-alwadhahi avatar rohan-kulkarni-25 avatar schmelto avatar shaileshkumar007 avatar ujjwal-kr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.