The Jared Project: Jared is an ERP system for handling employees, customers other ERP features related with software companies.
Jared Back-End installation steps
-
Clone the Jared Back-End git repository
-
$ npm install
-
sudo apt-get update
-
Set up docker repository:
sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common
-
Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
-
Install Docker:
sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"
-
sudo apt-get update
-
sudo apt-get install docker-ce
-
Test: sudo docker run hello-world
-
Go to jared backend folder and run “docker-compose build”
-
Go to jared backend folder and run “npm run docker-up”
-
To work with the automatic update of your changes, you must change the execution script in package.json, replace "node app.js" for "nodemon app.js"
- Update to the latest version of master -
$ git checkout master && git pull
- Create a new branch for working on the issue
2.1
$ git checkout -b features/<#issue_number>-<name>
(If it's a new feature) 2.2$ git checkout -b bug_fixing/<#issue_number>-<name>
(If it's a bug) - Commit locally as you need -
$ git commit -m 'bla bla'
- Update your branch against master -
$ git fetch origin && git rebase origin master
- Push your branch to github -
$ git push origin <branch-name>
- Create a Pull request and assign a reviewer
- If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key.
$ heroku login
- Log in to Container Registry. You must have Docker set up locally to continue. You should see output when you run this command.
$ docker ps
- Now you can sign into Container Registry.
$ heroku container:login
- Deploy your Docker-based app. Build the Dockerfile in the current directory and push the Docker image to deploy the app.
- Build the docker image:
$ cd server && docker build -t jared-backend .
- Push the image to heroku:
$ heroku container:push web -a jared-backend
- Build the docker image:
- [Jared Backend] (https://jared-backend.herokuapp.com)
Jared API Endpoints:
- POST https://jared-backend.herokuapp.com/api/user
Request:
Response:
{ "username": "cuti", "email": "[email protected]", "password": "cuti" }
{ "status": 200, "errorInfo": "", "data": { "message": "User created!" } }
- POST https://jared-backend.herokuapp.com/api/login
Request:
Response:
{ "email": "[email protected]", "password": "cuti" }
{ "status": 200, "errorInfo": "", "data": { "message": "Login correct!" } }
- POST https://jared-backend.herokuapp.com/api/login
Request:
- GET https://jared-backend.herokuapp.com/api/[email protected]
{ "status": 200, "errorInfo": "", "data": [ { "_id": "5a8436b7a1af260010767191", "email": "[email protected]", "username": "cuti", "active": true, "__v": 0, "clients": [], "relation": "hired" } ] }
- GET https://jared-backend.herokuapp.com/api/user/cuti
{ "status": 200, "errorInfo": "", "data": { "_id": "5a8436b7a1af260010767191", "email": "[email protected]", "username": "cuti", "active": true, "__v": 0, "clients": [], "relation": "hired" }
} ```
- GET https://jared-backend.herokuapp.com/api/users
javascript { "status": 200, "errorInfo": "", "data": [ { "_id": "5a68b6516dc9920010b16229", "email": "[email protected]", "username": "alexisrcausa2", "active": true, "__v": 0, "clients": [], "relation": "hired" }, { "_id": "5a8436b7a1af260010767191", "email": "[email protected]", "username": "cuti", "active": true, "__v": 0, "clients": [], "relation": "hired" } ] }
- DELETE https://jared-backend.herokuapp.com/api/user
req = {
"id": "5a8436b7a1af260010767191",
}
{
"status": 200,
"errorInfo": "",
"data": {
"message": "User deleted!"
}
}
req = {
"id": "5a8436b7a1af260010767191",
"username": "aarias"
}
resp =
{
"status": 200,
"errorInfo": "",
"data": {
"message": "User updated!"
}
}