Technologies • System Design • Folder Strcuture • Getting Started • API Endpoints • Collaborators • Contribute
Documentation of Backend API Application for Vizia Project
- Javascript
- HapiJS
- MySQL
- Postman
- Swagger
- App Engine
- Cloud Storage
- Cloud SQL
.
├── .github # CD pipeline configuration, triggered by GitHub Actions
├── article-service # Scrap and serves eye health articles from various sources
├── database-migrator # Database migration to define schema in cloud DBMS
├── default-service # OpenAPI Swagger documentation from whole of services
├── history-service # Handles the storage and retrieval of eye prediction data
├── user-auth-service # Manages user authentication and authorization
├── setup.sh # Entrypoint to setup nodejs dependency foreach services
├── vizia-openapi.yaml # API definition for API Gateway
└── README.md
Here is describe how to run this project locally
Here is list all prerequisites necessary for running this project. For example:
How to clone this project
git clone https://github.com/Vizia-Project/vizia-backend-service
Use the .env.example
as reference to create your configuration file .env
with your GCP and Database Credentials
NODE_ENV=development
PORT=3002
DB_HOST=
DB_PORT=3306
DB_USER=
DB_PASSWORD=
DB_NAME=
JWT_SECRET=
GOOGLE_CLOUD_PROJECT_ID=
GOOGLE_CLOUD_BUCKET_NAME=
Do the same thing on the app.yaml file of app.example.yaml
- Log in to the Google Cloud Platform (GCP) console
- Create a service account. Go to the IAM & Admin section in the navigation menu. Select Service Accounts. Click Create Service Account. Enter a Name and ID for your service account. Optionally, add a Description. Click Create and continue.
- Create a key On the service account page, click the Keys tab. Click Add Key. Select Create new key. Choose JSON as the key type. Click Create. A JSON file containing the service account key will be downloaded to your computer.
- Put service json in each service.
How to start this project
cd vizia-backend-service
./setup.sh # For linux or macos
Use setup.sh without './' for Windows
Here is list the main routes of this API, and what are their expected request bodies and responses.
route | description |
---|---|
POST /login | Validate existing account by email and password request details |
POST /register | Add a new user account and validate each of input request details |
GET /user/{id} | Get account information and settings of user request details |
PUT /user/{id} | Update account information and settings of user request details |
GET /articles | Fetch all articles from all resources request details |
GET /articles/detail | Get detail from an article request details |
GET /histories | Fetch all histories of predicts result by user account request details |
POST /histories | Save predicts result by user account request details |
GET /histories/{id} | Fetch history detail of predicts result by history id request details |
REQUEST
{
"email": "[email protected]",
"password": "4444444"
}
RESPONSE
{
"status": "success",
"message": "Login and get user are success",
"data": {
"id": 115,
"name": "Teme Wakaihasite",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6OCwiaWF0IjoxNzMzMTQ5MDU0fQ"
}
}
REQUEST
{
"name": "Teme Wakaihasite",
"email": "[email protected]",
"password": "4444444",
"password_confirmation": "4444444"
}
RESPONSE
{
"status": "success",
"message": "New account creation is success",
"data": {
"id": 115,
"name": "Teme Wakaihasite",
"email": "[email protected]"
}
}
For more API endpoint details, please visit Vizia OpenAPI Docs
Special thank you for all people that contributed for this project.
Abu Toyib Al Aziz |
Anna Stefanie Ruitan |
Here you will explain how other developers can contribute to your project. For example, explaining how can create their branches, which patterns to follow and how to open an pull request
git clone https://github.com/Vizia-Project/vizia-backend-service
git checkout -b feature/NAME
- Follow commit patterns
- Open a Pull Request explaining the problem solved or feature made, if exists, append screenshot of visual modifications and wait for the review!