Report cases of missing people quickly. Get alerts of people that get missing in your area. API for helplookforme
View the documentation on how to use this API here
- Clone this repository
- Install Docker on your machine
cd
into the repository- RUN
export REDIS_PASSWORD=anypasswordyouwant
- Create a .env file in the root directory of the project. A .env file stores sensitive credentials needed to run this project. After creating a .env file, copy the content of the .env.sample file and add the corresponding values. After creating a .env file, copy the content of the .env.sample file and add the corresponding values. For more information about how to do this, view the section about Setting up .env variables below
- RUN
docker-compose up
. Make sure you have a stable internet connection. - 🎉 That's it! View app on http://localhost:3000
Before setting up this project on your local machine. Ensure you have the above listed technologies installed on your machine. If you dont have them installed yet, read these guides on how to install them.
Once you have verified that the required techolologies are installed on your machine, follow the following steps to run this project.
Open your Command Prompt / CMD (on windows) or Terminal on Mac and enter this command git clone https://github.com/georgeben/Report-Missing-People-API.git
Navigate to the cloned repository by entering the command cd Report-Missing-People-API
Install the project's dependencies by running npm install
or yarn
This app depends on some services to run properly. Create an account for the following services.
- Algolia - Algolia is used to provide real time search.
- Cloudinary - Cloudinary is used for storing uploaded images.
- SendGrid - SendGrid is used for sending out emails and newsletters
- Sentry- Sentry is used for error reporting.
- New Relic - Used for Application Performance Monitoring. To monitor the app's health in production.
- Facebook Developer Account - For Log in with Facebook functionality
- Twitter Developer Account - For Log in with Twitter, and for the twitter bot
- Google Developer Account - For Log in with google
- Google recaptcha - For preventing web robots from sending API requests.
Great! Now, create a .env file in the root directory of the project. A .env file stores sensitive credentials needed to run this project. After creating a .env file, copy the content of the .env.sample file and add the corresponding values.
- NODE_ENV: This specifies the environment in which node is run e.g locally on your development machine, or in production.
- NEW_RELIC_LOG_ENABLED: Enables or disables agent specific logging. View docs
- APP_ENV: The environment in which the app is run. It could be in development, staging, production, test.
- PORT: The port to listen to for incoming requests
- CLIENT_ID: Google client ID. View docs
- DEV_DBURL: The url of your MongoDB development database
- FACEBOOK_CLIENT_ID: Facebook client ID from your Facebook developer account
- FACEBOOK_CLIENT_SECRET: From your Facebook developer account
- TWITTER_CONSUMER_KEY: From your Twitter developer account. View docs
- TWITTER_CONSUMER_SECRET: From your Twitter developer account.
- TWITTER_ACCESS_TOKEN: From your Twitter developer account.
- TWITTER_ACCESS_TOKEN_SECRET: From your Twitter developer account.
- JWT_SECRET: Any random string e.g sjkamnsdbamsbasdfksssuiqisdbas
- SENDGRID_APIKEY: Your sendgrid API key. View docs
- CLOUDINARY_CLOUDNAME: From your cloudinary console. View docs
- CLOUDINARY_APIKEY: From your cloudinary console.
- CLOUDINARY_APISECRET: From your cloudinary console.
- ALGOLIA_APPID: Your Algolia App ID. View docs
- ALGOLIA_APIKEY: Your Algolia API key.
- BOT_CONSUMER_KEY: Consumer key for the twitter bot.
- BOT_CONSUMER_SECRET: Consumer key secret for the twitter bot.
- BOT_ACCESS_TOKEN: Access token for twitter bot.
- BOT_ACCESS_TOKEN_SECRET: Access token secret for twitter bot.
- CAPTCHA_SECRET: Captch secret from your Captcha dashboard
- CONTACT_EMAIL: Email to send messages from the contact us form.
- SENTRY_DSN: Sentry's Data Source Name. View docs
Before you run the app, ensure your MongoDB database is running, and your redis server is running. Phew! Finally you can run the app by entering the command node server.js
. You should
see the some logs informing you that the app is running.
Open another terminal window, navigate to the app's repository, and run the command node worker.js
to start the workers.
And you are don......Wait wait, one more step 😄
MongoDB indices are required for geospatial queries. View docs. To set up an index,
- Enter the mongo shell by running
mongo
in your terminal - Switch to the database you created
use <dbname>
- Run
db.cases.createIndex({ 'addressLastSeen.location': "2dsphere" })
If you had any difficulty setting up, please create an issue so we can help you.
Run npm test
to run tests
Your contributions no matter how small are welcome. You can create an issue for bugs and send in PRs for fixes. Read the Contributors.md file for detailed instructions on how you can contribute.