Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoomFX committed Jul 1, 2019
0 parents commit 57ab4fe
Show file tree
Hide file tree
Showing 63 changed files with 877,648 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.idea/
.vscode/
node_modules/
build/
tmp/
temp/
.env
redis/
documentation/
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# RECIPE NUTRITION CALCULATOR API

<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
</p>

<p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications, heavily inspired by <a href="https://angular.io" target="blank">Angular</a>.</p>

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

Final Project Assignment for Telerik Academy Aplpha with JavaScript - Design and implement single-page web application that will allow restaurant chefs to create and manage recipes composed of products with known nutrition values. During the interaction with the system users should see changes in nutrition information in real time. Newly created recipes could be tagged with a category from a list.


### User Stories - Project Timeline

- x Authenticate users - Register, Login, Logout
- x Users can CRUD recipes
- x Users can serach list of recipes by name or filter by category or by choosen nutrition value between given boundaries
- x Users can serach for product and filter by product group


### Stack

- Database - MariaDB and Redis
- REST API - NestJS

----------

# Getting started

## Installation

Clone the repository

git clone https://gitlab.com/recipe-nutrition-calculator/api.git

Switch to the repo folder

cd api

Install dependencies

npm install

----------

## Database

### MariaDB

The example codebase uses [Typeorm](http://typeorm.io/) with a MariaDB database.

Create a new MariaDB database with the name `recipes_db` (or the name you specified in the ormconfig.json)

MariaDb database settings are in ormconfig.json

Start local MariaDB server and create new database 'recipes_db'

### Redis

Start local Redis server

----------

## NPM scripts

- `npm start` - Start application
- `npm run start:dev` - Start application in nodemon
- `npm run typeorm` - run Typeorm commands
- `npm run seed` - initial seed for the database
- `npm run test` - run Jest test runner
- `npm run compodoc` - run Compodoc to see full documentation of the app

----------
5 changes: 5 additions & 0 deletions nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"language": "ts",
"collection": "@nestjs/schematics",
"sourceRoot": "src"
}
6 changes: 6 additions & 0 deletions nodemon-debug.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"watch": ["src"],
"ext": "ts",
"ignore": ["src/**/*.spec.ts"],
"exec": "node --inspect-brk -r ts-node/register -r tsconfig-paths/register src/main.ts"
}
6 changes: 6 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"watch": ["src"],
"ext": "ts",
"ignore": ["src/**/*.spec.ts"],
"exec": "ts-node -r tsconfig-paths/register src/main.ts"
}
23 changes: 23 additions & 0 deletions ormconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"type": "mysql",
"host": "localhost",
"port": 3307,
"username": "root",
"password": "root",
"database": "recipes_db",
"synchronize": false,
"logging": false,
"entities": [
"./src/data/entities/**/*.ts"
],
"migrations": [
"./src/data/migration/**/*.ts"
],
"subscribers": [
"./src/common/subscribers/*.subscriber.ts"
],
"cli": {
"entitiesDir": "./src/data/entities",
"migrationsDir": "./src/data/migration"
}
}
Loading

0 comments on commit 57ab4fe

Please sign in to comment.