Coder Social home page Coder Social logo

hackthatstartup3's Introduction

Hack That Startup v3 (Individual)

This is the solution for the individual challenge of the hackathon Hack That Startup v3.

Deployed: App

Table of Contents

Starting the project

Clone the repository

npm clone

Install the dependencies:

npm install

Make sure to create your own environment file in src/config folder. There is a sample.env, copy it and use your own variables.

Start in development mode: (Server on watch mode)

npm start

Testing Environment

The project testing is done using Jest and Supertest modules.

When the testing environment is running, Jest cannot read .env files with env-cmd module. For that reason, the enviroment variables are served by a JavaScript file in .jest folder. There is a sample that needs to have the asked variables.

Then, the test environment can be run.

npm test

Folders structure

All the typescript code is in src folder.

Folder / File Description
api All business logic and model handlers.
app Express server configuration (DB, HELMET, ...).
bin Server Port configuration.
config Environment variables depending on server status (dev, prod, test, ...).
graphql GraphQL Api files (schema, types, resolvers,...).
routes Main route file for app server
scripts Isolated functions
tests Testing functions
app.js Server declaration and configuration

NPM scripts

Compiler to high compability JavaScript version

npm run build

Server on development mode (ES6 or later).

npm start

Start high compability server

npm run serve

Delete compiled JavaScript code

npm run clean

Start test environment

npm test

Force heroku to run npm build before the start

npm run heroku-postbuild

Models routing

All the routes are defined following REST convention.

User

GET

Return all users:

  • GET: /api/user

Return one user by id:

  • GET: /api/user/:id

POST

Create one user

  • POST: /api/user

PATCH

Updated one user by id

  • PATCH: /api/user/:id

DELETE

Delete one user by id

  • DELETED: /api/user/:id

Repository

GET

Return all repositories:

  • GET: /api/repository

Return one repository by id:

  • GET: /api/repository/:id

POST

Create one repository

  • POST: /api/repository

PATCH

Updated one repository by id

  • PATCH: /api/repository/:id

DELETE

Delete one repository by id

  • DELETED: /api/repository/:id

GraphQL

The GraphQL API is an addition, can interact with the models and make requests to database.

The setup is done but some implementations are missing for now

hackthatstartup3's People

Contributors

erixmv avatar

Watchers

 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.