TarasMakarchuk / ek-blog_nestjs_graphql_postgres_redis_typescript_typeorm

This project has been moved from the employer's private repository to gitlab. Blog on the nestjs+graphql with the ability to add articles, authorization, role guards

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NestJS GraphQL TypeScript NPM Postgres Docker Redis Heroku WebStorm CSS3 HTML5 JavaScript Jest GitLab

The project "EK-Blog" enables authors to write, edit and publish their articles.


Part I To start the project to local:

1. Rename .env.dist file to .env
2. $ npm install
3. $ npm run migration:run
4. $ npm run start:dev

Part II To start the project using the docker container:

1. Rename .env.dist file to .env
2. in file .env uncomment section --Postgers Docker-- and comment --Postgers local--.
3. in docker-compose.yml change ports to 5433:5432.
4. $ npm install
5. $ docker-compose up
6. $ npm run migration:run
7. $ npm run start:dev or npm run start:prod

Part III To deploy the project on Heroku link

1. Create a new app on Heroku
2. In the project tab on Heroku "overview" install the add-on Heroku-Postgres
3. In the project tab on Heroku "overview" install the add-on Heroku-Redis
4. Create the Procfile in your project root directory and paste the following line into it: $ web: npm run start:prod
5. Follow the steps to deploy the project to Heroku in the "Deploy" tab
6. In the Heroku app go to the "settings" tab of the project,
click on the button "Reveal Config Vars"
add the following keys and values ​​to the fields:
DATABASE_URL: we take in the project on Heroku, tab resources, Heroku Postgres, settings, button View Credentials, copy the entire URI line
TYPEORM_CONNECTION: postgres
TYPEORM_URL: we take in the project on Heroku, tab resources, Heroku Postgres, settings, button View Credentials, copy the entire URI line
TYPEORM_PORT: 5432
JWT_SECRET: heroku
JWT_EXPIRES_IN: 1000d
TYPEORM_DRIVER_EXTRA: {"ssl":true}
NODE_TLS_REJECT_UNAUTHORIZED: 0
SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
SMTP_SUPPORT_EMAIL=ek.space.01@gmail.com
SMTP_SUPPORT_PASSWORD=generate a password following this instruction link
REDIS_HOST=ec2-52-211-224-65.eu-west-1.compute.amazonaws.com
REDIS_PORT=14510
REDIS_PASSWORD=we take in the project on Heroku, tab resources, Heroku Redis, settings, button View Credentials, copy the entire password line
REDIS_URL=we take in the project on Heroku, tab resources, Heroku Redis, settings, button View Credentials, copy the entire URI line

7. Add migrations to Postgres on Heroku:
$ npm run migration:run
8. Run the command $ git push heroku master

About

This project has been moved from the employer's private repository to gitlab. Blog on the nestjs+graphql with the ability to add articles, authorization, role guards


Languages

Language:TypeScript 94.4%Language:JavaScript 2.9%Language:CSS 0.9%Language:Handlebars 0.9%Language:HTML 0.7%Language:Procfile 0.1%