- Introduction
- Features
- Tech Stack
- Project Structure
- Setup and Installation
- Usage
- API Endpoints
- Contributing
- License
This project is a CRUD (Create, Read, Update, Delete) application built to demonstrate the basic functionalities of a typical web application. It allows users to perform various operations on a set of data, including creating new records, reading existing records, updating records, and deleting records.
- Create new records
- Read and view existing records
- Update records
- Delete records
- User authentication and authorization
- Responsive design for optimal viewing on various devices
- Error handling and form validation
- HTML/CSS/JavaScript: Standard web technologies for building user interfaces
- EJS: Embedded JavaScript templating engine
- Bootstrap: CSS framework for responsive design
- Node.js: JavaScript runtime for server-side programming
- Express.js: Web framework for Node.js
- MongoDB: NoSQL database for storing application data
- Mongoose: ODM for MongoDB and Node.js
- JWT: For user authentication
- bcrypt: For hashing passwords
- dotenv: For managing environment variables
- nodemon: For automatic server restarts during development
├── public
│ ├── css
│ ├── js
├── views
│ ├── partials
│ ├── index.ejs
│ ├── show.ejs
│ ├── edit.ejs
│ ├── new.ejs
├── config
├── controllers
├── middleware
├── models
├── routes
├── server.js
├── .env
├── README.md
└── package.json
- Node.js
- MongoDB
-
Clone the repository
git clone https://github.com/your-username/crud-application.git cd crud-application
-
Backend Setup
npm install
-
Environment Variables
Create a
.env
file in the root directory and add the following variables:PORT=5000 MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret
-
Running the Application
npm start
-
Accessing the Application
Open your browser and navigate to
http://localhost:5000
- Register a new user or login with existing credentials.
- Create a new record by filling out the form and submitting.
- View a list of existing records.
- Update any record by clicking on the edit button and modifying the details.
- Delete any record by clicking on the delete button.
- POST
/api/auth/register
: Register a new user - POST
/api/auth/login
: Login an existing user
- GET
/api/items
: Get all items - GET
/api/items/:id
: Get a single item by ID - POST
/api/items
: Create a new item - PUT
/api/items/:id
: Update an existing item by ID - DELETE
/api/items/:id
: Delete an item by ID
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature
) - Commit your changes (
git commit -m 'Add your feature'
) - Push to the branch (
git push origin feature/your-feature
) - Open a pull request
This project is licensed under the MIT License.