First, clone the repository
git clone https://github.com/kjsce-codecell/AskHere-ExpressMove to the Folder
cd AskHere-ExpressInstall dependencies:
npm installExecute the project but running a local server
npm run dev- expressjs - The Server File for handling and routing HTTP Requests.
- mongoose - For modeling and mapping MongoDB data to Javascript.
- ejs - For making Embedded JavaScript Templates and generating similar pages using templates.
- dotenv - Dotenv is a zero-dependency module that loads Environment Variables from a .env file into process.env. Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology.
- bcrypt - A library to help you hash Passwords.
- esm - The brilliantly simple, babel-less, bundle-less ECMAScript Module Loader.
- uuid - It is a secure way to generate Cryptographically Strong Unique Identifiers with Node.js that doesn't require a large amount of Code.
server.js- The entry point to our application. This file defines our express server and connects it to MongoDB using mongoose. It also requires the routes and models we'll be using in the application.controllers/- This folder contains the behaivour for different API calls at different routes.routes/- This folder contains the route definitions for our API.config/- This folder contains configuration for Passport as well as a Central Location for Configuration/Environment Variables.models/- This folder contains the schema definitions for our Mongoose Models.
In middlewares/errorHandler.js, we define a error-handling middleware errorHandler in addition with CustomErrorHandler at services/CustomErrorHandler.js. This middleware will respond with appropriate status code according to request status and format the response to have error messages the clients can understand
Saves user data while registering account
/api/saveUserDataIt verifies the Login Details and redirects to Dashboard if Request is truly authenticated.
/api/loginAccountWhen a User creates a Form, this API saves the Form Information like Form Name, Form Description, Form Questions, Question’s Options/Fields, etc..
/api/createFormClient side : Same response as above.
/api/showFormFillSaves user data while registering account
/api/saveUserDataThis API allows the Form Host to see the Form Repsonses and Details of the Filled Forms by Clients.
/api/showFormDataAPI allowws the user to update the form witht he modified details.
/api/updateFormAPI gets the User Details like Email ID and Name & all Form History.
/api/getAccountDataLogs out the User from the Current Session and suspends the current Session Key.
/api/logoutAccountContributions are always welcome!
See CONTRIBUTING.md for ways to get started.
Please adhere to this project's Code of Conduct.