Robotkodarn is a project made by students at KYH and Medieinstitutet together with Vinnovera. It is based on primavera133/sample-stack.
To start project if you are running MongoDB from the cloud:
# Install dependencies
$ npm install
# Create local version of .env
$ cp .env.example .env
If you are running MongoDB locally:
# Seed local mongo database named "robotkodarn" with some data
$ npm run mongo:seed
# Start mongo in a seperate window
$ npm run mongo:start
If you prefer yarn, the app of course also work with that. Running everything locally, the app should be runnning at localhost:8000.
If npm run mongo:start doesn't work, make sure you have a folder in the root directory /data/db with the correct permissions. Do this by:
# Create a directory with the correct permission
$ sudo mkdir -p /data/db && sudo chmod 777 /data/dbFirst make sure to download the mongo shell, see mongodb.org for more info, or just install mong using homebrew:
brew install mongodb
Start project under development
$ npm run devIf you are using the local database seed it includes:
- One user maria@example.com with password 123 Make sure to remove this user before deploying
- One workshop with pin 6172
# Run build script to make project ready for production
$ npm run buildIn this project, Robotkodarn is deployed using Now. To deploy, make sure you have installed now. To install the latest version globally, run:
# Install the latest version of now
$ npm install -g nowWhen deploying, it's important to include the file .env.production. This will make sure that the environment variables are available in the production environment. To include the file, first make sure it exists in the root level of your project. Then run:
# Include the .env.production file when deploying
$ now -E .env.productionThat's it. Your project is now deployed! 🎉