Skip to content

50UM3N/student-records

Repository files navigation

Student Records

Simple Web Application that offer you to add, edit and search a student' name, degree, email, phone and his/her image using Node.js and mongodb

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

You have to install Node.js in your machine.

Installing

After installing node clone the repo by using git

git clone https://github.com/50UM3N/student-records.git
                        or
git clone git@github.com:50UM3N/student-records.git

Or you can download the zip file.

Then open cmd or git bash on the project folder to install some modules that I used to build this project

Install Once

npm install

or

Express Js For server framework

npm i express

DotEnv For loads environment variables from a .env file into process.env

npm i dotenv

EJS (Embedded JavaScript templating) For use server side javascript in clint side

npm i ejs

Express Flash For display flash messages in express application

npm i express-flash

Express Session For use the express flash

npm i express-session

Mongoose For mongodb connection

npm i mongoose

Nodemon For automatically restart the server as a dev dependency (optional)

npm i --sav-dev nodemon

Setting Database

For the database I use mongodb Atlas. But you can use the local also.

Rename the file .env_sample to .env then replace "connection string" to your connection string

Example

MONGO_URL=mongodb+srv://dbUser:youruser@cluster0-kfx8y.mongodb.net/test?retryWrites=true&w=majority

Setting google and github oAuth

Visit Google Developer Console to create the google client id and clint secret and add this into .env. like,

GOOGLE_CLIENT_ID=xxxxxxx111111222222

GOOGLE_CLIENT_SECRET=xxxx1111222

Similarly go to GitHub Developer to get the GitHub client id and clint secret and add it into .env. like,

GITHUB_CLIENT_ID=xxxxxxx111111222222

GITHUB_CLIENT_SECRET=xxxx1111222

And then add the call back url to your project server ip/domain. Like,

CALLBACK_URL=http://localhost:8080

Running the App

If you install nodemon the you can use. (devStart script is already added to the package.json)

npm run devStart

or

node server.js

Preview

preview image

Live Demo

For deploy the project I use heroku

Student Records

Built With

  • Node Js - The Backend
  • NPM - Dependency Management
  • GIT - Used for version control
  • Heroku - Used to Deploy Node.js applications