Code Monkey home page Code Monkey logo

buildforsdgcohort2 / team-050-backend Goto Github PK

View Code? Open in Web Editor NEW
1.0 6.0 3.0 200 KB

A criminal registry web platform. The platform that afford all citizens of Nigeria the privilege of viewing their criminal records. citizens register on the platform and request for their criminal record, after making provision the necessary requirements to prove their identity, their criminal record will be made available on their dashboard.

JavaScript 100.00%
crime-data crime-analysis crime-incidents crime-alerts criminal-justice-data criminal-justice criminal-activities crime-registry

team-050-backend's Introduction

TEAM-050-Backend

Codacy Badge

A platform for Nigerian Citizens to easily have access to their criminal records.

Pre-Requisites

  • MongoDB and database created

How to Install and run the application

  • Clone the application and run npm install
  • Run cp config/default.examples.js config/default.js to create the default variables and fill them
  • Run npm run dev to start development server

API Documentation

Technologies Used

  • NodeJS / Express
  • Mongo Database
  • Postman

Author

team-050-backend's People

Contributors

codacy-badger avatar udofia2 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

team-050-backend's Issues

Needs Attention please!

Also, when we hit 'GET /api/v1/citizen/profile/:id'
the id parameter in the req will course a lot of problems, its suppose to be a the citizen._id right?
but i can't get the citizen details until this code runs const citizen = await Citizens.findOne({ _id: req.params.id });
And that code only runs on a GET request to /api/v1/citizen/profile/:id which requires a param of the citizen id,whc i dont have yet

so i suggest you change the controller url from /api/v1/citizen/profile/:id to /api/v1/citizen/profile
And
const citizen = await Citizens.findOne({ _id: req.params.id });
to something like :
const citizen= await Citizens.findById(req.user, '-password'); res.json({ citizen});

Originally posted by @sleekLancelot in #13 (comment)

citizens/register

In the register controller(/api/v1/citizen/register), after registration and you 'citizen.save()', can you make it return a token just like it does in the login controller? The way it is now it seems, one would have to login again after registering.

you can make it something like:

await citizen.save();
const payload = {
       id: citizen._id,
     };
     const token = jwt.sign(payload, mySecrete, { expiresIn: "1hr" });

     res.json({
       msg: "you are now logged in",
       token,
     });

Profile avatar

Users should be able to upload and remove profile avatar on their dashboard through the profile settings

citizen model

Afternoon Ben,please make the citizen model look like this

register({
                firstName,
                lastName,
                email,
                phone,
                placeOfBirth,
                residentialAddress,
                dateOfBirth,
                nationality,
                passportNum,
                nationalIdentificationNumber,
                password,
                password2
            })

Citizen can register on the platform

The following details should be saved in the database of a newly registered citizen on the platform
Fullname, Scanned passport pages, place of birth, duration of stay in Nigeria, Age, Nationality and Finger print

codacy

integrate repo with codacy.com

encrypt password

password in the database can not be comprised, citizen password and data must be well protected

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.