No description
Find a file
2024-07-04 15:14:45 +05:30
src 054 2024-07-04 15:14:45 +05:30
tests 019 2024-06-26 23:34:19 +05:30
.gitignore 016 2024-06-25 02:48:04 +05:30
db6.sqlite3 051 2024-07-04 03:56:30 +05:30
n3.nimble 002 2024-06-18 00:41:14 +05:30
README.MD 050 2024-07-04 03:24:25 +05:30

Authentication API

Introduction

This is a README file for a newly developed Authentication API built with Nim on the backend and HTML5 and CSS3 for potential client applications.

Project Support Features

  • Users can signup and login to their accounts
  • Public (non-authenticated) users can access all causes on the platform
  • Authenticated users can access all causes as well as create a new cause, edit their created cause and also delete what they've created.

Installation Guide

  • Clone this repository here.
  • The develop branch is the most stable branch at any given time, ensure you're working from it.
  • Run nimble install to install all dependencies
  • You need to install SQLite3 on your device.

Usage

  • Run nim c -r src/n3.nim to start the application.
  • Connect to the API using Postman on port 8080.

API Endpoints

HTTP Verbs Endpoints Action
POST /api/signup To sign up a new user account
POST /api/login To login an existing user account
GET /signup To sign up a new user account through the browser
GET /login To login a new user account through the browser

Expanded API Endpoint Details

Signing Up a New User using API

  • Endpoint: POST /api/signup
  • How to use: /api/signup?username={newUser}&email={Email}&password={Password}
  • Payload Example:
    {
      "status": "success",
      "message": "User created successfully"
    }
    
  • Description:This endpoint is used to create a new user account. The request should include a JSON payload with a username, email and password.

Logging in an Existing User using API

  • Endpoint: POST /api/login
  • How to use: /api/login?username={newUser}&password={Password}
  • Payload Example:
    {
      "message": "Login successful",
      "username": "newUser",
      "email": "ee@rrr.tt",
      "password": "password123"
    }
    
  • Description:This endpoint is used to login an existing user account. The request should include a JSON payload with a username and password.
  • Endpoint: GET /signup
  • How to use: redirect to /signup on your browser
  • Payload Example:
    {
      "status": "success",
      "message": "User created successfully"
    }
    
  • Description:This endpoint is used to create a new user account. The request should include a JSON payload with a username, email and password.
  • Endpoint: GET /login
  • How to use: redirect to /login on your browser
  • Payload Example:
    {
      "message": "Login successful",
      "username": "newUser",
      "email": "ee@rrr.tt",
      "password": "password123"
    }
    
  • Description:This endpoint is used to login an existing user account. The request should include a JSON payload with a username and password.

Technologies Used

  • Nim This is a cross-platform runtime environment built on Chrome's V8 JavaScript engine used in running JavaScript codes on the server. It allows for installation and managing of dependencies and communication with databases.
  • Mike This is a NodeJS web application framework.
  • SQLite3 This is a free open source NOSQL document database with scalability and flexibility. Data are stored in flexible JSON-like documents.

Authors