Skip to content

CardMesh/rest-api

Repository files navigation

Restful CRUD API for CardMesh

CI status Contributors Forks Stargazers Issues MIT License

CardMesh is an app aimed at modernizing the sharing of business cards within a company. It displays digital business cards in a web browser, accessible via NFC tags, QR codes, or direct URLs.

Tech Stack

Node.Js Express npm MongoDB Docker

Versions & Dependencies

Version Documentation
1.0.4 current

Requirements

  • Node.js >= 18.x

Documentation

Explore the REST API

The app defines the following CRUD APIs.

Auth

Method Url Description
POST /api/auth/signup Sign up
POST /api/auth/login Log in
POST /api/auth/recover Recover
PUT /api/auth/reset Reset

Users

Method Url Description
GET /api/users Get all users
GET /api/users/:id Get specific user
GET /api/users/:id/vcf Get vcf file for specific user
GET /api/users/:id/vcards Get vcard options for specific user
GET /api/users/:id/statistics/clicks Get click statistics for specific user
POST /api/users/:id/images Upload image for specific user
POST /api/users/:id/statistics/clicks Create click statistics for specific user
PUT /api/users/:id/settings/:setting Update setting for specific user
PUT /api/users/:id/vcards Update vcard options for specific user
DELETE /api/users/:id Delete specific user

Themes

Method Url Description
GET /api/themes Get all themes
GET /api/themes/:id Get specific theme
POST /api/themes/:id/images Upload images for specific theme
PUT /api/themes/:id Update specific theme

Steps to setup

1. Clone the application

git clone [email protected]:CardMesh/rest-api.git && cd rest-api

2. Configure your private .env file, following the .env.example sample

3. Initialize the database

This will install the program with a lot of test users. To change this, you can modify ./src/data/ddl.js.

npm run db:init

4. Run the app

npm run dev # dev
npm run start # prod

Docker

If you're considering deploying using docker-compose, here's a simple example. Please see ./docker-compose.yml.

docker-compose up -d

Roadmap

See the open issues for a complete list of proposed features (and known issues).

Contributing

If you have a suggestion to enhance this project, kindly fork the repository and create a pull request. Alternatively, you may open an issue and tag it as "enhancement". Lastly, do not hesitate to give the project a star ⭐. Thank you for your support.

db.png

Tools

Coding standards checker:

npm run lint

Coding standards fixer:

npm run format

Unit tests:

npm run test

License

The distribution of the package operates under the MIT License. Further information can be found in the LICENSE file.

DISCLAIMER: USE OF THIS GITHUB REPOSITORY

By accessing and using this GitHub repository ("Repository"), you agree to the following terms and conditions. If you do not agree with any of these terms, please refrain from using the Repository.

  1. No Warranty or Liability: The Repository is provided on an "as is" basis, without any warranties or representations of any kind, either expressed or implied. The owner(s) of the Repository ("Owner") hereby disclaim(s) any and all liability for any damages, losses, or injuries arising out of or in connection with the use, inability to use, or reliance on the Repository.

  2. No Legal Advice: The content and information provided in the Repository are for informational purposes only and do not constitute legal advice. The Owner does not assume any responsibility for any actions taken or not taken based on the information provided in the Repository. For legal advice or specific inquiries, consult a qualified legal professional.

  3. Intellectual Property: The Repository may contain copyrighted materials, including but not limited to code, documentation, images, and other intellectual property owned by the Owner or third parties. You may not use, copy, distribute, or modify any such materials without obtaining prior written permission from the respective copyright holder(s).

  4. External Links: The Repository may include links to third-party websites or resources. The Owner does not endorse, control, or assume any responsibility for the content or practices of these third-party websites or resources. Accessing and using such links are solely at your own risk.

  5. Modification of Repository: The Owner reserves the right to modify, update, or remove any content or functionality of the Repository at any time without prior notice. The Owner shall not be liable for any consequences arising from such modifications.

  6. Indemnification: You agree to indemnify and hold the Owner harmless from and against any claims, damages, liabilities, costs, and expenses arising out of or in connection with your use of the Repository, including but not limited to any violation of these terms.

  7. Governing Law: These terms shall be governed by and construed in accordance with the laws of the jurisdiction where the Owner is located, without regard to its conflict of law principles.

By using the Repository, you acknowledge that you have read, understood, and agreed to these terms and conditions. If you do not agree with any of these terms, your sole remedy is to discontinue using the Repository.

About

REST API repository for CardMesh.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors 2

  •  
  •