Sign inSign up

ceepredictor/cee-backend-api

By ceepredictor

โ€ขUpdated about 1 year ago

A Dockerized Express.js API backend for the Assam CEE College Predictor

Image
Languages & frameworks
0

201

ceepredictor/cee-backend-api repository overview

โ ๐Ÿงญ Overview

This Docker image provides the backend API for the Assam CEE College Predictor, a web service built using Express.js and Node.js. It delivers college prediction results based on candidate ranks, seat categories, and historical cutoff data.

The API is designed to integrate with a frontend application and can be deployed as a microservice or standalone server. It is containerized using Docker for easy setup, deployment, and scalability.

โ ๐Ÿš€ Features

Key features:

  • Rank-based predictions: Input an exam rank or marks and receive a ranked list of possible colleges and branches.
  • Configurable data source: Plug in your own JSON/CSV or connect to a database (PostgreSQL, MongoDB, etc.) for cutoff and seat data.
  • Lightweight & portable: Fully containerized for consistent behavior across development, staging, and production.
  • CORS enabled: Ready to integrate with any web or mobile frontend.
  • Environment-driven: Easily override ports, data paths, and service URLs via environment variables.

โ ๐Ÿ› ๏ธ How to Run

Prerequisites:

  • Docker installed on your machine

โ Pull the image

docker pull ceepredictor/cee-backend-api

โ Run the container

docker run -d -p 3000:3000 ceepredictor/cee-backend-api

โ ๐Ÿงช Test the API

Once the container is running, you can test the API using curl or any API client (like Postman or Insomnia).

โ โœ… Example Request
curl --location 'http://localhost:3000/api/v1/predict' \
--header 'Content-Type: application/json' \
--data '{
  "rank": 89,
  "marks": null,
  "category": "GENERAL",
  "govt_reservation": 0
}'

You can configure environment variables (like database URLs or secret keys) using the -e flag or a .env file depending on your setup.

โ โš™๏ธ Configuration

VariableExampleDescription
PORT3000Port on which the Express server listens
NODE_ENVdevelopmentNode environment (e.g., development or production)
PG_DATABASE_URLpostgres://user:password@localhost:5432/dbnameURL for connecting to the PostgreSQL database
REDIS_URLredis://localhost:6379URL for connecting to the Redis instance
SENTRY_DSNhttps://[email protected]/0DSN (Data Source Name) for Sentry error tracking
BACKEND_URLhttp://localhost:3000URL of the backend server
ALLOWED_ORIGINS["http://localhost:3000", "https://yourdomain.com"]List of allowed origins for cross-origin requests (e.g., http://localhost)

Tag summary

Content type

Image

Digest

sha256:50b218231โ€ฆ

Size

65.5 MB

Last updated

about 1 year ago

docker pull ceepredictor/cee-backend-api:5