| title | Getting Started |
|---|---|
| category | Backend |
| order | 1 |
If you get confused at any point, please message us in Slack!
Docker makes this project easier to work with. But if you don’t know how to use Docker, and you want to get started fast, that’s OK too.
If you don’t want to use Docker
- Pull the repo
- Install and run a local redis client
- Install and run a local mongo client
- cp .env.example .env
In env file
- set RACCOON_REDIS_URL=localhost.
- set MONGO_HOST_TEST=mongodb://localhost/express-mongoose-es6-rest-api-development-test and NODE_ENV=test if setting up TEST environemnt.
- set MONGO_HOST=mongodb://localhost/express-mongoose-es6-rest-api-development and NODE_ENV=development if setting up DEVELOPMENT environemnt.
- Download some Mongo data to use locally and unzip
Populate the database by running mongorestore -d sed-test sed-test-db
- Install and run the node project.
npm install (or yarn install)
npm start (or yarn start)
(Then check package.json for other builds)
When using the docker-compose up method for the backend, there a few differences when restoring the data.
First, install curl and unzip into the mongodb docker container.
docker exec -it sedaily-mongo apt update
docker exec -it sedaily-mongo apt install curl unzip
Then download the database data (you may need to download then rehost it somewhere "curl friendly") docker exec -it sedaily-mongo curl <zip file url> -o /tmp/db.zip.
Finally, unzip the file and restore it into the database.
docker exec -it sedaily-mongo unzip /tmp/db.zip -d /tmp/db
docker exec -it sedaily-mongo mongorestore -d express-mongoose-es6-rest-api-development /tmp/db
Then you can manipulate post data as usual.
- use curl or Postman to make requests
- Use RoboMongo to see the data in the database
If you want to connect frontend to backend locally, swap the comments here.
Run docker-compose up
To get used to the codebase, it might help to solve an issue with the "good first issue" label.