Dev environment for Sneat.app
- Go lang in AppEngine - for backend
- Ionic on top of Angular - for frontend
- Firebase - for hosting & authentication
- Firestore - for database & real-time updates
-
Install Git
-
Install Go
-
Install Node.js
-
Install PNPM package manager
npm install pnpm -g
-
Create a
pnx
alias forpnpm run nx
alias pnx='pnpm run nx'
-
Install Firebase Emulator
pnpm install -g firebase-tools
-
Clone repositories using clone-repos.sh script. At minimum you would need to clone this repositories:
- Frontend: https://github.com/sneat-co/sneat-apps
- Backend: https://github.com/sneat-co/sneat-go-server
- Firebase/DB: https://github.com/sneat-co/sneat-firebase
-
Install frontend packages by running
pnpm install
in root ofsneat-apps
repository folder
To start frontend & backend locally:
- Start Firebase Emulator by running https://github.com/sneat-co/sneat-go-backend/blob/main/scripts/serve_fb_emulator.sh script
- Start backend by running serve-gae.sh script
- Start frontend by running
pnpm run nx serve sneat-app
in root ofsneat-apps
repository folder - Open Sneat.App local dev UI at http://localhost:4200/
- repos.sh - outputs list of Sneat repositories
- clone-repos.sh - clones Sneat repositories
- go-get-all.sh - runs
go get
for all repositories - go-build-all.sh - runs
go build
for all repositories - go-test-all.sh - runs
go test
for all repositories - nginx-self-signed-cert.sh - create self-signed certificate for serving app over HTTPS
You can serve web app by running nx serve sneat-app
from the root folder of sneat-apps.
Cypress is a powerful tool for end-to-end testing, and in the sneat-apps
project, we can run these tests in different modes: development, production and CI. Each mode is tailored to meet specific needs during the testing process.
Before running Cypress tests, ensure you have completed the following prerequisites:
- Ensure that all prerequisites listed in the "Getting Started" section are properly installed and set up.
- Confirm that the Firebase emulators are running. Use the following command to start the emulators if they're not already running:
pnpm run firebase-emulators:dev
- Make sure the
sneat-go-backend
is running. Follow the instructions in thesneat-go-backend
project README to start the backend.
In Development mode, tests are run in a way that prioritizes the ease of debugging over performance. This mode is ideal when actively developing and testing new features or fixing bugs. Here are some key aspects of the Development mode:
- Source Maps: Tests run with source maps enabled, allowing you to trace errors and logs back to your original source code. This feature significantly aids in debugging.
- Performance: Tests may run slower compared to Production mode due to the additional overhead of source maps and less optimization.
- Usage: To run Cypress tests in Development mode, use the following command:
pnpm run cy:open:dev
Production mode is optimized for performance, making it suitable for final testing before deployment or for routine checks where debugging is not the primary concern. Characteristics of this mode include:
- Optimized Code: Tests run on more optimized code, ensuring faster execution times. This is crucial for extensive test suites or when time is a factor.
- No Source Maps: Unlike Development mode, source maps are not available. This lack of source maps contributes to the faster performance but makes debugging more challenging.
- Usage: To run Cypress tests in Production mode, use the following command:
pnpm run cy:test:prod
You can run Cypress tests in either open mode or headless mode, depending on your needs:
- Development Environment:
pnpm run cy:open:dev
- Production Environment:
pnpm run cy:open:prod
- Continuous Integration Environment:
pnpm run cy:test:ci
- Development Environment:
pnpm run cy:test:dev
- Production Environment:
pnpm run cy:test:prod
For any issues or further guidance, refer to the Cypress Documentation.
By understanding the distinctions between Development and Production modes, you can better leverage Cypress testing in the sneat-apps
project to meet your testing goals.