Skip to content

This repository is the part of the ColorsMosaic project containign REST API of the application.

Notifications You must be signed in to change notification settings

sbacanski0730/cm-colors-mosaic-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

cm-colors-mosaic-api

This repository is the part of the ColorsMosaic project containing REST API of the application.

Goal

The goal is to create a small REST API in Typescript. Application needs to be able to service frontend part of the application.

Introduction

The idea for this application was to create a tool in the form of a website for viewing and creating color sets. It would help in creating mobile and web application projects.

This API was created for the the needs of the project involving two separate parts that make up a web application. This repository contains the backend part of the application and is responsible for connection the frontend part with database of the application. REST API can sign in a new user and sigh up already existing with using JWT for access and refresh token. Other functionalities include searching the database for saved user's colors and sets of colors. Database also contains pre created colors sets.

Features

  • User authentication
  • User authorization
  • Logout user
  • Account verification with mail
  • Saving new colors for users
  • Getting user's saved colors
  • Getting user's saved colors sets
  • Getting most popular colors from external sources
  • Getting pre created colors sets from external sources

Requirements

  • Express.js as the framework
  • MongoDB as database technology
  • Swagger in use for API documentation
  • User authentication is based on JWT access and refresh token
  • During user's authentication, the application will recognize user's agent
  • Pre created colors sets are fetch from external sources
  • Sessions will be stored in database in dedicated cluster
  • AccessToken expire after 15 minutes and refresh token after 1 year
  • Tests

Installation Guide

[ work in progress ]

Usage

[ Here will be a set of instructions to user this repository ]

API Endpoints

HTTP Endpoint Action
POST /api/auth/register New user authentication
POST /api/auth/login User authorization
POST /api/auth/logout User logout
GET /api/user/colors Get user's colors
GET /api/user/colors-sets Get user's colors sets
POST /api/user/colors Save new user's color
DELETE /api/user/colors/:id Delete user's color
DELETE /api/user/colors-sets/:id Delete user's colors set

Technologies and Tools

TypeScript Node.js Express mongoDB Jest Swagger WebStorm npm

Structure

[ temporary demo ]

|
├── config
|   └──default
├── src
│   ├── controllers
│   ├── interfaces
│   ├── middlewares
│   ├── models
│   ├── routes
│   ├── services
│   ├── utils
│   ├── App.ts
│   └── index.ts
├── .env
├── package-lock.json
├── package.json
└── tsconfig.json

About

This repository is the part of the ColorsMosaic project containign REST API of the application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published