[go: up one dir, main page]

Skip to content

shootismoke/webapp

Repository files navigation

oss image

Know how many cigarettes you smoke based on the pollution of your location.

Github Actions codeclimate spectrum


🔨 Build it yourself

Run the following commands:

# Clone this repo
git clone https://github.com/shootismoke/webapp && cd webapp

# Install dependencies.
yarn install

# Fill in secret tokens.
cp .env.example .env.development

# Run the MongoDB daemon locally.
mongod --dbpath /path/to/my/db

# Run the app.
yarn dev

The webapp will launch at http://localhost:3000. It uses Next.js, you can check out their docs.

Note: A Docker images is in the works.

Use your own API tokens

For local development, all API secret tokens should live in the .env.development file for development, as described in the Next.js docs.

Env Variable Description Url Comments
NEXT_PUBLIC_AQICN_TOKEN World Air Quality Index, used in frontend. http://aqicn.org/api Required. You can use the public one in .env.example for development.
NEXT_PUBLIC_SENTRY_API_KEY Sentry bug tracking. https://sentry.io Optional.
NEXT_PUBLIC_AMPLITUDE_API_KEY Amplitude analytics https://amplitude.com Optional. Note: we respect DNT, and we never track PII.
BACKEND_SECRET Secret used in headers between frontend and backend API calls. Please note that CORS is also enabled. n/a Required. Defaults to ssshhh! .
BACKEND_AQICN_TOKEN World Air Quality Index, used in backend. http://aqicn.org/api Required. You can use the public one in .env.example for development.
BACKEND_MAILGUN_API_KEY and BACKEND_MAILGUN_DOMAIN Credentials used for sending emails with Mailgun. https://www.mailgun.com/ Optional. Only used in the script to send emails.
BACKEND_MONGODB_ATLAS_URI Connection string to MongoDB. https://www.mongodb.com/cloud/atlas Required. Defaults to mongodb://localhost/shootismoke.

🙋 Contribute

If you find a bug, or if you have an idea for this app, please file an issue here. We really appreciate feedback and inputs!

More information on contributing here.

🔬 Tests

The codebase is covered by different types of tests:

  • Unit tests: located in the src/ folder, next to the tested files, and end with .spec.ts{x}.
  • Backend E2E tests: located in test/e2e/backend.
  • Frontend E2E tests: located in test/cypress, using Cypress.

📰 License

GPL-3.0. See LICENSE file for more information.

⭐ Credits

Created with pride by Marcelo & Amaury.