NiketanG / shipper-server

Mock Backend for Traffic Management System for Coastal Regions. Developed for ASEAN-India Hackathon 2021.

Home Page:http://shipper-web.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shipper

Web

Traffic Management System for Coastal Regions. Developed for ASEAN-India Hackathon 2021 - PS7 and won Encouragement Award.

Demo

Shipper-Web

For Frontend- Refer to Shipper-Web

Local Development

Prerequisites

Environment Variables

Make sure you have set the following environment variables. You can also use a .env file. An .env.example file is provided in the repo.

DATABASE_URL

Url of the Postgresql Database. For Eg. postgresql://postgres:postgres@localhost:5432/shipper

PORT

Port on which you want the server to run. For Eg. 4000
If you change this, you have to make appropriate changes in docker-compose.yml

FRONTEND_URL

URL on which the Frontend (Shipper-Web) is running Gor Eg. http://localhost:3000. If this is incorrect, you will face CORS issues

DB_ENABLE_SSL

set to true for enabling SSL connection to the database. Only set to true when deploying and your database provider only supports SSL

Install Dependencies

yarn install
or
npm install

Start Development Server

yarn dev
or
npm run dev

This will start a develoment server for the frontend on http://localhost:4000

Run Migrations

This will create necessary tables in the database. Required to run only once.

yarn init-database

Deployment

Create a production build

This will create a production build that can be deployed.

yarn build
or
npm run build

Start the Production Server

yarn start
OR
npm run start

For Deploying, you can use Docker (with Docker Compose).

The project is configured to use its own Postgresql Database, so make sure either the hosts port 5432 is free or map the port for docker container shipper_db to another port and make changes to shipper_servers environment variables section.

docker-compose up --build

Getting Started

The server uses Socket.io to provide Bi-Directional Communication to all clients connected as the location of ships changes. The Updated data is then stored in the database.

Build and Start the Frontend Server (Shipper-Web), make sure the API_URL is properly configured and follow the instructions in Getting Started.


LICENSE

Eclipse Public License (EPL)

You are free to modify the code. Redistributions are not allowed without prior request from the original author. You are obligated to include the full license and the copyrights.

About

Mock Backend for Traffic Management System for Coastal Regions. Developed for ASEAN-India Hackathon 2021.

http://shipper-web.netlify.app


Languages

Language:TypeScript 96.3%Language:Dockerfile 2.4%Language:Shell 1.3%