A public API for the web app, and mobile apps to consume.
If you are reading this, thanks for stopping by. You may be familiar with the Redadalertas project.
This project is part of that. This repo will house the code to make the public facing API.
https://cosecha.github.io/redadalertas-api/
Make sure you have the following installed on your computer
xcode-select --install
(required to properly install the bcrypt package)cp src/.env.example src/.env
DB_CONNECTION_STRING_DOCKER=mongodb://docker.for.mac.localhost:27017/redadalertas
)brew upgrade mongodb-community
; you may have to clear /data/db)brew services start mongodb-community
mongod
cd src
, then yarn install
yarn run bootstrap
in the /src directorydocker build .
in the / directory (should end with "Successfully built [image ID]")docker run -p 127.0.0.1:8080:8080 -it [image id]
Ctrl + c
in server terminal (available since you used -it flag on docker run), or docker stop [container ID]
(run docker ps
to get list of active container IDs)brew services stop mongodb-community
Ctrl + c
in mongod terminal, or open the command interface: mongo
--> use admin
--> db.shutdownServer()
--> exit
You can run direct Yarn commands whenever you make changes.
Instead of using Docker in steps 10 and 11 above:
yarn run build
: compiles the app into /buildyarn start
: starts the server (Ctrl + c
still stops it)We use Yarn instead of NPM commands in the /src directory.
yarn install
: installs Node modulesyarn run build
: compiles the app into /buildyarn start
: starts the serveryarn test
: performs testingyarn run lint
: runs the linteryarn run bootstrap
: populates your local mongo db with sample data (warning: this will reset your database)