[![Open Issues](https://img.shields.io/github/issues/code-monk08/entry-management?style=for-the-badge)](https://github.com/code-monk08/entry-management/issues) [![Forks](https://img.shields.io/github/forks/code-monk08/entry-management?style=for-the-badge)](https://github.com/code-monk08/entry-management/network/members) [![Stars](https://img.shields.io/github/stars/code-monk08/entry-management?style=for-the-badge)](https://github.com/code-monk08/entry-management/stargazers) ![Maintained](https://img.shields.io/maintenance/yes/2024?style=for-the-badge&logo=github) ![Made with Node.js](https://img.shields.io/badge/Made%20with-Nodejs-blueviolet?style=for-the-badge&logo=node) ![Open Source Love](https://img.shields.io/badge/Open%20Source-%E2%99%A5-red?style=for-the-badge&logo=open-source-initiative) ![Built with Love](https://img.shields.io/badge/Built%20With-%E2%99%A5-critical?style=for-the-badge&logo=ko-fi) [![Telegram/codemonk08](https://img.shields.io/badge/Telegram-Chat-informational?style=for-the-badge&logo=telegram)](https://telegram.me/codemonk08)
Table of Contents
- Table of Contents
- About
- Features
- Tech Stack
- Installation
- Usage
- Project Structure
- API Endpoints
- Environment Variables
- Contributing
- License
About
Ingress is an easy-to-use MVP (Minimum Viable Product) for entry management. It was built using Node.js and MongoDB database with Mongoose ODM. The application uses EJS (Embedded JavaScript templates) for server-side rendering and supports sending emails and SMS notifications using the Nodemailer module and Nexmo API, respectively.
This project was implemented as a submission for the summergeeks 2020 internship challenge by Innovacer. It meets all the criteria mentioned in the assignment provided by summergeeks.
Features
- User authentication (register, login, logout)
- Host dashboard for managing visitors
- Add new visitors
- Check-in and check-out functionality
- Email notifications to hosts upon visitor check-in
- SMS notifications to hosts upon visitor check-in
- Email notifications to visitors upon check-out
- Responsive design using Tailwind CSS
Tech Stack
- Backend: Node.js, Express.js
- Database: MongoDB with Mongoose ODM
- Frontend: EJS templates, Tailwind CSS
- Authentication: Passport.js
- Notifications: Nodemailer (Email), Nexmo API (SMS)
Installation
- Clone the repository:
git clone https://github.com/code-monk08/entry-management.git cd entry-management
- Install dependencies:
npm install
- Set up environment variables:
Create a
.env
file in the root directory and add the following variables:PORT=5000 SECRET=your_secret_key EMAIL=your_email@gmail.com PASSWORD=your_email_password NEXMOAPIKEY=your_nexmo_api_key NEXMOAPISECRET=your_nexmo_api_secret
- Start MongoDB:
mongod
- Run the application:
npm start
Usage
- Open your browser and navigate to
http://localhost:5000
- Register as a new host or login if you already have an account
- Use the dashboard to add visitors and manage check-ins/check-outs
Project Structure
.
βββ app.js # Main application file
βββ config/ # Configuration files
β βββ auth.js # Authentication middleware
β βββ keys.js # Database configuration
β βββ passport.js # Passport.js configuration
βββ models/ # Database models
β βββ Host.js # Host model
β βββ Visitor.js # Visitor model
βββ routes/ # Route handlers
β βββ hosts.js # Host-related routes
β βββ index.js # Main routes
βββ views/ # EJS templates
β βββ dashboard.ejs # Dashboard view
β βββ layout.ejs # Main layout
β βββ login.ejs # Login view
β βββ register.ejs # Registration view
β βββ welcome.ejs # Welcome page
β βββ partials/ # Partial views
β βββ messages.ejs # Flash messages partial
βββ public/ # Static files
β βββ styles/ # CSS files
βββ .env # Environment variables
βββ package.json # Project dependencies
βββ README.md # Project documentation
API Endpoints
GET /
: Welcome pageGET /dashboard
: Host dashboard (requires authentication)POST /visitors
: Add a new visitorPOST /visitor/:id/checkin
: Check-in a visitorPOST /visitor/:id/checkout
: Check-out a visitorGET /hosts/login
: Login pageGET /hosts/register
: Registration pagePOST /hosts/register
: Register a new hostPOST /hosts/login
: Authenticate a hostPOST /hosts/logout
: Logout a host
Environment Variables
PORT
: The port number on which the server will runSECRET
: Secret key for session managementEMAIL
: Email address for sending notificationsPASSWORD
: Password for the email accountNEXMOAPIKEY
: Nexmo API key for SMS notificationsNEXMOAPISECRET
: Nexmo API secret for SMS notifications
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a pull request
Please make sure to update tests as appropriate and adhere to the Code of Conduct.
License
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or support, please open an issue or contact the maintainer.