Code Monkey home page Code Monkey logo

internly-api's Introduction

InternEvents

An Express based backend server for InternEvents

Stucture

/app contains all the functional code with the MVC structure
	server - the central server setup
	/controllers consists of the controller or view functions implementing the business logic
	/routers routes the requests mapped to the respective urls and forwards to the controller functions
	/schema has the database models specified
	/socket socket.io handler for realtime chats
	/utils
		auth - several authentication/authorization functions
		staticStorage - utility functions for media storage
		utils - miscellanous utility functions
		validators - functions to validate the incoming data
/media stores all kinds of media items such as profile pictures, resumes, etc

/controllers and /routers both are divided into 3 submodules :-
	1) accounts
	2) internships and events
	3) social (posts, user-to-user interactions, messaging)

REST API

Note : All the text based data is in JSON format and the files are passed as FormData

Accounts

	GET /searchAccounts/:keyword
	Returns a list of accounts matching the keyword
	Response :
		Array(Account)

	POST /createStudentAccount
	Creates a student account and logs the user in
	Body :
		email, password, contactNumber, firstName,
		lastName, dateOfBirth, gender, college,
		course, yearOfStudying
		(Optional)
		description
	Cookie :
		accessToken
	Response :
		Object(Account)

	POST /createCollegeAccount
	Creates a college account and logs the user in
	Body :
		email, password, contactNumber,
		name, address, university
		(Optional)
		description
	Cookie :
		accessToken
	Response :
		Object(Account)

	POST /createCompanyAccount
	Creates a company account and logs the user in
	Body :
		email, password, contactNumber,
		name, address
		(Optional)
		description
	Cookie :
		accessToken
	Response :
		Object(Account)

	POST /login
	Logs the user in
	Body :
		email, password
	Cookie :
		accessToken
	Response :
		Object(Account)

	POST /refresh (AUTHORIZED)
	Checks for the access token and logs the user in
	Cookie :
		accessToken
	Response :
		Object(Account)

	POST /uploadResume/:id (AUTHORIZED)
	Uploads the resume for the specified account
	Body :
		resume(.pdf)
	Response :
		String(resumeUrl)

	POST /uploadProfilePicture (AUTHORIZED)
	Uploads the profile picture for the specified account
	Body :
		profilePicture(image)
	Response :
		String(profilePictureUrl)

	PUT /updateEmail/:_id (AUTHORIZED)
	Updates the email of the specified account
	Body :
		email
	Response :
		Object(Account)

	PUT /updatePassword/:_id (AUTHORIZED)
	Updates the password of the specified account
	Body :
		password
	Response :
		Object(Account)

	PUT /updateAccount/:_id (AUTHORIZED)
	Updates the non-credential details of the specified account
	Body :
		(Optional, may differ according to the account type)
		contactNumber, firstName, lastName, dateOfBirth,
		gender, college, course, yearOfStudying,
		name, address, university
	Response :
		Object(Account)

	DELETE /logout/:id (AUTHORIZED)
	logs the user out

internly-api's People

Contributors

billafy avatar

Watchers

 avatar

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.