Project Allocation Web Application for University using MEAN Stack. Projects can be floated by teachers and the students can give their preferences for these projects. In turn teachers also give their preference of students. The final allocation is done using the Gale-Shapley algorithm of stable marriages.
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.
What things you need to install the software and how to install them
- Angular CLI version 11.0.4.
- Node.js version 12.x
- Angular Material
- MongoDB version 4.2
- MongoDB Compass (optional)
If you prefer to run the website using docker, install docker
and docker-compose
, then run docker-compose up
from the root directory.
Install the following step by step in order to get a development environment up and running.
Visit the nodejs website here (Install Node) and choose the windows installer option with the appropriate architecture of your computer.
Refresh your local package index by typing :
$ sudo apt update
Adding the PPA of Node Source Repository :
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
Installing Node js. This will also install npm long with node so there is no need to download npm separately.
$ sudo apt-get install nodejs
After installation verify and check the installed verison :
$ node -v
Also check the npm version :
$ npm -v
For more reference - installation instructions
Please follow the link to install npm and node on CentOS or Fedora :
https://computingforgeeks.com/how-to-install-nodejs-on-centos-fedora/
Please follow the instructions given in the documentation - Mongo Docs Windows
MongoDB Community Edition : Please follow the instructions given in the documentation - Mongo Docs Ubuntu
MongoDB Compass : Please follow the instructions given in the documentation - MongoDB compass Ubuntu
MongoDB Community Edition : Please follow the instructions given in the documentation - Mongo Docs CentOS
MongoDB Compass (Not required unless direct visualisation of database is needed) :
sudo yum install mongodb-compass-1.20.4.x86_64.rpm
git clone git@github.com:subhash011/Project-Allocation.git
git clone https://github.com/subhash011/Project-Allocation.git
gh repo clone subhash011/Project-Allocation
npm i -g npx
Go to the main directory of the project that is Project-Allocation Execute the following commands :
cd btp-frontend
npm ci
cd ..
cd backend
npm ci
All the dependencies will be installed which otherwise have to be installed with
npm i --save packagename
.
After the above steps are completed, in the backend folder, replace the 'environment.txt' file with a file named '.env' and add all the required parameters as mentioned in the environment.txt file.
Open two terminal windows and locate to Project-Allocation/btp-frontend and Project-Allocation/backend respectively one in each of the terminal.
In the terminal where you navigated to btp-frontend folder execute the following command :
npx ng serve
or
npm start
Angular will listen to the port 4200 by default and to change the port and run use
npx ng serve --port PORT_NO
In the terminal where you navigated to backend folder execute the following command :
npm start
or
npx nodemon
or
node server.js
If nodemon is not installed then use
npm i --save nodemon
in the same terminal to install it.
Now open a web browser and go to the url http://localhost:4200 to use the web app.
-
Navigate to the
environments
folder under thesrc
folder and open the environment.prod.ts file. -
apiUrl
is the base URL to which angular application will be listening,GOOGLE_CLIENT_ID
is the ID obtained from google developer console on registering the applicationTo register the app on google's developer console follow the link given:
https://medium.com/@pablo127/google-api-authentication-with-oauth-2-on-the-example-of-gmail-a103c897fd98
when following this link choose the application type as Web Application not Others as mentioned in the link.
-
Define
apiUrl
andGOOGLE_CLIENT_ID
in the environment.prod.ts file.Optional Steps to follow to maintain the code for various deployment stages like developement, testing, production etc.
During the build the environment.ts file is replaced by environment.prod.ts file so we need not worry about the environment.ts file. To change the default behaviour head over to the angular.json file and under configurations, create a new configuration and define the file replacements in the file replacements array. This artice explains very well on how to use the file replacements array: https://medium.com/@balramchavan/configure-and-build-angular-application-for-different-environments-7e94a3c0af23
-
To build the application after completing all the configuration steps, run
ng build --prod
.if you have made any file replacements run the build command accordingly. Remember to run the ng build command in the root directory of the project i.e btp-frontend.
-
After running the build command the in step 4, the backend folder is ready to be deployed along with the necessary static files. The entire app is present in the backend folder now so it is enough to deploy this folder.
-
For deployment instructions on centos 7 follow this link:
https://www.terlici.com/2015/04/20/hosting-deploying-nodejs-centos.html
In the given link skip the 'Little customization' part.
MEAN STACK
- MongoDB - DataBase
- Express.js - Backend web application framework
- Angular - Frontend web application framework
- Node.js - Backend web framework
- Sai Vamsi Alisetti -Vamsi995
- Subhash S -subhash011
- Albert Sunny