Skip to content

πŸ’¬ Backend made in Express.js, using Docker for containerisation, JWT and Bcrypt for Authentication, and MongoDB Atlas as a database, that interfaces with a LLaMa2 LLM, all in TypeScript.

License

Notifications You must be signed in to change notification settings

PageTalk/Backend-MongoDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

95 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PageTalk (Backend)

Welcome to the backend of the PageTalk project. PageTalk allows users to upload PDFs and receive summaries, along with query-based responses.

πŸ”§ Tech Stack:

  • ExpressJS
  • TypeScript
  • Docker
  • Firebase Cloud Storage

πŸ‘¨πŸ»β€πŸ’» Technologies Used:

  • JWT: For secure header authentication and verification
  • bcrypt: For password storage and retrieval
  • body-parser and url-encoded: Middleware for parsing request bodies

Tables:

  1. Users
  2. Query
  3. PDF
  4. Admin
  5. Collection
  6. Interaction

Routes:

  • User:

    • /user/login (POST: Login User)
    • /user/:username (POST: Create User, GET: Retrieve User, PATCH: Update User)
  • Query:

    • /query/:pdfID (POSGT: Create Query, GET: Retrieve Query by Username and PDF)
    • /query/:queryID (GET: Retrieve Query by ID, PATCH: Update Query by ID, DELETE: Delete Query by ID)
  • PDF:

    • /pdf/ (POST: Create PDF)
    • /pdf/:pdfID (GET: Retrieve PDF by ID)

Try it yourself:

To run this backend on your local machine, follow these steps:

  1. Clone the repository:

    git clone https://github.com/PageTalk/Backend.git
  2. Configure your environment variables as in the .env.example file

  3. Change the current directory to the server: cd server

  4. Run

    npm install
    npm start
    
  5. Your application is now running.

Installing new npm packages

  • New packages can be installed through your preferred terminal using the normal npm i command.

Database Diagram

How JWT Works

JWT Working Showcase

How JWT is used

Credits: GeeksForGeeks

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Clone the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

About

πŸ’¬ Backend made in Express.js, using Docker for containerisation, JWT and Bcrypt for Authentication, and MongoDB Atlas as a database, that interfaces with a LLaMa2 LLM, all in TypeScript.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published