This program is part of Final Project Capstone Design mandated as graduation requirement of Bachelor of Engineering program at Institut Teknologi Bandung. The whole project consists of this repository as the backend and a Flutter aplication as the frontend. This API server provides drivers to MongoDB Collections and provides Henon's Map and Arnold's Map generation for image encryption that are used to safely upload and store image from the Android application.
/api/verify/api/perpanjangan/api/map
- Install Node.js and Python 3.9.
- Make sure Python 3.9 can be called by using
python3alias. - Make a
connectionString.txtfile on project's root folder. Put your MongoDB connection string inside it. - Install all Node.js dependencies by using npm.
npm install
- Install all Python dependencies by using pip.
python3 -m pip install --upgrade pip
python3 -m pip install -r ./requirement.txt
- Edit the
index.jsfile. Look forconst isHTTPSin line 26.
- Set the value to
falseif you want the server to only listen to port 80 (HTTP), or - Set the value to
trueto make the server listen to both port 80 (HTTP) and port 443 (HTTPS). Do note that you need to put your TLS certificate in lines 71-73 inindex.jsto use HTTPS, for example by using Let's Encrypt:
const privateKey = fs.readFileSync('/etc/letsencrypt/live/stnk-api-ta.tech/privkey.pem', 'utf8');
const certificate = fs.readFileSync('/etc/letsencrypt/live/stnk-api-ta.tech/cert.pem', 'utf8');
const ca = fs.readFileSync('/etc/letsencrypt/live/stnk-api-ta.tech/chain.pem', 'utf8');
-
Run the server. Linux need root access to open well-known ports.
sudo node index
Simply usenode indexon Windows.
This should showed up on your terminal.

-
Test the server by accessing
/api/test. For example, if you are using it on localhost, try to openlocalhost/api/teston your browser. You could also use the local ip, shown previously, to access it from your local network.
This should showed up:

WIP