Skip to content

This repository contains the codebase of the Velocity Club's website

Notifications You must be signed in to change notification settings

Velocity-IIITDWD/velocity-website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Velocity Website Admin Panel Backend

A brief description of api endpoints of the admin panel

Appendix

Auth middleware and image upload will be added after writing all the endpoints

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

MONGODB_URI

Deployment

To test this project, run

  npm run start:dev

API Reference

Events

Get all events

  GET /events

Get an event

  GET /events/${id}
Parameter Type Description Validation
id string required valid mongodb _id

Add a new event

  POST /events/new
Body Parameter Type Description Validation
title string required ascii only, minLength: 5, maxLength: 100
description string required ascii only, minLength: 10, maxLength: 1000
eventDate date required date must be in ISO 8601 format
poster url Optional image url
images array Optional array of urls
winners [Schema:Student] Optional array of objs contains winner details

Update an event

  PUT /events/${eventId}

same body ref for creating a new event.

Delete an event

  DELETE /events/${eventId}
Parameter Type Description Validation
id string required valid mongodb _id

Students

Get all students :pagination supported

  GET /students
Query Parameter Type Description Validation
page number Optional default value is 1

Get a single student details

  GET /students/${registrationNumber}
Parameter Type Description Validation
registrationNumber alphanumeric required valid registration number

Add a student

  POST /students/add
Body Parameter Type Description Validation
name string required alphabetic, minLength: 3, maxLength: 30
registrationNumber string required alphanumeric, minLength: 6, maxLength: 9
password string required minLength: 6, maxLength: 30

Update student details

  PUT /students/${registrationNumber}
Body Parameter Type Description Validation
name string required same validation
password string Optional same validation

Delete a student details

  DELETE /students/${registrationNumber}
Parameter Type Description Validation
registrationNumber string required. valid registration number

Running Tests

To run tests, run the following command

Note: Test functions have not been added yet!

  npm run test

About

This repository contains the codebase of the Velocity Club's website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published