- 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.
- Bootstrap for template rendering of HTML and CSS.
- Sign up: validation
- Log in: validation
- Log out: end the session
- Show posts in reverse chronological order
- I want to see a users name/photo next to each post
- I want to be able to comment on a post
As a User
So that I can have my own personalised profile
I want to be able to sign up
As a User
So that I can retrieve my profile
I can log in
As a User
So that I can keep my profile secure
I can log out
As a User
So that I keep up to date with my friend's latest posts
They should be displayed in reverse chronological order
As a User
So I can clarify who I'm talking to
I want to see a user's name and photo with their posts
As a User
So that I socialise with my friends
I want to comment on posts
As a User
So that people can know more about me
I want to be able to create a profile
As a User
So that I visually share my life with my followers
I want to be able to post photos
As a User
So that I can get around the site easily
I want to see a nav bar at the top of every page
As a User
So that I can show my appreciation on a post
I want to be able to like a post and see all the likes
As a User
So that I can see my past posts and profile
I want to be able to visit my profile
As a User
So that I can use the website
I want to access the site from a Heroku link
Credit to Bromley and his team for some code we re-used (with permission) within the /cypress/plugins/index.js and /cypress/support/index.js to enable auto clearing of test databases (code taken from here )
- 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
- 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 [email protected]
- Start MongoDB
brew services start [email protected]
- 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.