Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Streakify API

A production-ready REST API for a productivity application that enables users to manage tasks, track daily streaks, and securely access their data using JWT Authentication.


🌐 Live API

🔗 https://streakify-api.onrender.com/


✨ Features

  • JWT Authentication
  • Secure Protected Routes
  • User Registration & Login
  • Full CRUD Operations for Tasks
  • Daily Streak Tracking
  • User-specific Data Isolation
  • RESTful API Design
  • Error Handling & Validation

🛠️ Tech Stack

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • JWT
  • Bcrypt

📦 API Endpoints

Authentication

Method Endpoint Description
POST /api/register Register a new user
POST /api/login Login user

Tasks (Protected)

Method Endpoint Description
GET /api/tasks Get all tasks
POST /api/tasks Create a task
PUT /api/tasks/:id Update a task
DELETE /api/tasks/:id Delete a task

🔐 Authentication

All protected routes require:

Authorization: Bearer YOUR_JWT_TOKEN

🔥 Streak Logic

  • Completing tasks on consecutive days increases the streak.
  • Missing a day resets the streak.
  • Multiple task completions on the same day count only once.

📂 Folder Structure

controllers/
middleware/
models/
routes/
app.js
package.json

⚙️ Installation

Clone the repository

git clone https://github.com/OmBaisane/Streakify-API.git

Navigate to the project

cd Streakify-API

Install dependencies

npm install

Create a .env file:

PORT=3000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key

Run the server

npm run dev

📚 Key Learnings

  • JWT Authentication
  • REST API Design
  • Express Middleware
  • MongoDB & Mongoose
  • Authentication & Authorization
  • Secure Route Protection
  • Backend Project Structure

🔮 Future Improvements

  • Refresh Tokens
  • Email Verification
  • Password Reset
  • Rate Limiting
  • Swagger API Documentation
  • Docker Support

📫 Contact


📄 License

This project is licensed under the MIT License.

About

REST API built with Node.js, Express and MongoDB featuring JWT authentication, CRUD operations and secure API architecture.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages