Skip to content

xditya/csms-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSMS Backend API

This is the backend API for the CSMS (Campus Services Management System) project. It provides endpoints for managing vending machine orders and monitoring system data.

Setup

  1. Clone the repository

     git clone https://github.com/yourusername/csms-backend.git
     cd csms-backend
  2. Install dependencies

  1. Configure environment variables Create a .env file with:
    MONGO_URL=your_mongodb_connection_string
  2. Run the server
     deno run --allow-net --allow-env index.ts

API Endpoints

Order Management

Get Order Details

GET /order?email={email}&hash={hash}

Returns order details for the given email and hash combination.

Parameters:

  • email: User's email address
  • hash: Order hash

Response:

{
"hash": "string",
"items": {
"itemId": "quantity"
},
"timestamp": "string",
"status": "Placed|Done",
"totalCost": number
}

Complete Order

GET /order/complete?email={email}&hash={hash}

Marks an order as completed.

Parameters:

  • email: User's email address
  • hash: Order hash

Response:

{
"status": "success"
}

Error Handling

The API returns appropriate HTTP status codes:

  • 200: Success
  • 400: Bad Request (missing parameters)
  • 404: Not Found (order doesn't exist)
  • 500: Internal Server Error

Technologies Used

  • Deno
  • Oak (web framework)
  • MongoDB
  • TypeScript

CSMS Appwrite MongoDB

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published