A simple backend to track your stuff.
As long as the integration has been developed, you can track whatever you prefer.
- Clone this repo
git clone https://github.com/nobody-productions/stufftrack-backend.git && cd stufftrack-backend
- Install NodeJS on your system in your preferred way. Also, make sure to have a fully functional PostgreSQL installation with a working database.
- Run
npm install
- Fill out the
.env.sample
file and rename it.env
- If you plan to do some mockup test, run the seeders.
npm run <seeder available>:seed;
Alternatively, you can replicate the database which has been used in development by simply running:
npm run populate-vg
- Run the application by running
npm run start
- Define your model: TypeORM (an ORM) has been used to create the database too, so make sure to define your entities and relationships. It will be easier for you, and you won't spend a lot of time to figure out what's wrong.
- Create your entities in an appropriate folder. See what's already here. Make sure to eventually define your constraints (e.g. primary key, unique...).
- While choosing a prefix for your table, make sure to choose an appropriate prefix. Right now, two letters prefixes are preferred.
- Create your seeders: it is important for testing the database. Just create a file which will be run for testing purpose only. It will create some entries in your database. Make sure everything's correct!
- Create your controllers: controllers are used to chat with user. They'll be used in your routes.
- Define your routes: into
routes.ts
, define your roots. They will call your controllers functions and this is how you will chat with our users. - Test: this is the most important part, test your route before submitting. A good route should check bad inputs and have a middleware if needed.
- In this phase, I highly recommend tools like Postman
- Launch a PR: if everything's ready, we can integrate another module. Yay! ✨
See documentation to know what's going on (needs to be translated from italian).
If you're italian, take a look to: italian documentation.
Everything is under AGPL, see LICENSE to learn more.