Skip to content
/ crud Public

A basic CRUD application for managing products with user authentication and authorization

Notifications You must be signed in to change notification settings

Sbrjt/crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple Express.js application for creating a basic CRUD API with user authentication and authorization. It follows the MVC model, incorporates session-based authentication and uses a sqlite database. It is deployed on Render.

End points

  • GET /login: Displays the login page.
  • POST /login: Processes user login.
  • POST /register: Registers a new user.
  • GET /dashboard/all: Retrieves all products.
  • GET /dashboard/product: Retrieves a product by ID (with query parameter /dashboard/product?id=xyz).
  • POST /dashboard/product: Adds a new product (requires admin rights).
  • DELETE /dashboard/product: Deletes a product (requires admin rights).

For admin rights, use username admin and password 1234.

Project Structure

root
│
├── server.js 
│
├── models/           
│   ├── data.db
│
├── views/            
│   ├── auth.html
│   ├── dashboard.html
|
├── controllers/            
│   ├── authCtrl.js
│   ├── prodCtrl.js
|
...

Installation

Clone/download the repo. Install dependencies (npm install). Start the server (on http://localhost:3000).

About

A basic CRUD application for managing products with user authentication and authorization

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published