- About-this-project
- Directory-Structure
- Getting-Started
- Version-Control
- Running-The-Project
- Dependancies
* PHOTOSHARING is a Social-media Application.
* In PHOTOSHARING User can Create an Account.They Maintain their Profile With Profile Photo and Other Details Also. They Can Add,Edit,Delete Post ,They Can Like and Comment on their Friends Post as well as own post and Download post image of their Friends posts.Search hashtag and user,Follow-unfollow user,Share post with other user.
+-- /app [Node.js backend using express,Mongoose]
+-- /controller
+-- [Express controllers for the REST API]
+-- /model
+-- [Mongoose model]
+-- /middleware
+-- [For jwt token verification and fileupload]
+-- /service
+-- [Diffrent general-purpose services/utils that can be used in controllers or other parts of the API]
+-- /validation
+-- [validation using joi]
+-- /routes
+-- [Routing of api to controller]
+-- /uploads
+--[uploaded images]
+-- /cofig.js [Secrect key]
+-- /app.js [The main enrty point where the app is started/intialized]
-
Install a git client.
-
Install an IDE(like visual studio code),visual studio is recommended,beacuse it has great Commandline integration and javascript building/debugging features.
-
Install Nodejs 8.10.0
-
Install mongodb 3.6.3
-
Add NODE_PATH TO environment variables with values /node_modules.
-
Enter the project folder and run the following command to get all right files in the right place
npm install
-
Start Mongodb and Node js via commandline in visual studio code.
-
Open the project in visual studio code.
-
The apllication can be accessed locally at conected device at localhost:8081.
- we use git for version control
-
Navigate to your local project root directory in the command line of your choice.
-
Start the mongodb server.
-
Run node app.js or u can use nodemon if u have installed it.
-
Open u r connected deevice and u should see the photoSharing app run locally on localhost:8081
- Open package.json to see all development and production dependencies or run npm ls in the project root directory for all installed dependencies
- Node.js is an open source server environment.
- Node.js is free.
- Node.js runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.).
- Node.js uses JavaScript on the server.
{
"version": "8.10.0"
}
- Node.js can generate dynamic page content.
- Node.js can create, open, read, write, delete, and close files on the server.
- Node.js can collect form data.
- Node.js can add, delete, modify data in your database.
- Runs the app this sever
node app.js
- Express provides a minimal interface to build our applications. It provides us the tools that are required to build our app. It is flexible as there are numerous modules available on npm, which can be directly plugged into Express.
{
"express": "~4.16.1"
}
- body-parser extract the entire body portion of an incoming request stream and exposes it on req.body. The middleware was a part of Express.js earlier but now you have to install it separately. This body-parser module parses the JSON, buffer, string and URL encoded data submitted using HTTP POST request.
{
"body-parser": "^1.19.0"
}
- CORS is a node.js package for providing a Connect/Express middleware that can be used to enable CORS with various options.
{
"cors": "^2.8.5"
}
-
MongoDB is an open-source, document database designed for ease of development and scaling. This database is also used to store data.
-
Mongoose is a client API for node.js which makes it easy to access our database from our Express application.
{
"mongoose": "^5.5.7",
"mongod": "^3.6.3"
}
- joi is use for validation.
{
"joi": "^14.3.1"
}