DESCRIPTION |
---|
MirrorInfo_shopApp project is a RESTful API built using Node.js and Express for managing tasks. It allows users to perform basic CRUD operations on tasks with attributes such as title, description, status, and timestamps. The API is designed to facilitate task management functionalities with MongoDB storage, and validation/error handling.
Follow these steps to install and run the project:
-
Clone the repository:
git clone https://github.com/jivakys/mirrorInfo_shopApp.git
-
Navigate to the project directory:
cd mirrorInfo_shopApp
-
Set up your environment variables by creating a
.env
file in the root directory. Example content:MONGODB_URL=your server url
-
Start your application:
npm run start
-
Open the app in your browser at http://localhost:4000.
Before running the application, make sure to configure the necessary environment variables in the .env
file.
Demo |
---|
Endpoints |
---|
- Signup
URL: /users/register
Method: POST
- Adds a new user to the database.
- Allows users registration with name, email, and password.
- Login
URL: /users/login
Method: POST
- Allows user login with email and password, generates a JWT token for authentication.
- Fetch All Tasks
URL: tasks/dashboard
Method: GET
- Fetches all Tasks from the Database.
- Returns an array of tasks objects with properties: id, title, description, status, timestamp
- Create Task
URL: /tasks/addTask
Method: POST
- Adds a new task to the database.
- Expects a JSON object with Task information in the request body.
- Returns a success message upon successful addition.
- Update Task
URL: /update/:id
Method: PUT
- Updates an existing task with the specified ID using the provided details.
- Returns a success message upon successful Update.
- Delete Task
URL: /delete/:id
Method: DELETE
- Deletes the task with the specified ID from the database.
- Returns a success message upon successful Delete.
FEATURES |
---|
- Authentication: The project includes JWT-based authentication to secure user data.
- Hashing: User passwords are securely hashed to protect against unauthorized access.
- dotenv: The project uses dotenv to manage environment variables and sensitive configuration data.
- Relationship: The project includes database schema relationships between collections to support complex data structures.
- Aggregation: The project uses MongoDB's aggregation framework to perform advanced queries and data manipulations.
TECHSTACKS USED |
---|
NPM PACKAGES |
---|
File Structure |
---|
mirrorInfo_shopApp
|
|----- Backend/
| |----- Config/
| | |----- db.js
| |----- Middlewares/
| | |----- authenticate.js
| |----- Models/
| | |----- taskModel.js
| | |----- userModel.js
| |----- Routes/
| | |----- taskRoute.js
| | |----- userRoute.js
| |----- .gitignore
| |----- .env
| |----- index.js
| |----- pakage-lock.json
| |----- package.json
|
|----- Frontend/
| | |----- index.html
| | |----- login.html
| | |----- signup.html
| | |----- tasks.html
| |----- CSS/
| | |----- index.css
| | |----- login.css
| | |----- signup.css
| | |----- tasks.css
| |----- IMAGES/
| |----- JS/
| | |----- index.js
| | |----- login.js
| | |----- signup.js
| | |----- tasks.js
|----- README.md/