Skip to content

purefml/charmander

Repository files navigation

📜 API

A Node.js and Express-based API using TypeScript, MongoDB, and Mongoose for handling referrals.

Node.js
Express.js
MongoDB
TypeScript


🛠️ Features

✅ Create, update, delete, and retrieve referrals
✅ Uses Mongoose for database interactions
Express.js for API routing
TypeScript for type safety
Cloudinary for image storage (if applicable)
Dotenv for environment variables


📦 Installation

1️⃣ Clone the repository

git clone https://github.com/purefml/charmander.git
cd charmander

2️⃣ Install dependencies

npm install

3️⃣ Set up environment variables

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

NODE_ENV = 'development'
MONGODB = 'mongodb+srv://delacruzrubenjames:[email protected]/?retryWrites=true&w=majority&appName=Charmander'
CLOUDINARY_CLOUD_NAME='dxkmfa8ea'
CLOUDINARY_API_KEY='531486551519759'
CLOUDINARY_API_SECRET='3lMHMHHAXEn3lC4pRpHCrhpttlQ'

4️⃣ Run the project

Development Mode (using ts-node and nodemon)

npm start

Production Mode (compiling TypeScript and running with Node.js)

npm run build
node dist/index.js

🛠️ API Endpoints

📌 Referrals API

Method Endpoint Description
POST /api/referrals Add a new referral
GET /api/referrals Get all referrals
PUT /api/referrals/:id Update a referral by ID
DELETE /api/referrals/:id Delete a referral by ID

🛠️ Technologies Used

  • Backend: Node.js, Express.js
  • Database: MongoDB, Mongoose
  • TypeScript: Type Safety
  • Middleware: Body-parser, Multer
  • Storage: Cloudinary (optional)
  • Environment Variables: Dotenv

📜 License

This project is licensed under the ISC License.


Let me know if you want any modifications! 🚀🔥

About

Simple CRUD Restful API for Referral App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published