Giter Site home page Giter Site logo

muskanmahajan37 / deno_registry2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from satya-nutella/deno_registry2

0.0 0.0 0.0 1.91 MB

The backend for the deno.land/x service

Home Page: https://deno.land/x

License: MIT License

Makefile 0.06% TypeScript 86.17% JavaScript 0.88% Dockerfile 0.16% Shell 0.90% HCL 11.84%

deno_registry2's Introduction

deno_registry2

This is the backend for the deno.land/x service.

Limits

There are a few guidelines / rules that you should follow when publishing a module:

  • Please only register module names that you will actually use.
  • Do not squat names. If you do, we might transfer the name to someone that makes better use of it.
  • Do not register names which contain trademarks that you do not own.
  • Do not publish modules containing illegal content.

Additionally to these guidelines there are also hard limits:

  • You can not publish more than 3 different modules from a single repository source.
  • You can not publish more than 15 modules from a single GitHub account or organization.

If you need an increase to these quotas, please reach out to [email protected].

Requirements

Preparing MongoDB

  1. Create a cluster on MongoDB Atlas. A M2 cluster is enough in most cases.
  2. Create a database user on Atlas. They should have the read write database permission.
  3. Get the database connection string and insert the username and password for the created. It should look something like this: mongodb+srv://user:[email protected]/?retryWrites=true&w=majority.
  4. Save this connection string in AWS Secrets Manager with the name mongodb/atlas/deno_registry2 and the value key MongoURI.
  5. Create a database called production in your cluster.
  6. In this database create a collection called modules.
  7. In this collection create a new Atlas Search index with the name default and the mapping defined in indexes/atlas_search_index_mapping.json
  8. In this collection create a new index with the name by_owner_and_repo like it is defined in indexes/modules_by_owner_and_repo.json
  9. In this collection create a new index with the name by_is_unlisted_and_star_count like it is defined in indexes/modules_by_is_unlisted_and_star_count.json
  10. In this database create a collection called builds.
  11. In this collection create a new unique index with the name by_name_and_version like it is defined in indexes/builds_by_name_and_version.json

Preparing Docker

Make sure to follow the official instructions to login to ECR via the Docker cli - this is needed to push the images used by the Lambda deployment to ECR.

aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com

Deploy

  1. Install aws CLI.
  2. Sign in to aws by running aws configure
  3. Install Terraform version 0.13 or higher
  4. Copy terraform/terraform.tfvars.example to terraform/terraform.tfvars
  5. Move to the terraform/ and comment out the backend section in the meta.tf file (important for first-time apply)
  6. Run the following steps:
terraform init
terraform plan -var-file terraform.tfvars -out plan.tfplan
terraform apply plan.tfplan
aws s3 ls | grep 'terraform-state' # take note of your tf state bucket name
# before the final step, go back and remove the comments from step 5
terraform init -backend-config "bucket=<your-bucket-name>" -backend-config "region=<aws-region>"

Teardown

Before destroying your staging environment, make sure to:

  1. run terraform state pull to make a local copy of your state file
  2. comment out the backend section of the meta.tf file
  3. re-initialize your terraform workspace by running terraform init -backend-config "region=<aws-region>"
  4. make sure you empty your s3 buckets, otherwise the destroy will fail

You can then run terraform destroy to completely remove your staging environment.

Development

To run tests locally, make sure you have Docker and docker-compose installed. Then run:

make test

deno_registry2's People

Contributors

lucacasonato avatar wperron avatar christophgysin 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.