npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-deploy

v0.0.6

Published

A Yeoman generator for server configs, including uWSGI, NGINX, and Supervisor settings. Useful for Django deployments.

Downloads

14

Readme

Yo Deploy

A Yeoman generator for server configuration files needed in the deployment of Django applications; including uWSGI, NGINX, and Supervisor settings.

The generator will also write a custom deployment guide based on the answers provided to its prompts.

Whilst not necessary, this generator was conceived in concurrence with the development of this Django Boilerplate.

Requirements

Getting Started

  1. The files are generated into the current working directory, so navigate to a fresh directory if necessary

  2. yo deploy

  3. Follow the prompts on screen

A Bit More Information

Find below a more detailed description of each prompt:

Name of project folder. This folder contains the entire project, both code and config files (e.g. mydomain.com) (mandatory)

The project folder is key to the entire deployment. It contains both configuration and code files. The only files related to the project that exist outside of this folder, are symlinked configurations (NGINX, etc.)


The absolute server path to this project folder (default: /srv/)

The server directory containing the project folder. This directory may contain multiple applications that exist in isolation from one another. Convention dictates this folder is located within /srv/, but I don't really care about convention. So go wild!


Name of codebase. The codebase is usually inside of the project folder, and contains the code. Usually this will be the name of a GIT repository (e.g. my-site)

Most likely the name of the codebase is the name of the GIT repository. Inside of the project folder you have directories for the configuration files, but the codebase contains the actual project code.


Relative path from the root of the codebase to the wsgi.py file, including "wsgi.py" component (e.g. src/myProject/wsgi.py)

This is a little sloppy, but uWSGI configurations must know the location of the wsgi.py file within a project. In the Django Boilerplate mentioned previously, the path from the codebase to this file would be:

<project folder>/src/<project name>/wsgi.py

Mileage may vary. The wsgi.py file may be situated at the same level as the codebase, for example.


What structure will this project's uWSGI app live under? [Standalone, Vassal]

uWSGI can be deployed directly on the project (standalone) or as an Emperor lording over vassals, with our project becoming a subservient vassal. The advatages and disadvatages can be argued.

By running an Emperor, you are putting the responsibility of killing and managing uWSGI workers in the hands of the Emperor and not Supervisor. For a standalone app, Supervisor is responsible for the uWSGI workers - kind of. That's a simplification of the argument.

For more information, learn more about uWSGI Emperor apps.


This deployment is for... [Debug, Staging, Live]

The aforementioned boilerplate relies on environmental variables to distinguish different deployments; a live environment vs. staging. This prompts helps fill in these environmental variables in the configuration files and deployment guide. The actual names of the variables may need adapting for your needs.


Will this project run under SSL?

Will it?


The domain(s) this project will be deployed under. If multiple, write as a non-delimited string (e.g. www.mydomain.com mydomain.com sub.mydomain.com)

Used in the NGINX configuration. The answer is reprinted verbatim on the domain key of the NGINX config. This means that multiple domains can be supplied.


Would you like to generate a deployment guide for your project?

A personalised deployment guide will be generated from the answers given previously, and standard practices for new deployments.


What is the name of the UNIX user your project will run under? (default: )

In theory each deployment would live under its own UNIX user, to isolate it from other applications. The generator uses the UNIX user provided to make the generated guide a lot more helpful.

Sub-generators

Each component of the deployment exists as a seperate sub-generator. This means that any individual part of the deployment can be generated on its own. To deploy a specific component, enter one of the following commands:

yo deploy:uwsgi
yo deploy:nginx
yo deploy:supervisor
yo deploy:documentation