Check out project board
You can find it at https://github.com/orgs/multei/projects/1
We are working to follow Node.js Best Practices.
For more information about Node.js on Heroku, see Best Practices for Node.js Development.
We have our own Tech Radar
- Express;
- express-api-problem to handle API problems with ease.
- Google Cloud Storage JavaScript SDK;
- JavaScript;
- Multer;
Make sure you have installed the following dependencies:
-
Install Knex CLI (and all the other dependencies);
npm install
-
Make sure you have created the Multei database on Postgres. To create, you can use psql to run:
psql -U postgres -h localhost -c "create database multei"
-
Run all migrations
knex migrate:latest
-
Run seed files
knex seed:run
Make sure you have created your own .env
file based on .env.example
with your credentials.
npm install && npm run develop:heroku
The port exposed by the API depends on the start command executed
- Port
3000
if you runnpm start
ornpm run debug
- Port
5000
if you runnpm run develop:heroku
- Make sure you have created a bucket with viewing permissions to allUsers and allAuthenticatedUsers on Google Cloud Platform;
- Make sure you have created a service account only (with key) for production with adequate permissions;
- Set a config var called
GCP_KEY_FILE
with a path to Google Cloud Platform key file;
npm run deploy:heroku
This API uploads images to the Google Cloud storage service. To be able to upload, you need to have a service account on Google Cloud Storage with the adequate permissions.
So you need to:
- Go to APIs & Services;
- On the menu on the left panel, tap on Credentials;
- At Service Accounts section, tap on Manage Service Accounts;
- Click on Create Service Account;
- Type a name, ID and description for the new Service Account;
- On Service account permissions (optional), add a role with permissions to view and create objects on storage;
- Click on Continue;
- On Create a key (optional), click on +Create Key;
- On Key type, choose the JSON (recommended) option;
- Click on Create. The JSON key file will be downloaded;
- Put this key file on
config/
directory on the repository (create the directory if it does not exist); Never commit this file! - At local development environment, on your .env file, set
GOOGLE_APPLICATION_CREDENTIALS
toconfig/multei-{key}.json
, wheremultei-{key}.json
is the actual filename; - If your application was already running, restart it.
Thanks goes to these wonderful people (emoji key):
Jimmy Andrade 🐛 📆 👀 💻 📖 💡 |
Túlio Assis 💻 📖 🚧 📆 |
hpsmatheus 🤔 |
This project follows the all-contributors specification. Contributions of any kind welcome!