Skip to content

This is a part of a MERN stack project written in Express with MongoDB, where a user can register, login, create/edit/delete sites and view their logs

Notifications You must be signed in to change notification settings

Zishan3165/audit-log-app-backend

Repository files navigation

Audit Log System (Backend using Express and MongoDB)

A system where user will register and login and create sites, and respective logs of those actions will be shown

This is a part of a MERN stack project written in Express with MongoDB, where a user can register, login, create/edit/delete sites and view their logs. Mongoose ODM is also used

Frontend Implementation in this repository : https://github.com/Zishan3165/audit-log-app

Table of Contents

Installation

  1. Clone the repository
    git clone https://github.com/Zishan3165/audit-log-app-backend.git
  2. Navigate to the project directory
    cd audit-log-app-backend
  3. Install dependencies
    npm install

Usage

  1. Start the development server
    npm start
  2. The server will start on http://localhost:5000 by default.

API Endpoints

  • POST /users/login - Login

  • POST /users/signup - Signup

  • GET /users - Get all users

  • GET /api/users/:id - Get user by ID

  • DELETE /api/users/:id - Delete user by ID

  • POST /sites - Create a site

  • GET /sites - Get all sites

  • PUT /sites/:id - Replace existing site

  • GET /sites/:id - Get site by ID

  • DELETE /sites/:id - Delete site by ID

  • POST /logs - Post a log

  • GET /logs - Get all logs

  • GET /logs/:id - Get log by ID

Environment Variables

Create a .env file in the root directory and add the following:

PORT=5000
AUDIT_SYSTEM_DATABASE_URI=your-mongodb-database-uri

Future Works

  • Convert to typescript
  • Add more tests

About

This is a part of a MERN stack project written in Express with MongoDB, where a user can register, login, create/edit/delete sites and view their logs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published