Next, clone this repository and install dependencies:
git clone git@github.com:danielstern/express-react-fullstack.git
npm install
Also, make sure MongoDB is running by navigating to the installation directory and running (in cmd or terminal), replacing the path with your chosen Mongo directory:
C:\Data\bin\mongod.exe
Now, start the development environment with the following command:
npm run dev
The application should open automatically.
This application includes a comprehensive test suite covering multiple testing layers:
- MongoDB running locally
- Application dependencies installed (
npm install) - For performance testing: k6 installed globally
Tests individual functions and components in isolation.
npm run test:unitTests API endpoints and database interactions.
npm run test:integrationEnd-to-end browser automation testing user workflows.
# Run all Selenium tests
npm run test:selenium
# Run specific tests
npm run test:selenium:login
npm run test:selenium:signupTests MongoDB schema validation and API request/response schemas.
# Run all schema tests
npm run test:schema-all
# Run database schema tests only
npm run test:schema
# Run API schema tests only
npm run test:api-schemaLoad testing with 10-100 virtual users simulating real user behavior.
# Full performance test (12-minute load test)
npm run test:performance
# Quick smoke test (30 seconds, 1 user)
npm run test:performance:smoke
# Debug mode with verbose output
npm run test:performance:debugExecute the complete test suite (unit, integration, UI, and smoke performance test).
npm run test:allGenerate test coverage reports:
npm run test:coverageCoverage reports are generated in the coverage/ directory.
- Test Environment: Isolated test database and environment variables
- Test Data: Uses predefined test users (Dev/TUPLES, C. Eeyo/PROFITING)
- Performance Thresholds:
- 100% authentication success rate
- <25ms response times for API endpoints
- 0% error rate tolerance
- Browser Testing: Chrome (headless mode available)
- Performance test results:
performance/performance_summary_report.md - Test strategy:
TEST_PLAN_AND_STRATEGY.md - Architecture overview:
day19_architecture_summary.md - Testing summaries:
day20_testing_summary.md,day21_selenium_automation_summary.md,day22_schema_validation_summary.md
Performance tests failing?
- Ensure k6 is installed globally:
brew install k6(macOS) or visit k6.io - Make sure the application is running:
npm run start-dev - Check if MongoDB is running and accessible
Selenium tests not working?
- Ensure Chrome browser is installed
- Check if application is running on localhost:8080
- For CI/CD, tests can run in headless mode
Database tests failing?
- Verify MongoDB is running
- Check test database permissions
- Ensure test environment variables are set
Problem: The application won't start!
Try:
- Run
npm installagain - Update your version of
Node.jsto the latest - Clone the finished repo and start from there
Problem: I'm getting weird error XYZ!
Try:
- Cancel
npm run dev(with ctrl-C on windows) and run it again - If there error mentions any particular file, visit that file and make sure you didn't make any common errors (capitalization of property names, forgetting to destructure paramaters with curly brackets)
- Still no luck? Clone the finished repo and prune away parts of it until you are at the point you left off.
- Create a connected username component which matches user data with an ID provided as a prop.
- Update the server-side state assembly process to include the usernames (but not passwords or any sensitive data) of any users which will be relevant to the current session.
This version of the application is found at the Add Sign Up Branch.
- Add a link to the sign up page from the login page.
- Create a Sign Up route, which is almost identical to the Login route.
- Add a saga to communicate requests from the Login Route to the server.
- Add a route to the server which creates new users in the database.
Coming February 2019.