This project contains
- a Node.js graphQL server using Express, Apollo server, Sequelize, PostgreSQL, SendGrid and Slack
- create-react-app client using Ant Design for its UI, Apollo Client and less.
The server is already configured with SubscriptionServer middleware even if there's no subscriptions defined in schema and resolvers.
git clone ...
cp .env.default .env
Edit .env
TODO DESCRIBE .env
TODO HOW TO GET SENDGRID API
TODO HOW TO SET SLACK
CREATE USER myuser;
ALTER USER myuser WITH ENCRYPTED PASSWORD 'mypassword';
CREATE DATABASE mydatabase;
GRANT ALL PRIVILEGES ON DATABASE mydatabase TO myuser;
npm install
npm run dev
npm run build
npm run prod
heroku create
heroku addons:create heroku-postgresql:hobby-dev
heroku config:set NODE_ENV=production
heroku config:set SECRET=thisismysecret
git push heroku <currentbranch>:master
Cf. Environnment file description above
Heroku deploy uses postinstall npm script to build the application and start npm script to start the server.
http://localhost:5005/graphiql
{
allUsers {
id,
name,
email
}
}
mutation {
register(
name: "Admin",
email: "[email protected]",
password: "admin"
) {
token,
refreshToken
}
}
mutation {
login(
email: "[email protected]",
password: "admin"
) {
token,
refreshToken
}
}
All contribution are very welcome especially for improving repository documentation and tests. For example, we could add a deploy in Heroku button. Please use issues for bug report and feature requests.