Skip to content

Hashs7/memory-api

Repository files navigation

Memory api


Links

Resources

Main external packages

Plugins Description Version
@expressjs/multer 🏞 Files middleware version
sharp 🏞 Cut images version
passport-jwt 🔑 JWT authentification version
imagemin 🏞 Minify images version

Getting started

Installation

Memory Motel App : github.com/Hashs7/memory-app

Postman configuration : Memory motel.postman_collection.json

Install MongoDB

Create local database

brew services start mongodb-community
mongo
use memorymotel

Setup project

# copy env variables and fill with dev values
cp .env.example .env

# install dependencies
yarn install

HTTPS Configuration

  • Refer to the documentation of memory-app to see full HTTPS configuration steps on the app.
  • Copy the cert.pem and key.pem you generated in the /cert folder of the app to the /cert folder in the api.

Populate BDD

# Populate categories
npx nestjs-command create:memory:categories

Running the app

# development
yarn run start

# watch mode
yarn run start:dev

# production mode
yarn run start:prod

Lint code

# see lint errors and warnings
yarn lint

# fix errors and warnings automatically
yarn lint --fix

Run for production

# build for production and launch server
yarn build
yarn start

# generate static project
yarn generate

Dumps

Dump local database

mongodump --host localhost:27017 -d {dbname} --out ./dump

Dump database atlas with uri

mongodump --uri=mongodb+srv://{user}:{password}@{url}.mongodb.net/{dbname} --out ./dump-production

Restore dump to local or production database

mongorestore ./dump-production --drop
mongorestore --uri=mongodb+srv://{user}:{password}@{url}.mongodb.net/{dbname} ./dump --drop

Workflow

# init git flow
git flow init

Create feature

# init git flow
git checkout develop
git flow feature start my-feature-name
git flow feature publish my-feature-name

Finish feature

git flow feature finish my-feature-name

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages