Git Product home page Git Product logo

nestjs-react-graphql-boilerplate's People

Contributors

twetlix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nestjs-react-graphql-boilerplate's Issues

Duplication in Readme

This boilerplate is NOT for a beginner developer as that it requires a general knowledge of GraphQL, TypeScript, Nestjs and GraphQL

As you can see GraphQL appears twice. You wanted to say React instead i guess.

Error: ENOENT: no such file or directory, open '.env.development'

Summary

Firstly, I would like to say, awesome repo. I think I am going to use this for my next project.

However, I just cloned your repo, and upon running the yarn dev command, I am receiving an error about there being no .env.development file.

That's all good and well, considering you shouldn't check in such files to source control, but you didn't document your environment variables or include a .env.example file for users to recreate the file.

Could you please update your README.md to make note of the needed environment variables and or include various .env.example files?

I even have a script below that will help you generate the .env.example file that you can use in a pre-commit hook

The Error

Error: ENOENT: no such file or directory, open '.env.development'

The Problem

I believe in your repo, you have specific .env files, but because of your .gitignore, none of these files ever made it.

See your .gitignore:

# dotenv environment variables file
.env
.env.test
.env.*

The Solution

  • Include an .env.example file, or multiple files (i.e. .env.development.example, .env.test.example, .env.production.example documenting the environment variables you are using.

    For example, the .env.example could look like the following:

    SOME_VAR=""
    ANOTHER_VAR=""
    SOME_OTHER_VAR=""
  • Document in your README.md that you have such environment variables and that you need to create these .env files for the repo to work

The Script

The below script will generate a .env.example file given an input .env file.

#! /bin/sh
# Script to generate .env.example
# Remove the values from env vars in .env except for PORT and SOME_VAR
sed -r '/(PORT|SOME_VAR)=.*/!s/(.*\=\")(.*)(\")/\1\3/g' .env >.env.example

The script will remove the values of the variables, except those environment variables you include at the begging of the script.

In the script, all values will be removed except for PORT and SOME_VAR.

For example, if this was your .env file:

PORT="4000"
SOME_VAR="some value"
API_KEY="123456789"
REDIRECT_URL="https://www.google.com"

The script will turn it into:

PORT="4000"
SOME_VAR="some value"
API_KEY=""
REDIRECT_URL=""

The reasoning is that you want to hide some environment variables, but you want others to be known.

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.