Coder Social home page Coder Social logo

interact-backend's Introduction

This project was created with Node.js using Express, mongoDB and socket.io.

Getting Started

  • Make sure you have Node.js and mongoDB installed.

  • Create a .env file using .env.example for reference. Fill in the values as required.

  • Clone the project: git clone <project-repository-url>

  • Install dependencies: npm i

  • Start the development server: npm run server

Routes

Auth

Method Route Description
GET /auth/user Fetch user data with the given user id
POST /auth Authenticate user with the given username and password

User

Method Route Description
GET /users/:username Fetch user data with the given username
POST /users Create new user (secret key required)
PUT /users/:username Update user (pending)
DELETE /users/:username Delete user (pending)

Events

Method Route Description
GET /events Fetch events
GET /events/find Fetch events with a matching event code
GET /events/:id Fetch events with a matching id
POST /events Create new event
PUT /events/:id Update event (pending)
DELETE /events/:id Delete event (pending)

Questions

Method Route Description
GET /events/:event/questions Fetch questions for the given event
POST /events/:event/questions Create new question
PUT /questions/:eventcode Update event (pending)
DELETE /questions/:eventcode Delete event (pending)

Todos

  • Add functionality for the update and delete controllers for the different resources

  • Add functionality to emit events for update_question and delete_question to the respective routes

  • Add functionality to log events emitted by socket.io

  • Add a Dockerfile and build Docker image

Available Scripts

In the project directory, you can run:

npm start

Runs the server in the development mode.
Open http://localhost:5000 to view it in the browser.

npm run server

Runs the server in the development mode.
Open http://localhost:5000 to view it in the browser.

The server will reload if you make edits.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.