Skip to content

🌱 A node and mongo Rest API project template. A seed, which can grow into something way bigger.

License

Notifications You must be signed in to change notification settings

LukasMeine/project-seed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Seed Project

A node and mongo Rest API project template. A seed, which can grow into something way bigger.

Branch License

Art by absurd.design

Quickstart With Docker

Install Docker

Install Docker-compose

In your terminal, run:

docker-compose build 

In your terminal, run:

docker-compose up

About the configurations

Database

If you need to change the IP or collection of the database, go to app/helper/constants.js. You will find:

//Changes go here for the IP
module.exports = Object.freeze({
    MONGO_IP_DEV: '{your database ip}/{your database collection}'
});

Server

If you need to make changes to the binded IP of the server (although it binds currently to 0.0.0.0, which will work on every network interface you have) or to the port, see server.js in the main directory.

You will find the following (at line ~17):

const port = process.env.PORT || 3000; // set our port

That is where you may change the default port. You can also pass the argument --port in case you need to bind to any other port instead of the default one.

The code

The structure goes like this:

  • app/repository has every connection to the database. It uses the mongojs lib and each file will contain queries related to a specific entity (for instance, companies has queries related to it, etc).
  • app/router has every route and control of the route. As I said before... there is project pattern with pretty controllers around and etcera. You just define the route importing route from express and voilá. Do not forget to add it to app/router/index later!
  • the others parts are just helpers and modules (like login and jwt). Don't worry about it :)

About

🌱 A node and mongo Rest API project template. A seed, which can grow into something way bigger.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages