Xarerp - API
System to manage sales, inventory, employees, stores and more.
Developed with
This is just the back-end of the application, to have visual references and also get the front-end (created in React), go to: Xarerp - Client
Some features
- ✅ Authentication persistence using jsonwebtoken
- ✅ Protected routes
- ✅ Routes with access permissions based on the logged in user
- ✅ CRUD for each registration functionality
- ✅ Rules for not allowing duplicate entries
- ✅ Search and pagination filters
- ✅ Metrics from the last 7, 15 and 30 days
Running the API
After having cloned the repository and accessed its folder through the terminal, run the command below (remember to have installed Node + NPM and PostgreSQL)
npm install
-
Rename the .env.example file to just .env and replace the information value with your development environment.
-
Make sure you activate your PostgreSQL and run the command below to create the tables
npx prisma migrate dev
- After creating the tables in the database, run the command below to populate the tables with some initial data (don't skip this step)
npx prisma db seed
The previous command has populated some data in the database, and by default you can use the following access credentials to login:
e-mail: user@mail.com
password: 1234
If all went well so far, the API will be ready to run.
- Run the command below to activate the API and test it on Insomnia, Postman or your favorite software.
npm start
API routes are documented in the api-documentation file, use it as a guide.
Author
- Website - Daniel Mafra
- LinkedIn - @danielmafradev
- Instagram - @danielmafradev