Coder Social home page Coder Social logo

trellixvulnteam / user-database_zg6h Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hamiltoncameron7/user-database

0.0 0.0 0.0 9.12 MB

A node.JS and Angular application that just keeps a list of users in a JSON document, and allows you to add users. Will be more interactive in the future

JavaScript 35.50% TypeScript 56.58% CSS 1.11% HTML 5.22% Pug 1.60%

user-database_zg6h's Introduction

User-Database

A node.JS and Angular application that just keeps a list of users in a JSON document, and allows you to add users

Node

The node application is located in the main folder, created by express

To start the server on your machine, open the command line in the main folder and run:

npm start

app.js

There are comments explaining details of each section in the code, but this file houses the server setup on localhost:3000, and directs requests to the appropriate location

routes

The routes folder contains the different routes for requests. The index request was the original Express landing page, which can probably be deleted The users request can probably be deleted, but I'm not sure if it came from Express or if it was added during testing The api request is the main route. This is the route that conatins the read and write functionality for the JSON file The testData.JSON file is held here for now, but should probably be moved

Angular

The Angular app is all contained in the sub folder "AngTest", created with AngularCLI Not much was changed in the main Angular folder, the src/app folder contains the majority of the written code

To start the angular application on your machine, open the command line in the AngTest folder and run:

ng serve

app.component.html

This file loads in the datareader and datawriter modules, along with setup for passing the datareader.getTheData function to allow it to be called from a datawriter on event

datareader

This folder contains the functionality and output template for the users to be read from the server

datareader.component.html

This uses ngFor to loop through all the users and output as p elements. Should probably be changed to output as li elements

datareader.component.ts

There are comments explaining details, but this contains the get request and outputs the data to theData, which is used in the html

datawriter

This folder contains the functionality and form template for sending new users to the server to be added to the JSON document

datawriter.component.html

The form is a formGroup, that passes the data from the form to the JS code in the ts file on submit

datawriter.component.ts

There are comments explaining details, but this contains the post request to the server, with the user name to be added This also contains an event emitter that will cause the get request to be triggered again on submit, so that the list can be updated without refreshing the page

user-database_zg6h's People

Contributors

hamiltoncameron7 avatar trellixvulnteam avatar

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.