This is a Node.js template for the Acebook engineering project.
It uses:
- Express web framework for Node.js.
- Nodemon to reload the server automatically.
- Handlebars to render view templates.
- Mongoose to model objects in MongoDB.
- ESLint for linting.
- Jest for testing.
- Cypress for end-to-end testing.
https://github.com/lucypoulton/acebook/projects/1
- Install Node Version Manager (NVM)
Then follow the instructions to update your
brew install nvm
~/.bash_profile
. - Open a new terminal
- Install the latest long term support (LTS) version of Node.js, currently
16.14.0
.nvm install 16
- Fork this repository
- Rename your fork to
acebook-<team name>
- Clone your fork to your local machine
- Install Node.js dependencies
npm install
- Install an ESLint plugin for your editor. For example: linter-eslint for Atom.
- Install MongoDB
brew tap mongodb/brew brew install mongodb-community@4.4
- Start MongoDB
brew services start mongodb-community@4.4
- Start the server
npm start
- Browse to http://localhost:3000
- Run all tests
npm test
- Run a check
npm run lint # linter only npm run test:unit # unit tests only npm run test:integration # integration tests only
The server must be running locally with test configuration for the integration tests to pass.
npm run start:test
This starts the server on port 3030
and uses the acebook_test
MongoDB database,
so that integration tests do not interact with the development server.
Some people occasionally experience MongoDB connection errors when running the tests or trying to use the application. Here are some tips which might help resolve such issues.
- Check that MongoDB is installed using
mongo --version
- Check that it's running using
brew services list
- Try swapping
localhost
, everywhere that it appears in your codebase, with127.0.0.1
. It might be surprising but this does sometimes make a difference.
If you have issues that are not resolved by these tips, please reach out to a coach and, once the issue is resolved, we can add a new tip!
- Start at 10am followed by standup
- Take 1 hour lunch whenever
- Finish at 4 for daily retro
- Work until 5:30 independently