Website | Frontend | User Manual | Contributing | Chat
This is a REST API in Node.js using ES6 and Express. Intended for use with Postgres using node-postgres.
npm install
node serve.js
npm run dev
Package | Feature | Sumary |
---|---|---|
bcrypt-nodejs | -- | Used to hash user's password before saving it into the DB. |
colors | -- | -- |
cors | -- | -- |
express-validator | API parameter validation | Validate body, params, query, headers and cookies of a request (via middleware) and return a response with errors; if any of the configured validation rules fail. You won't anymore need to make your route handler dirty with such validations. |
jsonwebtoken | Authentication | Used to generate and verify authentication tokens. |
moment | -- | -- |
nodemon | Auto server restart | Restart the server in real-time anytime an edit is made. |
pg | -- | -- |
socket.io | -- | -- |
-- | Code linting | -- |
uuid | -- | -- |
VSCode Extension | Description |
---|---|
.editorconfig | It helps developers define and maintain consistent coding styles between different editors and IDEs. |
- RuviClass API Doc - RuviClass API REST Documentation.
Because I thought it sounded cute. All these programs talk about being "performant", "rigid", "robust" - I like programming to be light, fun and non-scary. Choo embraces that.
- RuviClass Client - RuviClass Client repository.
- FlavioCopes Blog - Node.js, Express.js, REST API Backend by Postgres and much more.
- CharlieTheProgrammer - Updated Node.js tutorials.
- Spanish Express.js Guide - Official Guide.
- Node University - Premium Beginner/Advanced Courses.
- Node Express Boilerplate - Express.js Boilerplate.
- Node Best Practices
We love contributions! Check out the Contribution Guide for more information.
Creating a quality framework takes a lot of time. Unlike others frameworks, RuviClass is completely independently funded. We fight for our users. This does mean however that we also have to spend time working contracts to pay the bills. This is where you can help: by chipping in you can ensure more time is spent improving RuviClass rather than dealing with distractions.
Become a backer, and buy us a coffee (or perhaps lunch?) every month or so. Become a backer Thank you to all our backers! 🙏
Become a sponsor and help ensure the development of independent quality software. You can help us keep the lights on, bellies full and work days sharp and focused on improving the state of the web. Become a sponsor
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
Thanks to:
- JetBrains for supporting us with a Free Open Source License.
Usage is provided under the MIT© License.
SELECT m.name, c.id_class, c.id_module, c.description, c.status, c.date, c.created_at, c.updated_at
FROM modules AS m
INNER JOIN (
SELECT id_class, id_module, description, status, date, created_at, updated_at
FROM classes
WHERE id_module IN(
SELECT id_module
FROM modules
WHERE id_course = 2
)
) AS c
ON m.id_module = c.id_module;
Personalizar los logs: https://github.com/pinojs/pino?fbclid=IwAR0YlQK9TC183FdLcIDIE7XpzIZhtHS8H27uTUp5uInDgJ_JdfXAQsUVz6E
Implementar un console.table personalizado: https://codereview.stackexchange.com/questions/157402/implementing-console-table-in-javascript https://stackoverflow.com/questions/17224130/formatting-text-with-tabs-or-spaces/17252151
En Firefox funciona bien pero en chrome envia login al socket pero hace reedireccionamiento al login siendo que la sesion existe.
¿Quien hace el reedireccionamiento?
Los this.router.navigate(['/login']);
...
Si recargo la página recién iniciada la sesión si funciona. Ejemplo: http://localhost:4200/admin
Si cierro chrome y vuelvo a entrar a la url: http://localhost:4200/admin también funciona.
¿En alguna parte se verificará la expiración del token? Esto se verifica siempre desde el servidor. Para verificar en el cliente sería necesario el SEED pero por razones de seguridad no se recomienda.
Prueba de usuarios: profesor: [email protected] admin
estudiante1: [email protected] 1234
estudiante2: [email protected] 1234
const PAD_START = 10
function logInfo(message: string){
console.log(`${colors.cyan.bold('[SOCKET]'.padStart(PAD_START))} ${message}`);
}
function logSocket(message: string){
console.log(`${colors.cyan.bold('[SOCKET]'.padStart(PAD_START))} ${message}`);
}
function logConnect(message: string){
console.log(`${colors.cyan.bold('[SOCKET]'.padStart(PAD_START))} ${message}`);
}
Si me voy al login teniendo una sesión iniciada, realizar la reedirección al dashboard correspondiente.
Cuando me voy al dashboard y el token esta vencido realiza el reedireccionamiento al login pero de igual manera emite el evento socket...